Avoid calling make_unique<...>({})
The compiler may or may not recognize that the temporary T{} passed to make_unique can be omitted. Help it by passing nothing, then explicitly clearing the returned data as a separate step.
This commit is contained in:
parent
cbeb42e48c
commit
a1ab71f5ad
|
@ -776,7 +776,8 @@ int gr_init()
|
|||
|
||||
ogl_init_texture_list_internal();
|
||||
|
||||
grd_curscreen = make_unique<grs_screen, grs_screen>({});
|
||||
grd_curscreen = make_unique<grs_screen>();
|
||||
*grd_curscreen = {};
|
||||
grd_curscreen->sc_canvas.cv_bitmap.bm_data = NULL;
|
||||
|
||||
// Set the mode.
|
||||
|
|
|
@ -174,7 +174,8 @@ int gr_init()
|
|||
Error("SDL library video initialisation failed: %s.",SDL_GetError());
|
||||
}
|
||||
|
||||
grd_curscreen = make_unique<grs_screen, grs_screen>({});
|
||||
grd_curscreen = make_unique<grs_screen>();
|
||||
*grd_curscreen = {};
|
||||
|
||||
if (!CGameCfg.WindowMode && !CGameArg.SysWindow)
|
||||
sdl_video_flags|=SDL_FULLSCREEN;
|
||||
|
|
|
@ -223,7 +223,8 @@ void credits_show(const char *credits_filename)
|
|||
const char *filename = CREDITS_FILE;
|
||||
palette_array_t backdrop_palette;
|
||||
|
||||
auto cr = make_unique<credits, credits>({});
|
||||
auto cr = make_unique<credits>();
|
||||
*cr = {};
|
||||
if (credits_filename) {
|
||||
filename = credits_filename;
|
||||
cr->have_bin_file = 1;
|
||||
|
|
Loading…
Reference in a new issue