dxx-rebirth/common
Kp 27586fe0b9 Track newmenu return value using std::shared_ptr
JoeNotCharles reports that gcc-12 (architecture unspecified) warns
because `newmenu::process_until_closed` stores the address of a stack
local into a heap-allocated structure.  Switch to a less efficient
implementation that does not provoke a compiler warning:

- Store `shared_ptr<int>`, not `int *`, in the `newmenu`
- `shared_ptr::operator*()` and `shared_ptr::operator bool()` allow most
  use sites to be unchanged relative to a bare pointer
- Load the return value from the `shared_ptr<int>`.  If the newmenu
  terminated before return, as should always happen, this is a slightly
  less efficient version of the same code as before.  If the newmenu was
  still open despite its `exists` flag claiming otherwise, then the
  returned value may be incorrect, but the read will be well-formed, the
  `newmenu`'s eventual write will write to the heap-backed int (rather
  than writing into the stack allocated to
  `newmenu::process_until_closed`), and the memory will be freed when
  both `process_until_closed` has returned and the `newmenu` has been
  destroyed.

Reported-by: JoeNotCharles <10a2b2d337>
2023-01-14 19:05:37 +00:00
..
2d Pass std::span to decode_data 2022-09-24 17:47:52 +00:00
3d Use enum class for clipping_code 2022-10-02 19:51:35 +00:00
arch Move window existence flag to a mixin, and track using std::shared_ptr 2023-01-14 19:05:37 +00:00
editor Move various static functions into anonymous namespace 2022-07-09 13:39:29 +00:00
include Move window existence flag to a mixin, and track using std::shared_ptr 2023-01-14 19:05:37 +00:00
main Track newmenu return value using std::shared_ptr 2023-01-14 19:05:37 +00:00
maths Remove quadint members low, high 2022-05-24 02:32:58 +00:00
mem
misc Test whether change_filename_extension succeeded before using its output 2022-10-09 23:15:20 +00:00
music
texmap Pass std::span to draw_tmap, draw_tmap_flat 2022-09-24 17:47:52 +00:00
ui Make window_send_event a method of window 2022-12-18 23:10:39 +00:00
unittest Flatten type information for zip<> 2022-12-31 16:21:47 +00:00