Merge branch 'resolve-1256' into 'next'

Resolve #1256

Closes #1256

See merge request STJr/SRB2!2475
This commit is contained in:
sphere 2024-06-07 13:15:00 +00:00
commit 60a8d91d44
6 changed files with 5 additions and 7 deletions

View file

@ -71,7 +71,7 @@ apng_create_info_struct (png_structp pngp)
{ {
apng_infop ainfop; apng_infop ainfop;
(void)pngp; (void)pngp;
if (( ainfop = calloc(sizeof (apng_info),1) )) if (( ainfop = calloc(1,sizeof (apng_info)) ))
{ {
apng_set_write_fn(pngp, ainfop, 0, 0, 0, 0, 0); apng_set_write_fn(pngp, ainfop, 0, 0, 0, 0, 0);
apng_set_set_acTL_fn(pngp, ainfop, 0); apng_set_set_acTL_fn(pngp, ainfop, 0);

View file

@ -1024,7 +1024,7 @@ void D_StartTitle(void)
#define REALLOC_FILE_LIST \ #define REALLOC_FILE_LIST \
if (list->files == NULL) \ if (list->files == NULL) \
{ \ { \
list->files = calloc(sizeof(list->files), 2); \ list->files = calloc(2, sizeof(list->files)); \
list->numfiles = 1; \ list->numfiles = 1; \
} \ } \
else \ else \

View file

@ -2791,7 +2791,7 @@ void readframe(MYFILE *f, INT32 num)
size_t z; size_t z;
boolean found = false; boolean found = false;
size_t actionlen = strlen(word2) + 1; size_t actionlen = strlen(word2) + 1;
char *actiontocompare = calloc(actionlen, 1); char *actiontocompare = calloc(1, actionlen);
strcpy(actiontocompare, word2); strcpy(actiontocompare, word2);
strupr(actiontocompare); strupr(actiontocompare);

View file

@ -1191,7 +1191,7 @@ boolean preparefilemenu(boolean samedepth)
size_t i; size_t i;
if (filenamebuf == NULL) if (filenamebuf == NULL)
filenamebuf = calloc(sizeof(char) * MAX_WADPATH, numwadfiles); filenamebuf = calloc(numwadfiles, sizeof(char) * MAX_WADPATH);
for (i = 0; i < numwadfiles; i++) for (i = 0; i < numwadfiles; i++)
{ {

View file

@ -33,8 +33,6 @@ target_compile_options(SRB2SDL2 PRIVATE
-Wall -Wall
-Wno-trigraphs -Wno-trigraphs
-W # Was controlled by RELAXWARNINGS -W # Was controlled by RELAXWARNINGS
-pedantic
-Wpedantic
-Wfloat-equal -Wfloat-equal
-Wundef -Wundef
-Wpointer-arith -Wpointer-arith

View file

@ -1706,7 +1706,7 @@ static void Impl_VideoSetupBuffer(void)
vid.direct = NULL; vid.direct = NULL;
if (vid.buffer) if (vid.buffer)
free(vid.buffer); free(vid.buffer);
vid.buffer = calloc(vid.rowbytes*vid.height, NUMSCREENS); vid.buffer = calloc(NUMSCREENS, vid.rowbytes*vid.height);
if (!vid.buffer) if (!vid.buffer)
{ {
I_Error("%s", M_GetText("Not enough memory for video buffer\n")); I_Error("%s", M_GetText("Not enough memory for video buffer\n"));