Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-03-05 13:29:10 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-03-05 13:29:10 +0300
commitc7fccc84bf59bed95bdf13207c40f7a1d1711d24 (patch)
tree1be0895f8cab3c07e00c218b601952458c83d5d0 /source/blender/imbuf/intern/scaling.c
parent10373238c104cc7a4c62d54c4fc39366ad11b1a2 (diff)
use NULL rather then 0 for pointer assignments & comparison, modifier, imbuf & editors.
Diffstat (limited to 'source/blender/imbuf/intern/scaling.c')
-rw-r--r--source/blender/imbuf/intern/scaling.c50
1 files changed, 25 insertions, 25 deletions
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);