From c78e44cdc563853c250da78ee78ba622c39126b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Luc=20Peuri=C3=A8re?= Date: Wed, 9 Mar 2005 19:45:59 +0000 Subject: big warning hunt commit lot of casts, added prototypes, missing includes and some true errors --- source/blender/imbuf/intern/allocimbuf.c | 8 ++++---- source/blender/imbuf/intern/amiga.c | 2 +- source/blender/imbuf/intern/anim5.c | 5 +++-- source/blender/imbuf/intern/bmp.c | 4 ++-- source/blender/imbuf/intern/cspace.c | 2 ++ source/blender/imbuf/intern/divers.c | 8 +++++--- source/blender/imbuf/intern/hamx.c | 2 +- source/blender/imbuf/intern/iris.c | 4 ++-- source/blender/imbuf/intern/util.c | 2 +- 9 files changed, 21 insertions(+), 16 deletions(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c index 4e6407c8d6e..3178e15ffee 100644 --- a/source/blender/imbuf/intern/allocimbuf.c +++ b/source/blender/imbuf/intern/allocimbuf.c @@ -125,7 +125,7 @@ short addzbufImBuf(struct ImBuf * ibuf) IMB_freezbufImBuf(ibuf); size = ibuf->x * ibuf->y * sizeof(unsigned int); - if (ibuf->zbuf = MEM_mallocN(size, "addzbufImBuf")){ + if ( (ibuf->zbuf = MEM_mallocN(size, "addzbufImBuf")) ){ ibuf->mall |= IB_zbuf; return (TRUE); } @@ -145,7 +145,7 @@ short imb_addencodedbufferImBuf(struct ImBuf * ibuf) ibuf->encodedsize = 0; - if (ibuf->encodedbuffer = MEM_mallocN(ibuf->encodedbuffersize, "addencodedbufferImBuf")){ + if ( (ibuf->encodedbuffer = MEM_mallocN(ibuf->encodedbuffersize, "addencodedbufferImBuf") )){ ibuf->mall |= IB_mem; return (TRUE); } @@ -199,7 +199,7 @@ short imb_addrectImBuf(struct ImBuf * ibuf) imb_freerectImBuf(ibuf); size = ibuf->x * ibuf->y * sizeof(unsigned int); - if (ibuf->rect = MEM_mallocN(size, "imb_addrectImBuf")){ + if ( (ibuf->rect = MEM_mallocN(size, "imb_addrectImBuf")) ){ ibuf->mall |= IB_rect; if (ibuf->depth > 32) return (addzbufImBuf(ibuf)); else return (TRUE); @@ -219,7 +219,7 @@ short imb_addcmapImBuf(struct ImBuf *ibuf) imb_checkncols(ibuf); if (ibuf->maxcol == 0) return (TRUE); - if (ibuf->cmap = MEM_callocN(sizeof(unsigned int) * ibuf->maxcol, "imb_addcmapImBuf")){ + if ( (ibuf->cmap = MEM_callocN(sizeof(unsigned int) * ibuf->maxcol, "imb_addcmapImBuf") ) ){ min = ibuf->maxcol * sizeof(unsigned int); if (min > sizeof(dfltcmap)) min = sizeof(dfltcmap); memcpy(ibuf->cmap, dfltcmap, min); diff --git a/source/blender/imbuf/intern/amiga.c b/source/blender/imbuf/intern/amiga.c index a75df327e23..200fe004ff9 100644 --- a/source/blender/imbuf/intern/amiga.c +++ b/source/blender/imbuf/intern/amiga.c @@ -388,7 +388,7 @@ static uchar *readbody(struct ImBuf *ibuf, uchar *body) struct ImBuf *imb_loadamiga(int *iffmem,int flags) { - int chunk,totlen,len,*cmap=0,cmaplen,*mem,ftype=0; + int chunk,totlen,len,*cmap=0,cmaplen =0,*mem,ftype=0; uchar *body=0; struct BitMapHeader bmhd; struct ImBuf *ibuf=0; diff --git a/source/blender/imbuf/intern/anim5.c b/source/blender/imbuf/intern/anim5.c index aa2a5cf6469..9f87ba09f5f 100644 --- a/source/blender/imbuf/intern/anim5.c +++ b/source/blender/imbuf/intern/anim5.c @@ -47,6 +47,7 @@ #include "IMB_anim.h" +#include "IMB_anim5.h" typedef struct Anhd{ unsigned char type, mask; @@ -235,7 +236,7 @@ static void anim5decode(struct ImBuf * ibuf, uchar * dlta) { do{ uchar noop; - if (noop = *(point++)){ + if ( (noop = *(point++)) ){ uchar *plane; uchar code; @@ -308,7 +309,7 @@ static void anim5xordecode(struct ImBuf * ibuf, uchar * dlta) { do{ uchar noop; - if (noop = *(point++)){ + if ( (noop = *(point++)) ){ uchar *plane; uchar code; diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c index 31f2b66cd83..55e02d521d5 100644 --- a/source/blender/imbuf/intern/bmp.c +++ b/source/blender/imbuf/intern/bmp.c @@ -182,14 +182,14 @@ struct ImBuf *imb_bmp_decode(unsigned char *mem, int size, int flags) } /* Couple of helper functions for writing our data */ -int putIntLSB(unsigned int ui,FILE *ofile) { +static int putIntLSB(unsigned int ui,FILE *ofile) { putc((ui>>0)&0xFF,ofile); putc((ui>>8)&0xFF,ofile); putc((ui>>16)&0xFF,ofile); return putc((ui>>24)&0xFF,ofile); } -int putShortLSB(unsigned short us,FILE *ofile) { +static int putShortLSB(unsigned short us,FILE *ofile) { putc((us>>0)&0xFF,ofile); return putc((us>>8)&0xFF,ofile); } diff --git a/source/blender/imbuf/intern/cspace.c b/source/blender/imbuf/intern/cspace.c index f994755c823..ef2f78644d5 100644 --- a/source/blender/imbuf/intern/cspace.c +++ b/source/blender/imbuf/intern/cspace.c @@ -37,6 +37,8 @@ #include "imbuf_patch.h" #include "IMB_imbuf_types.h" +void IMB_cspace(struct ImBuf *ibuf, float mat[][4]); + /************************************************************************/ /* COLORSPACE */ /************************************************************************/ diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c index 3603128ce44..6b46af30f8b 100644 --- a/source/blender/imbuf/intern/divers.c +++ b/source/blender/imbuf/intern/divers.c @@ -157,8 +157,10 @@ void IMB_gamwarp(struct ImBuf *ibuf, double gamma) rect = (uchar *) ibuf->rect; for (i = ibuf->x * ibuf->y ; i>0 ; i--){ rect ++; - *rect ++ = gam[*rect]; - *rect ++ = gam[*rect]; - *rect ++ = gam[*rect]; + /* put a warning in gcc : operation may be undefined : */ + /* it is true it's rather convoluted even by C standards ;) */ + *rect ++ = gam[*rect]; /*FIXME*/ + *rect ++ = gam[*rect]; /*FIXME*/ + *rect ++ = gam[*rect]; /*FIXME*/ } } diff --git a/source/blender/imbuf/intern/hamx.c b/source/blender/imbuf/intern/hamx.c index 4d75b0d86d6..c72e313c865 100644 --- a/source/blender/imbuf/intern/hamx.c +++ b/source/blender/imbuf/intern/hamx.c @@ -332,7 +332,7 @@ static short dec_hamx(struct ImBuf * ibuf, unsigned char *body, int cmap[]) struct ImBuf *imb_loadanim(int *iffmem, int flags) { int chunk, totlen, len, *mem, cmaplen = 0; - unsigned int *cmap; + unsigned int *cmap = NULL; uchar *body = 0; struct Adat adat; struct ImBuf *ibuf=0; diff --git a/source/blender/imbuf/intern/iris.c b/source/blender/imbuf/intern/iris.c index 37f695e34a9..78263daa2f5 100644 --- a/source/blender/imbuf/intern/iris.c +++ b/source/blender/imbuf/intern/iris.c @@ -235,11 +235,11 @@ static void test_endian_zbuf(struct ImBuf *ibuf) struct ImBuf *imb_loadiris(unsigned char *mem, int flags) { - unsigned int *base, *lptr; + unsigned int *base, *lptr = NULL; unsigned int *zbase, *zptr; unsigned char *rledat; int *starttab, *lengthtab; - FILE *inf; + FILE *inf = NULL; IMAGE image; int x, y, z, tablen; int xsize, ysize, zsize; diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index 729e95612f0..ddd81d55b68 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -67,7 +67,7 @@ /* this one is only def-ed once, strangely... */ #define GSS(x) (((uchar *)(x))[1] << 8 | ((uchar *)(x))[0]) -int IMB_ispic_name(char *name) +static int IMB_ispic_name(char *name) { struct stat st; int fp, buf[10]; -- cgit v1.2.3