Fix some warnings on gcc/clang

This commit is contained in:
Filip Gawin
2021-01-02 21:54:40 +01:00
parent 9c578580ec
commit c26386c112
16 changed files with 72 additions and 69 deletions

View File

@@ -278,7 +278,7 @@ struct RasterFormatInfo
// indexed directly by RW format
static RasterFormatInfo formatInfoRW[16] = {
{ 0, 0, 0},
{ 0, 0, 0, 0},
{ D3DFMT_A1R5G5B5, 16, 1, Raster::C1555 },
{ D3DFMT_R5G6B5, 16, 0, Raster::C565 },
{ D3DFMT_A4R4G4B4, 16, 1, Raster::C4444 },
@@ -345,7 +345,7 @@ findFormatInfoD3D(uint32 d3dformat)
{
static RasterFormatInfo fake = { 0, 0, 0, 0 };
int i;
for(i = 0; i < nelem(formatInfoFull); i++)
for(i = 0; i < (int)nelem(formatInfoFull); i++)
if(formatInfoFull[i].d3dformat == d3dformat)
return &formatInfoFull[i];
return &fake;

View File

@@ -532,7 +532,7 @@ struct RasterFormatInfo
// indexed directly by RW format
static RasterFormatInfo formatInfoRW[16] = {
{ 0, 0, 0},
{ 0, 0, 0, 0},
{ D3DFMT_A1R5G5B5, 16, 1, Raster::C1555 },
{ D3DFMT_R5G6B5, 16, 0, Raster::C565 },
{ D3DFMT_A4R4G4B4, 16, 1, Raster::C4444 },
@@ -789,7 +789,7 @@ rasterToImage(Raster *raster)
uint8 *pixels = raster->pixels;
// NB:
assert(image->bpp == natras->bpp);
assert(image->bpp == (int)natras->bpp);
assert(image->stride == raster->stride);
unswizzle(imgpixels, pixels, image->width, image->height, image->bpp);
// Fix RGB order