Fix various warnings

This commit is contained in:
Tim Angus committed 2025-09-07 17:03:20 +01:00
1 parent 549b686e22
commit f976711fb4
58 files changed
+384 -425

No files matched your search

+2 -2
View File
@@ -54,7 +54,7 @@ void R_LoadBMP( const char *name, byte **pic, int *width, int *height )
byte *b;
void *v;
} buffer;
int length;
unsigned length;
BMPHeader_t bmpHeader;
byte *bmpRGBA;
@@ -164,7 +164,7 @@ void R_LoadBMP( const char *name, byte **pic, int *width, int *height )
numPixels = columns * rows;
if(columns <= 0 || !rows || numPixels > 0x1FFFFFFF // 4*1FFFFFFF == 0x7FFFFFFC < 0x7FFFFFFF
|| ((numPixels * 4) / columns) / 4 != rows)
|| (((int)numPixels * 4) / columns) / 4 != rows)
{
ri.Error (ERR_DROP, "LoadBMP: %s has an invalid image size", name);
}
+12 -12
View File
@@ -532,7 +532,7 @@ static uint32_t DecompressIDATs(struct BufferedFile *BF, uint8_t **Buffer)
if(!(BF && Buffer))
{
return(-1);
return((uint32_t)-1);
}
/*
@@ -553,7 +553,7 @@ static uint32_t DecompressIDATs(struct BufferedFile *BF, uint8_t **Buffer)
if(!FindChunk(BF, PNG_ChunkType_IDAT))
{
return(-1);
return((uint32_t)-1);
}
/*
@@ -576,7 +576,7 @@ static uint32_t DecompressIDATs(struct BufferedFile *BF, uint8_t **Buffer)
BufferedFileRewind(BF, BytesToRewind);
return(-1);
return((uint32_t)-1);
}
/*
@@ -613,7 +613,7 @@ static uint32_t DecompressIDATs(struct BufferedFile *BF, uint8_t **Buffer)
{
BufferedFileRewind(BF, BytesToRewind);
return(-1);
return((uint32_t)-1);
}
BytesToRewind += Length + PNG_ChunkCRC_Size;
@@ -626,7 +626,7 @@ static uint32_t DecompressIDATs(struct BufferedFile *BF, uint8_t **Buffer)
CompressedData = ri.Malloc(CompressedDataLength);
if(!CompressedData)
{
return(-1);
return((uint32_t)-1);
}
CompressedDataPtr = CompressedData;
@@ -646,7 +646,7 @@ static uint32_t DecompressIDATs(struct BufferedFile *BF, uint8_t **Buffer)
{
ri.Free(CompressedData);
return(-1);
return((uint32_t)-1);
}
/*
@@ -680,14 +680,14 @@ static uint32_t DecompressIDATs(struct BufferedFile *BF, uint8_t **Buffer)
{
ri.Free(CompressedData);
return(-1);
return((uint32_t)-1);
}
if(!BufferedFileSkip(BF, PNG_ChunkCRC_Size))
{
ri.Free(CompressedData);
return(-1);
return((uint32_t)-1);
}
memcpy(CompressedDataPtr, OrigCompressedData, Length);
@@ -718,7 +718,7 @@ static uint32_t DecompressIDATs(struct BufferedFile *BF, uint8_t **Buffer)
{
ri.Free(CompressedData);
return(-1);
return((uint32_t)-1);
}
/*
@@ -730,7 +730,7 @@ static uint32_t DecompressIDATs(struct BufferedFile *BF, uint8_t **Buffer)
{
ri.Free(CompressedData);
return(-1);
return((uint32_t)-1);
}
/*
@@ -761,7 +761,7 @@ static uint32_t DecompressIDATs(struct BufferedFile *BF, uint8_t **Buffer)
{
ri.Free(DecompressedData);
return(-1);
return((uint32_t)-1);
}
/*
@@ -2364,7 +2364,7 @@ void R_LoadPNG(const char *name, byte **pic, int *width, int *height)
* Rewind to the start of the file.
*/
if(!BufferedFileRewind(ThePNG, -1))
if(!BufferedFileRewind(ThePNG, (unsigned)-1))
{
CloseBufferedFile(ThePNG);
+3 -2
View File
@@ -42,7 +42,7 @@ void R_LoadTGA ( const char *name, byte **pic, int *width, int *height)
{
unsigned columns, rows, numPixels;
byte *pixbuf;
int row, column;
unsigned row, column;
byte *buf_p;
byte *end;
union {
@@ -190,7 +190,8 @@ void R_LoadTGA ( const char *name, byte **pic, int *width, int *height)
}
}
else if (targa_header.image_type==10) { // Runlength encoded RGB images
unsigned char red,green,blue,alphabyte,packetHeader,packetSize,j;
unsigned char red = 0, green = 0, blue = 0, alphabyte = 0;
unsigned char packetHeader, packetSize, j;
for(row=rows-1; row>=0; row--) {
pixbuf = targa_rgba + row*columns*4;