diff --git a/common/2d/bitmap.cpp b/common/2d/bitmap.cpp index 27d44a1e6..77ccd5f29 100644 --- a/common/2d/bitmap.cpp +++ b/common/2d/bitmap.cpp @@ -52,7 +52,7 @@ void gr_set_bitmap_data(grs_bitmap &bm, const uint8_t *data) grs_bitmap_ptr gr_create_bitmap(uint16_t w, uint16_t h ) { RAIIdmem d; - MALLOC(d, unsigned char, MAX_BMP_SIZE(w, h)); + MALLOC(d, uint8_t[], MAX_BMP_SIZE(w, h)); return gr_create_bitmap_raw(w, h, std::move(d)); } @@ -91,7 +91,7 @@ void gr_init_main_bitmap(grs_main_bitmap &bm, const bm_mode mode, const uint16_t void gr_init_bitmap_alloc(grs_main_bitmap &bm, const bm_mode mode, const uint16_t x, const uint16_t y, const uint16_t w, const uint16_t h, const uint16_t bytesperline) { RAIIdmem d; - MALLOC(d, unsigned char, MAX_BMP_SIZE(w, h)); + MALLOC(d, uint8_t[], MAX_BMP_SIZE(w, h)); gr_init_main_bitmap(bm, mode, x, y, w, h, bytesperline, std::move(d)); } diff --git a/common/include/u_mem.h b/common/include/u_mem.h index b8788703e..2c178793e 100644 --- a/common/include/u_mem.h +++ b/common/include/u_mem.h @@ -158,12 +158,6 @@ RAIIdmem &MALLOC(RAIIdmem &r, std::size_t count, const char *var, const ch return r.reset(MALLOC::element_type>(p, count, var, file, line)), r; } -template -RAIIdmem &MALLOC(RAIIdmem &r, const std::size_t count, const char *const var, const char *const file, const unsigned line) -{ - return MALLOC(r, count, var, file, line); -} - template void CALLOC(RAIIdmem &r, std::size_t count, const char *var, const char *file, unsigned line) { diff --git a/similar/2d/font.cpp b/similar/2d/font.cpp index dd1c6e392..4489fb642 100644 --- a/similar/2d/font.cpp +++ b/similar/2d/font.cpp @@ -508,7 +508,7 @@ static void ogl_init_font(grs_font * font) { RAIIdmem data; const unsigned length = tw * th; - MALLOC(data, uint8_t, length); + MALLOC(data, uint8_t[], length); std::fill_n(data.get(), length, TRANSPARENCY_COLOR); // map the whole data with transparency so we won't have borders if using gap gr_init_main_bitmap(font->ft_parent_bitmap, bm_mode::linear, 0, 0, tw, th, tw, std::move(data)); } diff --git a/similar/main/multi.cpp b/similar/main/multi.cpp index 127f4cbd4..45b719a50 100644 --- a/similar/main/multi.cpp +++ b/similar/main/multi.cpp @@ -5617,7 +5617,7 @@ void init_hoard_data(d_vclip_array &Vclip) return; const unsigned extent = icon_w * icon_h; RAIIdmem bitmap_data2; - MALLOC(bitmap_data2, uint8_t, extent); + MALLOC(bitmap_data2, uint8_t[], extent); PHYSFS_read(ifile,&palette[0],sizeof(palette[0]),palette.size()); PHYSFS_read(ifile, bitmap_data2.get(), 1, extent); gr_init_main_bitmap(i, bm_mode::linear, 0, 0, icon_w, icon_h, icon_w, std::move(bitmap_data2));