Skip to content
Permalink
Browse files

SDL_bmp.c: remove unused variable warnings

  • Loading branch information
1bsyl committed Sep 5, 2019
1 parent e5580e1 commit 1b5e3c19a293872fb04b4fa227d8dcdc8f2e827c
Showing with 21 additions and 21 deletions.
  1. +21 −21 src/video/SDL_bmp.c
@@ -192,23 +192,23 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc)

/* The Win32 BMP file header (14 bytes) */
char magic[2];
Uint32 bfSize;
Uint16 bfReserved1;
Uint16 bfReserved2;
/* Uint32 bfSize; */
/* Uint16 bfReserved1; */
/* Uint16 bfReserved2; */
Uint32 bfOffBits;

/* The Win32 BITMAPINFOHEADER struct (40 bytes) */
Uint32 biSize;
Sint32 biWidth = 0;
Sint32 biHeight = 0;
Uint16 biPlanes;
/* Uint16 biPlanes; */
Uint16 biBitCount = 0;
Uint32 biCompression = 0;
Uint32 biSizeImage;
Sint32 biXPelsPerMeter;
Sint32 biYPelsPerMeter;
/* Uint32 biSizeImage; */
/* Sint32 biXPelsPerMeter; */
/* Sint32 biYPelsPerMeter; */
Uint32 biClrUsed = 0;
Uint32 biClrImportant;
/* Uint32 biClrImportant; */

/* Make sure we are passed a valid data source */
surface = NULL;
@@ -231,36 +231,36 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc)
was_error = SDL_TRUE;
goto done;
}
bfSize = SDL_ReadLE32(src);
bfReserved1 = SDL_ReadLE16(src);
bfReserved2 = SDL_ReadLE16(src);
/* bfSize = */ SDL_ReadLE32(src);
/* bfReserved1 = */ SDL_ReadLE16(src);
/* bfReserved2 = */ SDL_ReadLE16(src);
bfOffBits = SDL_ReadLE32(src);

/* Read the Win32 BITMAPINFOHEADER */
biSize = SDL_ReadLE32(src);
if (biSize == 12) { /* really old BITMAPCOREHEADER */
biWidth = (Uint32) SDL_ReadLE16(src);
biHeight = (Uint32) SDL_ReadLE16(src);
biPlanes = SDL_ReadLE16(src);
/* biPlanes = */ SDL_ReadLE16(src);
biBitCount = SDL_ReadLE16(src);
biCompression = BI_RGB;
biSizeImage = 0;
biXPelsPerMeter = 0;
biYPelsPerMeter = 0;
/* biSizeImage = 0; */
/* biXPelsPerMeter = 0; */
/* biYPelsPerMeter = 0; */
biClrUsed = 0;
biClrImportant = 0;
/* biClrImportant = 0; */
} else if (biSize >= 40) { /* some version of BITMAPINFOHEADER */
Uint32 headerSize;
biWidth = SDL_ReadLE32(src);
biHeight = SDL_ReadLE32(src);
biPlanes = SDL_ReadLE16(src);
/* biPlanes = */ SDL_ReadLE16(src);
biBitCount = SDL_ReadLE16(src);
biCompression = SDL_ReadLE32(src);
biSizeImage = SDL_ReadLE32(src);
biXPelsPerMeter = SDL_ReadLE32(src);
biYPelsPerMeter = SDL_ReadLE32(src);
/* biSizeImage = */ SDL_ReadLE32(src);
/* biXPelsPerMeter = */ SDL_ReadLE32(src);
/* biYPelsPerMeter = */ SDL_ReadLE32(src);
biClrUsed = SDL_ReadLE32(src);
biClrImportant = SDL_ReadLE32(src);
/* biClrImportant = */ SDL_ReadLE32(src);

/* 64 == BITMAPCOREHEADER2, an incompatible OS/2 2.x extension. Skip this stuff for now. */
if (biSize != 64) {

0 comments on commit 1b5e3c1

Please sign in to comment.