diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-03-05 13:29:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-03-05 13:29:10 +0300 |
commit | c7fccc84bf59bed95bdf13207c40f7a1d1711d24 (patch) | |
tree | 1be0895f8cab3c07e00c218b601952458c83d5d0 /source/blender/imbuf | |
parent | 10373238c104cc7a4c62d54c4fc39366ad11b1a2 (diff) |
use NULL rather then 0 for pointer assignments & comparison, modifier, imbuf & editors.
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/filetype.c | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/scaling.c | 50 | ||||
-rw-r--r-- | source/blender/imbuf/intern/targa.c | 16 | ||||
-rw-r--r-- | source/blender/imbuf/intern/thumbs.c | 16 |
4 files changed, 42 insertions, 42 deletions
diff --git a/source/blender/imbuf/intern/filetype.c b/source/blender/imbuf/intern/filetype.c index 7e6005a6c2a..c5121189952 100644 --- a/source/blender/imbuf/intern/filetype.c +++ b/source/blender/imbuf/intern/filetype.c @@ -90,7 +90,7 @@ ImFileType IMB_FILE_TYPES[]= { #ifdef WITH_QUICKTIME {quicktime_init, quicktime_exit, imb_is_a_quicktime, imb_ftype_quicktime, imb_quicktime_decode, NULL, NULL, 0, QUICKTIME}, #endif - {NULL, NULL, NULL, NULL, NULL, NULL, 0}}; + {NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0}}; void imb_filetypes_init(void) { diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c index fbea72bfafc..64a9603610b 100644 --- a/source/blender/imbuf/intern/scaling.c +++ b/source/blender/imbuf/intern/scaling.c @@ -59,8 +59,8 @@ struct ImBuf *IMB_half_x(struct ImBuf *ibuf1) float af,rf,gf,bf, *p1f, *_p1f, *destf; int do_rect, do_float; - if (ibuf1==NULL) return (0); - if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (0); + if (ibuf1==NULL) return (NULL); + if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (NULL); do_rect= (ibuf1->rect != NULL); do_float= (ibuf1->rect_float != NULL); @@ -68,7 +68,7 @@ struct ImBuf *IMB_half_x(struct ImBuf *ibuf1) if (ibuf1->x <= 1) return(IMB_dupImBuf(ibuf1)); ibuf2 = IMB_allocImBuf((ibuf1->x)/2, ibuf1->y, ibuf1->depth, ibuf1->flags); - if (ibuf2==NULL) return (0); + if (ibuf2==NULL) return (NULL); _p1 = (uchar *) ibuf1->rect; dest=(uchar *) ibuf2->rect; @@ -122,14 +122,14 @@ struct ImBuf *IMB_double_fast_x(struct ImBuf *ibuf1) int *p1,*dest, i, col, do_rect, do_float; float *p1f, *destf; - if (ibuf1==NULL) return (0); - if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (0); + if (ibuf1==NULL) return (NULL); + if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (NULL); do_rect= (ibuf1->rect != NULL); do_float= (ibuf1->rect_float != NULL); ibuf2 = IMB_allocImBuf(2 * ibuf1->x , ibuf1->y , ibuf1->depth, ibuf1->flags); - if (ibuf2==NULL) return (0); + if (ibuf2==NULL) return (NULL); p1 = (int *) ibuf1->rect; dest=(int *) ibuf2->rect; @@ -159,8 +159,8 @@ struct ImBuf *IMB_double_x(struct ImBuf *ibuf1) { struct ImBuf *ibuf2; - if (ibuf1==NULL) return (0); - if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (0); + if (ibuf1==NULL) return (NULL); + if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (NULL); ibuf2 = IMB_double_fast_x(ibuf1); @@ -179,15 +179,15 @@ struct ImBuf *IMB_half_y(struct ImBuf *ibuf1) p1= p2= NULL; p1f= p2f= NULL; - if (ibuf1==NULL) return (0); - if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (0); + if (ibuf1==NULL) return (NULL); + if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (NULL); if (ibuf1->y <= 1) return(IMB_dupImBuf(ibuf1)); do_rect= (ibuf1->rect != NULL); do_float= (ibuf1->rect_float != NULL); ibuf2 = IMB_allocImBuf(ibuf1->x , (ibuf1->y) / 2 , ibuf1->depth, ibuf1->flags); - if (ibuf2==NULL) return (0); + if (ibuf2==NULL) return (NULL); _p1 = (uchar *) ibuf1->rect; dest=(uchar *) ibuf2->rect; @@ -248,14 +248,14 @@ struct ImBuf *IMB_double_fast_y(struct ImBuf *ibuf1) short x,y; int do_rect, do_float; - if (ibuf1==NULL) return (0); - if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (0); + if (ibuf1==NULL) return (NULL); + if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (NULL); do_rect= (ibuf1->rect != NULL); do_float= (ibuf1->rect_float != NULL); ibuf2 = IMB_allocImBuf(ibuf1->x , 2 * ibuf1->y , ibuf1->depth, ibuf1->flags); - if (ibuf2==NULL) return (0); + if (ibuf2==NULL) return (NULL); p1 = (int *) ibuf1->rect; dest1= (int *) ibuf2->rect; @@ -282,8 +282,8 @@ struct ImBuf *IMB_double_y(struct ImBuf *ibuf1) { struct ImBuf *ibuf2; - if (ibuf1==NULL) return (0); - if (ibuf1->rect==NULL) return (0); + if (ibuf1==NULL) return (NULL); + if (ibuf1->rect==NULL) return (NULL); ibuf2 = IMB_double_fast_y(ibuf1); @@ -345,14 +345,14 @@ struct ImBuf *IMB_onehalf(struct ImBuf *ibuf1) { struct ImBuf *ibuf2; - if (ibuf1==NULL) return (0); - if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (0); + if (ibuf1==NULL) return (NULL); + if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (NULL); if (ibuf1->x <= 1) return(IMB_half_y(ibuf1)); if (ibuf1->y <= 1) return(IMB_half_x(ibuf1)); ibuf2=IMB_allocImBuf((ibuf1->x)/2, (ibuf1->y)/2, ibuf1->depth, ibuf1->flags); - if (ibuf2==NULL) return (0); + if (ibuf2==NULL) return (NULL); imb_onehalf_no_alloc(ibuf2, ibuf1); @@ -838,7 +838,7 @@ static struct ImBuf *scaledownx(struct ImBuf *ibuf, int newx) nval[0]= nval[1]= nval[2]= nval[3]= 0.0f; nvalf[0]=nvalf[1]=nvalf[2]=nvalf[3]= 0.0f; - if (ibuf==NULL) return(0); + if (ibuf==NULL) return(NULL); if (ibuf->rect==NULL && ibuf->rect_float==NULL) return (ibuf); if (ibuf->rect) { @@ -962,7 +962,7 @@ static struct ImBuf *scaledowny(struct ImBuf *ibuf, int newy) nval[0]= nval[1]= nval[2]= nval[3]= 0.0f; nvalf[0]=nvalf[1]=nvalf[2]=nvalf[3]= 0.0f; - if (ibuf==NULL) return(0); + if (ibuf==NULL) return(NULL); if (ibuf->rect==NULL && ibuf->rect_float==NULL) return (ibuf); if (ibuf->rect) { @@ -1094,7 +1094,7 @@ static struct ImBuf *scaleupx(struct ImBuf *ibuf, int newx) val_g = nval_g = diff_g = val_r = nval_r = diff_r = 0; val_af = nval_af = diff_af = val_bf = nval_bf = diff_bf = 0; val_gf = nval_gf = diff_gf = val_rf = nval_rf = diff_rf = 0; - if (ibuf==NULL) return(0); + if (ibuf==NULL) return(NULL); if (ibuf->rect==NULL && ibuf->rect_float==NULL) return (ibuf); if (ibuf->rect) { @@ -1261,7 +1261,7 @@ static struct ImBuf *scaleupy(struct ImBuf *ibuf, int newy) val_g = nval_g = diff_g = val_r = nval_r = diff_r = 0; val_af = nval_af = diff_af = val_bf = nval_bf = diff_bf = 0; val_gf = nval_gf = diff_gf = val_rf = nval_rf = diff_rf = 0; - if (ibuf==NULL) return(0); + if (ibuf==NULL) return(NULL); if (ibuf->rect==NULL && ibuf->rect_float==NULL) return (ibuf); if (ibuf->rect) { @@ -1453,7 +1453,7 @@ static void scalefast_Z_ImBuf(ImBuf *ibuf, short newx, short newy) struct ImBuf *IMB_scaleImBuf(struct ImBuf * ibuf, unsigned int newx, unsigned int newy) { - if (ibuf==NULL) return (0); + if (ibuf==NULL) return (NULL); if (ibuf->rect==NULL && ibuf->rect_float==NULL) return (ibuf); if (newx == ibuf->x && newy == ibuf->y) { return ibuf; } @@ -1490,7 +1490,7 @@ struct ImBuf *IMB_scalefastImBuf(struct ImBuf *ibuf, unsigned int newx, unsigned rect = NULL; _newrect = NULL; newrect = NULL; rectf = NULL; _newrectf = NULL; newrectf = NULL; - if (ibuf==NULL) return(0); + if (ibuf==NULL) return(NULL); if (ibuf->rect) do_rect = 1; if (ibuf->rect_float) do_float = 1; if (do_rect==0 && do_float==0) return(ibuf); diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c index 4f1f756a861..f334409133f 100644 --- a/source/blender/imbuf/intern/targa.c +++ b/source/blender/imbuf/intern/targa.c @@ -196,8 +196,8 @@ static int dumptarga(struct ImBuf * ibuf, FILE * file) int size; uchar *rect; - if (ibuf == 0) return (0); - if (ibuf->rect == 0) return (0); + if (ibuf == NULL) return (0); + if (ibuf->rect == NULL) return (0); size = ibuf->x * ibuf->y; rect = (uchar *) ibuf->rect; @@ -366,8 +366,8 @@ static void decodetarga(struct ImBuf *ibuf, unsigned char *mem, size_t mem_size, unsigned int *rect; uchar * cp = (uchar *) &col; - if (ibuf == 0) return; - if (ibuf->rect == 0) return; + if (ibuf == NULL) return; + if (ibuf->rect == NULL) return; size = ibuf->x * ibuf->y; rect = ibuf->rect; @@ -477,8 +477,8 @@ static void ldtarga(struct ImBuf * ibuf,unsigned char * mem, size_t mem_size, in unsigned int *rect; uchar * cp = (uchar *) &col; - if (ibuf == 0) return; - if (ibuf->rect == 0) return; + if (ibuf == NULL) return; + if (ibuf->rect == NULL) return; size = ibuf->x * ibuf->y; rect = ibuf->rect; @@ -535,12 +535,12 @@ struct ImBuf *imb_loadtarga(unsigned char *mem, size_t mem_size, int flags) unsigned int *rect, *cmap= NULL, mincol= 0, maxcol= 0; uchar * cp = (uchar *) &col; - if (checktarga(&tga,mem) == 0) return(0); + if (checktarga(&tga,mem) == 0) return(NULL); if (flags & IB_test) ibuf = IMB_allocImBuf(tga.xsize,tga.ysize,tga.pixsize, 0); else ibuf = IMB_allocImBuf(tga.xsize,tga.ysize,(tga.pixsize + 0x7) & ~0x7, IB_rect); - if (ibuf == 0) return(0); + if (ibuf == NULL) return(NULL); ibuf->ftype = TGA; ibuf->profile = IB_PROFILE_SRGB; mem = mem + 18 + tga.numid; diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c index 626c3ec6d70..a9abcec9169 100644 --- a/source/blender/imbuf/intern/thumbs.c +++ b/source/blender/imbuf/intern/thumbs.c @@ -272,7 +272,7 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im tsize = 1; break; default: - return 0; /* unknown size */ + return NULL; /* unknown size */ } uri_from_filename(path, uri); @@ -286,7 +286,7 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im } if (size == THB_FAIL) { img = IMB_allocImBuf(1,1,32, IB_rect | IB_metadata); - if (!img) return 0; + if (!img) return NULL; } else { if (THB_SOURCE_IMAGE == source || THB_SOURCE_BLEND == source) { @@ -322,7 +322,7 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im stat(path, &info); BLI_snprintf(mtime, sizeof(mtime), "%ld", info.st_mtime); } - if (!img) return 0; + if (!img) return NULL; if (img->x > img->y) { scaledx = (float)tsize; @@ -365,7 +365,7 @@ ImBuf* IMB_thumb_read(const char* path, ThumbSize size) { char thumb[FILE_MAX]; char uri[FILE_MAX*3+8]; - ImBuf *img = 0; + ImBuf *img = NULL; if (!uri_from_filename(path,uri)) { return NULL; @@ -428,13 +428,13 @@ ImBuf* IMB_thumb_manage(const char* path, ThumbSize size, ThumbSource source) if (!IMB_metadata_get_field(img, "Thumb::MTime", mtime, 40)) { /* illegal thumb, forget it! */ IMB_freeImBuf(img); - img = 0; + img = NULL; } else { time_t t = atol(mtime); if (st.st_mtime != t) { /* recreate all thumbs */ IMB_freeImBuf(img); - img = 0; + img = NULL; IMB_thumb_delete(path, THB_NORMAL); IMB_thumb_delete(path, THB_LARGE); IMB_thumb_delete(path, THB_FAIL); @@ -445,7 +445,7 @@ ImBuf* IMB_thumb_manage(const char* path, ThumbSize size, ThumbSource source) if (img) { /* we don't need failed thumb anymore */ IMB_freeImBuf(img); - img = 0; + img = NULL; } } } @@ -458,7 +458,7 @@ ImBuf* IMB_thumb_manage(const char* path, ThumbSize size, ThumbSource source) if (img) { /* we don't need failed thumb anymore */ IMB_freeImBuf(img); - img = 0; + img = NULL; } } } |