Warning free SOIL lib.

This commit is contained in:
Matthew Parlane 2012-12-23 19:24:57 +13:00
parent 1c01fd9c9d
commit a76059377d

View file

@ -2394,6 +2394,7 @@ static int parse_png_file(png *z, int scan, int req_comp)
// if critical, fail
if ((c.type & (1 << 29)) == 0) {
#ifndef STBI_NO_FAILURE_STRINGS
#ifndef STBI_FAILURE_USERMSG
// not threadsafe
static char invalid_chunk[] = "XXXX chunk not known";
invalid_chunk[0] = (uint8) (c.type >> 24);
@ -2401,6 +2402,7 @@ static int parse_png_file(png *z, int scan, int req_comp)
invalid_chunk[2] = (uint8) (c.type >> 8);
invalid_chunk[3] = (uint8) (c.type >> 0);
#endif
#endif
return e(invalid_chunk, "PNG not supported: unknown chunk type");
}
skip(s, c.length);
@ -2584,7 +2586,7 @@ static int shiftsigned(int v, int shift, int bits)
static stbi_uc *bmp_load(stbi *s, int *x, int *y, int *comp, int req_comp)
{
uint8 *out;
unsigned int mr=0,mg=0,mb=0,ma=0, fake_a=0;
unsigned int mr=0,mg=0,mb=0,ma=0;
stbi_uc pal[256][4];
int psize=0,i,j,compress=0,width;
int bpp, flip_vertically, pad, target, offset, hsz;
@ -2634,7 +2636,6 @@ static stbi_uc *bmp_load(stbi *s, int *x, int *y, int *comp, int req_comp)
mg = 0xff << 8;
mb = 0xff << 0;
ma = 0xff << 24;
fake_a = 1; // @TODO: check for cases like alpha value is all 0 and switch it to 255
} else {
mr = 31 << 10;
mg = 31 << 5;