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-03 20:59:04 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-03-03 20:59:04 +0300
commit3c184def72693e319253c31896b385c297183778 (patch)
tree665530e6a8a0a1e57ee7b02221b2530f10eb10c4 /source/blender/editors/curve
parent709c727c510a85426b87a9a2fb7fb8517fef7de9 (diff)
use NULL instead of 0 for pointers, (editors)
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r--source/blender/editors/curve/editcurve.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index e9fcbfdc0a4..d4b96762ab8 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -1069,7 +1069,7 @@ static void curve_rename_fcurves(Object *obedit, ListBase *orig_curves)
CVKeyIndex *keyIndex;
char rna_path[64], orig_rna_path[64];
AnimData *ad= BKE_animdata_from_id(&cu->id);
- ListBase curves= {0, 0};
+ ListBase curves= {NULL, NULL};
FCurve *fcu, *next;
while(nu) {
@@ -2466,7 +2466,7 @@ void selectend_nurb(Object *obedit, short selfirst, short doswap, short selstatu
int a;
short sel;
- if(obedit==0) return;
+ if(obedit==NULL) return;
cu= (Curve*)obedit->data;
cu->lastsel= NULL;
@@ -3315,7 +3315,7 @@ static short findnearestNurbvert(ViewContext *vc, short sel, int mval[2], Nurb *
/* sel==1: selected gets a disadvantage */
/* in nurb and bezt or bp the nearest is written */
/* return 0 1 2: handlepunt */
- struct { BPoint *bp; BezTriple *bezt; Nurb *nurb; int dist, hpoint, select, mval[2]; } data = {0};
+ struct { BPoint *bp; BezTriple *bezt; Nurb *nurb; int dist, hpoint, select, mval[2]; } data = {NULL};
data.dist = 100;
data.hpoint = 0;
@@ -3342,24 +3342,24 @@ static void findselectedNurbvert(ListBase *editnurb, Nurb **nu, BezTriple **bezt
BPoint *bp1;
int a;
- *nu= 0;
- *bezt= 0;
- *bp= 0;
+ *nu= NULL;
+ *bezt= NULL;
+ *bp= NULL;
for(nu1= editnurb->first; nu1; nu1= nu1->next) {
if(nu1->type == CU_BEZIER) {
bezt1= nu1->bezt;
a= nu1->pntsu;
while(a--) {
if( (bezt1->f1 & SELECT) || (bezt1->f2 & SELECT) || (bezt1->f3 & SELECT) ) {
- if(*nu!=0 && *nu!= nu1) {
- *nu= 0;
- *bp= 0;
- *bezt= 0;
+ if(*nu != NULL && *nu != nu1) {
+ *nu= NULL;
+ *bp= NULL;
+ *bezt= NULL;
return;
}
else if(*bezt || *bp) {
- *bp= 0;
- *bezt= 0;
+ *bp= NULL;
+ *bezt= NULL;
}
else {
*bezt= bezt1;
@@ -3374,15 +3374,15 @@ static void findselectedNurbvert(ListBase *editnurb, Nurb **nu, BezTriple **bezt
a= nu1->pntsu*nu1->pntsv;
while(a--) {
if( bp1->f1 & 1 ) {
- if(*nu!=0 && *nu!= nu1) {
- *bp= 0;
- *bezt= 0;
- *nu= 0;
+ if(*nu != NULL && *nu != nu1) {
+ *bp= NULL;
+ *bezt= NULL;
+ *nu= NULL;
return;
}
else if(*bezt || *bp) {
- *bp= 0;
- *bezt= 0;
+ *bp= NULL;
+ *bezt= NULL;
}
else {
*bp= bp1;
@@ -3421,7 +3421,7 @@ static int convertspline(short type, Nurb *nu)
bezt++;
}
MEM_freeN(nu->bp);
- nu->bp= 0;
+ nu->bp= NULL;
nu->pntsu= nr;
nu->type = CU_BEZIER;
calchandlesNurb(nu);
@@ -3521,7 +3521,7 @@ static int convertspline(short type, Nurb *nu)
bezt++;
}
MEM_freeN(nu->bp);
- nu->bp= 0;
+ nu->bp= NULL;
MEM_freeN(nu->knotsu);
nu->knotsu= NULL;
nu->pntsu= nr;
@@ -3726,12 +3726,12 @@ typedef struct NurbSort {
float vec[3];
} NurbSort;
-static ListBase nsortbase= {0, 0};
+static ListBase nsortbase= {NULL, NULL};
/* static NurbSort *nusmain; */ /* this var seems to go unused... at least in this file */
static void make_selection_list_nurb(ListBase *editnurb)
{
- ListBase nbase= {0, 0};
+ ListBase nbase= {NULL, NULL};
NurbSort *nus, *nustest, *headdo, *taildo;
Nurb *nu;
BPoint *bp;
@@ -3766,7 +3766,7 @@ static void make_selection_list_nurb(ListBase *editnurb)
while(nbase.first) {
headdist= taildist= 1.0e30;
- headdo= taildo= 0;
+ headdo= taildo= NULL;
nustest= nbase.first;
while(nustest) {
@@ -3977,7 +3977,7 @@ static int make_segment_exec(bContext *C, wmOperator *op)
Object *obedit= CTX_data_edit_object(C);
Curve *cu= obedit->data;
ListBase *nubase= curve_get_editcurve(obedit);
- Nurb *nu, *nu1=0, *nu2=0;
+ Nurb *nu, *nu1=NULL, *nu2=NULL;
BPoint *bp;
float *fp, offset;
int a, ok= 0;
@@ -4012,7 +4012,7 @@ static int make_segment_exec(bContext *C, wmOperator *op)
if((nu->flagu & CU_NURB_CYCLIC)==0) { /* not cyclic */
if(nu->type == CU_BEZIER) {
- if(nu1==0) {
+ if(nu1==NULL) {
if( BEZSELECTED_HIDDENHANDLES(cu, nu->bezt) ) nu1= nu;
else {
if( BEZSELECTED_HIDDENHANDLES(cu, &(nu->bezt[nu->pntsu-1])) ) {
@@ -4022,7 +4022,7 @@ static int make_segment_exec(bContext *C, wmOperator *op)
}
}
}
- else if(nu2==0) {
+ else if(nu2==NULL) {
if( BEZSELECTED_HIDDENHANDLES(cu, nu->bezt) ) {
nu2= nu;
switchdirectionNurb(nu);
@@ -4038,7 +4038,7 @@ static int make_segment_exec(bContext *C, wmOperator *op)
}
else if(nu->pntsv==1) {
bp= nu->bp;
- if(nu1==0) {
+ if(nu1==NULL) {
if( bp->f1 & SELECT) nu1= nu;
else {
bp= bp+(nu->pntsu-1);
@@ -4049,7 +4049,7 @@ static int make_segment_exec(bContext *C, wmOperator *op)
}
}
}
- else if(nu2==0) {
+ else if(nu2==NULL) {
if( bp->f1 & SELECT ) {
nu2= nu;
switchdirectionNurb(nu);
@@ -4175,8 +4175,8 @@ int mouse_nurb(bContext *C, short mval[2], int extend)
ListBase *editnurb= curve_get_editcurve(obedit);
ViewContext vc;
Nurb *nu;
- BezTriple *bezt=0;
- BPoint *bp=0;
+ BezTriple *bezt=NULL;
+ BPoint *bp=NULL;
int location[2];
short hand;
@@ -4475,7 +4475,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
mul_m3_v3(imat,newbp->vec);
newbp->vec[3]= 1.0;
- newnu->knotsu= newnu->knotsv= 0;
+ newnu->knotsu= newnu->knotsv= NULL;
nurbs_knot_calc_u(newnu);
ok= 1;
@@ -4541,7 +4541,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
bezt= newbezt;
ok= 1;
}
- else bezt= 0;
+ else bezt= NULL;
if(bezt) {
if(!newnu) nu->pntsu++;
@@ -4612,7 +4612,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
bp= newbp;
ok= 1;
}
- else bp= 0;
+ else bp= NULL;
if(bp) {
if(mode=='e') {
@@ -5031,13 +5031,13 @@ static int select_row_exec(bContext *C, wmOperator *UNUSED(op))
Object *obedit= CTX_data_edit_object(C);
Curve *cu= obedit->data;
ListBase *editnurb= curve_get_editcurve(obedit);
- static BPoint *last=0;
+ static BPoint *last= NULL;
static int direction=0;
Nurb *nu;
BPoint *bp;
int u = 0, v = 0, a, b, ok=0;
- if(editnurb->first==0)
+ if(editnurb->first == NULL)
return OPERATOR_CANCELLED;
if(cu->lastsel==NULL)
return OPERATOR_CANCELLED;
@@ -6065,7 +6065,7 @@ int join_curve_exec(bContext *C, wmOperator *UNUSED(op))
float imat[4][4], cmat[4][4];
int a;
- tempbase.first= tempbase.last= 0;
+ tempbase.first= tempbase.last= NULL;
/* trasnform all selected curves inverse in obact */
invert_m4_m4(imat, ob->obmat);