[cogl/wip/standalone: 12/13] stb_image: Fix warnings that the original stb_image has
- From: Damien Lespiau <dlespiau src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/wip/standalone: 12/13] stb_image: Fix warnings that the original stb_image has
- Date: Mon, 27 Feb 2012 17:46:39 +0000 (UTC)
commit 780b06478c2f436560db1158e343e42f8d5baa5d
Author: Damien Lespiau <damien lespiau intel com>
Date: Mon Feb 27 17:34:49 2012 +0000
stb_image: Fix warnings that the original stb_image has
Clean compiler output is a must! that also means imported source code
from other projects. I can't be bothered to submit a patch upstream,
because last time it was totally ignored by the stb_image guy.
cogl/stb_image.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/cogl/stb_image.c b/cogl/stb_image.c
index 1aaef60..799823d 100644
--- a/cogl/stb_image.c
+++ b/cogl/stb_image.c
@@ -2358,10 +2358,11 @@ static int create_png_image_raw(png *a, guint8 *raw, guint32 raw_len, int out_n,
a->out = (guint8 *) malloc(x * y * out_n);
if (!a->out) return e("outofmem", "Out of memory");
if (!stbi_png_partial) {
- if (s->img_x == x && s->img_y == y)
+ if (s->img_x == x && s->img_y == y) {
if (raw_len != (img_n * x + 1) * y) return e("not enough pixels","Corrupt PNG");
- else // interlaced:
+ } else { // interlaced:
if (raw_len < (img_n * x + 1) * y) return e("not enough pixels","Corrupt PNG");
+ }
}
for (j=0; j < y; ++j) {
guint8 *cur = a->out + stride*j;
@@ -2845,7 +2846,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)
{
guint8 *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;
@@ -2895,7 +2896,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;
@@ -3602,7 +3602,7 @@ int stbi_hdr_test_file(FILE *f)
static char *hdr_gettoken(stbi *z, char *buffer)
{
int len=0;
- char *s = buffer, c = '\0';
+ char c = '\0';
c = get8(z);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]