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
path: root/source
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
parent709c727c510a85426b87a9a2fb7fb8517fef7de9 (diff)
use NULL instead of 0 for pointers, (editors)
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/armature/poselib.c4
-rw-r--r--source/blender/editors/curve/editcurve.c72
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c2
-rw-r--r--source/blender/editors/interface/interface.c2
-rw-r--r--source/blender/editors/interface/interface_handlers.c2
-rw-r--r--source/blender/editors/mesh/editface.c8
-rw-r--r--source/blender/editors/space_time/space_time.c2
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c4
-rw-r--r--source/blender/editors/space_view3d/drawobject.c48
-rw-r--r--source/blender/editors/space_view3d/view3d_buttons.c10
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c6
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c2
-rw-r--r--source/blender/editors/transform/transform.c14
-rw-r--r--source/blender/editors/transform/transform_conversions.c6
-rw-r--r--source/blender/editors/transform/transform_generics.c2
-rw-r--r--source/blender/editors/uvedit/uvedit_draw.c4
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c2
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c2
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c4
20 files changed, 99 insertions, 99 deletions
diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c
index eb608e855a8..21e11d7a830 100644
--- a/source/blender/editors/armature/poselib.c
+++ b/source/blender/editors/armature/poselib.c
@@ -820,7 +820,7 @@ static void poselib_apply_pose (tPoseLib_PreviewData *pld)
bAction *act= pld->act;
bActionGroup *agrp;
- KeyframeEditData ked= {{0}};
+ KeyframeEditData ked= {{NULL}};
KeyframeEditFunc group_ok_cb;
int frame= 1;
@@ -1455,7 +1455,7 @@ static void poselib_preview_cleanup (bContext *C, wmOperator *op)
/* change active pose setting */
act->active_marker= BLI_findindex(&act->markers, marker) + 1;
- action_set_activemarker(act, marker, 0);
+ action_set_activemarker(act, marker, NULL);
/* Update event for pose and deformation children */
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
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);
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 79746f401cf..ffaedf6a5bc 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -500,7 +500,7 @@ static void gp_draw_strokes (bGPDframe *gpf, int offsx, int offsy, int winx, int
continue;
if (!(dflag & GP_DRAWDATA_ONLYI2D) && (gps->flag & GP_STROKE_2DIMAGE))
continue;
- if ((gps->points == 0) || (gps->totpoints < 1))
+ if ((gps->points == NULL) || (gps->totpoints < 1))
continue;
/* check which stroke-drawer to use */
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index c7182eded18..373958b3b2e 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -2194,7 +2194,7 @@ static void ui_block_do_align_but(uiBut *first, int nr)
if(bt->next && bt->next->alignnr == nr && buts_are_horiz(bt, bt->next)==0 ) break;
bt= bt->next;
}
- if(bt==0 || bt->alignnr != nr) flag= UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_RIGHT;
+ if(bt==NULL || bt->alignnr != nr) flag= UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_RIGHT;
}
}
else flag |= UI_BUT_ALIGN_LEFT;
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 06af4e2552c..c01eb351fba 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -4459,7 +4459,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
return WM_UI_HANDLER_BREAK;
}
}
- else if(but->pointype && but->poin==0) {
+ else if(but->pointype && but->poin==NULL) {
/* there's a pointer needed */
BKE_reportf(NULL, RPT_WARNING, "DoButton pointer error: %s", but->str);
button_activate_state(C, but, BUTTON_STATE_EXIT);
diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c
index 302e5f79e8d..cec7d7a3d54 100644
--- a/source/blender/editors/mesh/editface.c
+++ b/source/blender/editors/mesh/editface.c
@@ -164,7 +164,7 @@ void paintface_hide(Object *ob, const int unselected)
int a;
me= get_mesh(ob);
- if(me==0 || me->totface==0) return;
+ if(me==NULL || me->totface==0) return;
mface= me->mface;
a= me->totface;
@@ -193,7 +193,7 @@ void paintface_reveal(Object *ob)
int a;
me= get_mesh(ob);
- if(me==0 || me->totface==0) return;
+ if(me==NULL || me->totface==0) return;
mface= me->mface;
a= me->totface;
@@ -333,7 +333,7 @@ void paintface_select_linked(bContext *UNUSED(C), Object *ob, short UNUSED(mval[
unsigned int index=0;
me = get_mesh(ob);
- if(me==0 || me->totface==0) return;
+ if(me==NULL || me->totface==0) return;
if (mode==0 || mode==1) {
// XXX - Causes glitches, not sure why
@@ -356,7 +356,7 @@ void paintface_deselect_all_visible(Object *ob, int action, short flush_flags)
int a;
me= get_mesh(ob);
- if(me==0) return;
+ if(me==NULL) return;
if(action == SEL_INVERT) {
mface= me->mface;
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
index 34a88d3556e..b3c51953d59 100644
--- a/source/blender/editors/space_time/space_time.c
+++ b/source/blender/editors/space_time/space_time.c
@@ -269,7 +269,7 @@ static ActKeyColumn *time_cfra_find_ak (ActKeyColumn *ak, float cframe)
/* helper for time_draw_keyframes() */
static void time_draw_idblock_keyframes(View2D *v2d, ID *id, short onlysel)
{
- bDopeSheet ads= {0};
+ bDopeSheet ads= {NULL};
DLRBT_Tree keys;
ActKeyColumn *ak;
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index a72f7e224b5..6c5f093d6f1 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -86,7 +86,7 @@ static void get_marked_edge_info__orFlags(EdgeHash *eh, int v0, int v1, int flag
int *flags_p;
if (!BLI_edgehash_haskey(eh, v0, v1)) {
- BLI_edgehash_insert(eh, v0, v1, 0);
+ BLI_edgehash_insert(eh, v0, v1, NULL);
}
flags_p = (int*) BLI_edgehash_lookup_p(eh, v0, v1);
@@ -381,7 +381,7 @@ static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, O
Gtexdraw.istex = istex;
Gtexdraw.color_profile = scene->r.color_mgt_flag & R_COLOR_MANAGEMENT;
memcpy(Gtexdraw.obcol, obcol, sizeof(obcol));
- set_draw_settings_cached(1, 0, 0, Gtexdraw.islit, 0, 0, 0);
+ set_draw_settings_cached(1, 0, NULL, Gtexdraw.islit, NULL, 0, 0);
glShadeModel(GL_SMOOTH);
}
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index bd7b4c711d9..82d7cac1a42 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -2327,7 +2327,7 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object
glEnable(GL_LIGHTING);
glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
- finalDM->drawMappedFaces(finalDM, draw_em_fancy__setFaceOpts, 0, 0, GPU_enable_material);
+ finalDM->drawMappedFaces(finalDM, draw_em_fancy__setFaceOpts, NULL, 0, GPU_enable_material);
glFrontFace(GL_CCW);
glDisable(GL_LIGHTING);
@@ -3136,7 +3136,7 @@ static int drawCurveDerivedMesh(Scene *scene, View3D *v3d, RegionView3D *rv3d, B
static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, int dt)
{
Object *ob= base->object;
- ListBase *lb=0;
+ ListBase *lb=NULL;
DispList *dl;
Curve *cu;
int solid, retval= 0;
@@ -3158,7 +3158,7 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas
dl= lb->first;
if(dl==NULL) return 1;
- if(dl->nors==0) addnormalsDispList(lb);
+ if(dl->nors==NULL) addnormalsDispList(lb);
index3_nors_incr= 0;
if( displist_has_faces(lb)==0) {
@@ -3173,7 +3173,7 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas
GPU_end_object_materials();
}
else if(dt == OB_SHADED) {
- if(ob->disp.first==0) shadeDispList(scene, base);
+ if(ob->disp.first==NULL) shadeDispList(scene, base);
drawDispListshaded(lb, ob);
}
else {
@@ -3243,7 +3243,7 @@ static int drawDispList(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *bas
}
else if(dt == OB_SHADED) {
dl= lb->first;
- if(dl && dl->col1==0) shadeDispList(scene, base);
+ if(dl && dl->col1==NULL) shadeDispList(scene, base);
drawDispListshaded(lb, ob);
}
else {
@@ -3456,9 +3456,9 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
ParticleEditSettings *pset = PE_settings(scene);
ParticleSettings *part;
ParticleData *pars, *pa;
- ParticleKey state, *states=0;
+ ParticleKey state, *states=NULL;
ParticleBillboardData bb;
- ParticleSimulationData sim= {0};
+ ParticleSimulationData sim= {NULL};
ParticleDrawData *pdd = psys->pdd;
Material *ma;
float vel[3], imat[4][4];
@@ -3473,16 +3473,16 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
unsigned char tcol[4]= {0, 0, 0, 255};
/* 1. */
- if(psys==0)
+ if(psys==NULL)
return;
part=psys->part;
pars=psys->particles;
- if(part==0 || !psys_check_enabled(ob, psys))
+ if(part==NULL || !psys_check_enabled(ob, psys))
return;
- if(pars==0) return;
+ if(pars==NULL) return;
/* don't draw normal paths in edit mode */
if(psys_in_edit_mode(scene, psys) && (pset->flag & PE_DRAW_PART)==0)
@@ -3550,7 +3550,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
totpart=psys->totpart;
- cfra=bsystem_time(scene, 0, (float)CFRA, 0.0f);
+ cfra= bsystem_time(scene, NULL, (float)CFRA, 0.0f);
if(draw_as==PART_DRAW_PATH && psys->pathcache==NULL && psys->childcache==NULL)
draw_as=PART_DRAW_DOT;
@@ -3583,19 +3583,19 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
create_cdata = 1;
break;
case PART_DRAW_OB:
- if(part->dup_ob==0)
+ if(part->dup_ob==NULL)
draw_as=PART_DRAW_DOT;
else
draw_as=0;
break;
case PART_DRAW_GR:
- if(part->dup_group==0)
+ if(part->dup_group==NULL)
draw_as=PART_DRAW_DOT;
else
draw_as=0;
break;
case PART_DRAW_BB:
- if(v3d->camera==0 && part->bb_ob==0){
+ if(v3d->camera==NULL && part->bb_ob==NULL){
printf("Billboards need an active camera or a target object!\n");
draw_as=part->draw_as=PART_DRAW_DOT;
@@ -3784,7 +3784,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
}
#endif // XXX old animation system
- pa_size=psys_get_child_size(psys,cpa,cfra,0);
+ pa_size=psys_get_child_size(psys,cpa,cfra,NULL);
pa_health = -1.0;
@@ -3903,7 +3903,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
if(draw_as==PART_DRAW_PATH){
ParticleCacheKey **cache, *path;
- float *cd2=0,*cdata2=0;
+ float *cd2=NULL,*cdata2=NULL;
/* setup gl flags */
if (1) { //ob_dt > OB_WIRE) {
@@ -3971,7 +3971,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
if(cdata2)
MEM_freeN(cdata2);
- cd2=cdata2=0;
+ cd2=cdata2=NULL;
glLineWidth(1.0f);
@@ -4091,7 +4091,7 @@ static void draw_update_ptcache_edit(Scene *scene, Object *ob, PTCacheEdit *edit
PE_update_object(scene, ob, 0);
/* create path and child path cache if it doesn't exist already */
- if(edit->pathcache==0)
+ if(edit->pathcache == NULL)
psys_cache_edit_paths(scene, ob, edit, CFRA);
}
@@ -4107,7 +4107,7 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit)
float nosel_col[3];
float *pathcol = NULL, *pcol;
- if(edit->pathcache==0)
+ if(edit->pathcache == NULL)
return;
PE_hide_keys_time(scene, edit, CFRA);
@@ -4166,8 +4166,8 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit)
glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE));
if(pset->selectmode==SCE_SELECT_POINT){
- float *pd=0,*pdata=0;
- float *cd=0,*cdata=0;
+ float *pd=NULL,*pdata=NULL;
+ float *cd=NULL,*cdata=NULL;
int totkeys = 0;
for (i=0, point=edit->points; i<totpoint; i++, point++)
@@ -4219,8 +4219,8 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit)
pd += pd ? 3 * point->totkey : 0;
cd += (timed?4:3) * point->totkey;
}
- if(pdata) { MEM_freeN(pdata); pd=pdata=0; }
- if(cdata) { MEM_freeN(cdata); cd=cdata=0; }
+ if(pdata) { MEM_freeN(pdata); pd=pdata=NULL; }
+ if(cdata) { MEM_freeN(cdata); cd=cdata=NULL; }
}
else if(pset->selectmode == SCE_SELECT_END){
for(i=0, point=edit->points; i<totpoint; i++, point++){
@@ -6018,7 +6018,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
if(ob->soft /*&& flag & OB_SBMOTION*/){
float mrt[3][3],msc[3][3],mtr[3][3];
- SoftBody *sb = 0;
+ SoftBody *sb= NULL;
float tipw = 0.5f, tiph = 0.5f,drawsize = 4.0f;
if ((sb= ob->soft)){
if(sb->solverflags & SBSO_ESTIMATEIPO){
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index cdbde49eb77..1f123c11a8b 100644
--- a/source/blender/editors/space_view3d/view3d_buttons.c
+++ b/source/blender/editors/space_view3d/view3d_buttons.c
@@ -292,7 +292,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
uiBlockBeginAlign(block);
if(tot==1) {
- uiDefBut(block, LABEL, 0, "Vertex:", 0, 130, 200, 20, 0, 0, 0, 0, 0, "");
+ uiDefBut(block, LABEL, 0, "Vertex:", 0, 130, 200, 20, NULL, 0, 0, 0, 0, "");
uiBlockBeginAlign(block);
but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, 110, 200, 20, &(tfp->ve_median[0]), -lim, lim, 10, 3, "");
@@ -325,7 +325,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
}
else {
- uiDefBut(block, LABEL, 0, "Median:", 0, 130, 200, 20, 0, 0, 0, 0, 0, "");
+ uiDefBut(block, LABEL, 0, "Median:", 0, 130, 200, 20, NULL, 0, 0, 0, 0, "");
uiBlockBeginAlign(block);
but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, 110, 200, 20, &(tfp->ve_median[0]), -lim, lim, 10, 3, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
@@ -755,7 +755,7 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
dg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr);
if(dg) {
uiDefButF(block, NUM, B_VGRP_PNL_EDIT_SINGLE + dvert->dw[i].def_nr, dg->name, 0, yco, 180, 20, &dvert->dw[i].weight, 0.0, 1.0, 1, 3, "");
- uiDefBut(block, BUT, B_VGRP_PNL_COPY_SINGLE + dvert->dw[i].def_nr, "C", 180,yco,20,20, 0, 0, 0, 0, 0, "Copy this groups weight to other selected verts");
+ uiDefBut(block, BUT, B_VGRP_PNL_COPY_SINGLE + dvert->dw[i].def_nr, "C", 180,yco,20,20, NULL, 0, 0, 0, 0, "Copy this groups weight to other selected verts");
yco -= 20;
}
}
@@ -763,8 +763,8 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
uiBlockEndAlign(block);
uiBlockBeginAlign(block);
- uiDefBut(block, BUT, B_VGRP_PNL_NORMALIZE, "Normalize", 0, yco,100,20, 0, 0, 0, 0, 0, "Normalize active vertex weights");
- uiDefBut(block, BUT, B_VGRP_PNL_COPY, "Copy", 100,yco,100,20, 0, 0, 0, 0, 0, "Copy active vertex to other seleted verts");
+ uiDefBut(block, BUT, B_VGRP_PNL_NORMALIZE, "Normalize", 0, yco,100,20, NULL, 0, 0, 0, 0, "Normalize active vertex weights");
+ uiDefBut(block, BUT, B_VGRP_PNL_COPY, "Copy", 100,yco,100,20, NULL, 0, 0, 0, 0, "Copy active vertex to other seleted verts");
uiBlockEndAlign(block);
}
}
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 9cecc4ce5af..3ca6d39305c 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1908,7 +1908,7 @@ static void gpu_update_lamps_shadows(Scene *scene, View3D *v3d)
/* this needs to be done better .. */
float viewmat[4][4], winmat[4][4];
int drawtype, lay, winsize, flag2=v3d->flag2;
- ARegion ar= {0};
+ ARegion ar= {NULL};
RegionView3D rv3d= {{{0}}};
drawtype= v3d->drawtype;
@@ -2206,8 +2206,8 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, in
/* creates own 3d views, used by the sequencer */
ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height, unsigned int flag, int drawtype)
{
- View3D v3d= {0};
- ARegion ar= {0};
+ View3D v3d= {NULL};
+ ARegion ar= {NULL};
RegionView3D rv3d= {{{0}}};
/* connect data */
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index ad62799db29..38888670dc2 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -2778,7 +2778,7 @@ static int depth_segment_cb(int x, int y, void *userData)
int view_autodist_depth_segment(struct ARegion *ar, short mval_sta[2], short mval_end[2], int margin, float *depth)
{
- struct { struct ARegion *ar; int margin; float depth; } data = {0};
+ struct { struct ARegion *ar; int margin; float depth; } data = {NULL};
int p1[2];
int p2[2];
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 5c62119409d..72061bdbdac 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -1263,7 +1263,7 @@ static int mouse_select(bContext *C, short *mval, short extend, short obcenter,
}
base= base->next;
- if(base==0) base= FIRSTBASE;
+ if(base==NULL) base= FIRSTBASE;
if(base==startbase) break;
}
}
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index ede8af2afe8..5708b4fa8b7 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1989,7 +1989,7 @@ static void constraintTransLim(TransInfo *UNUSED(t), TransData *td)
{
if (td->con) {
bConstraintTypeInfo *cti= get_constraint_typeinfo(CONSTRAINT_TYPE_LOCLIMIT);
- bConstraintOb cob= {0};
+ bConstraintOb cob= {NULL};
bConstraint *con;
/* Make a temporary bConstraintOb for using these limit constraints
@@ -2145,7 +2145,7 @@ static void constraintSizeLim(TransInfo *t, TransData *td)
{
if (td->con && td->ext) {
bConstraintTypeInfo *cti= get_constraint_typeinfo(CONSTRAINT_TYPE_SIZELIMIT);
- bConstraintOb cob= {0};
+ bConstraintOb cob= {NULL};
bConstraint *con;
/* Make a temporary bConstraintOb for using these limit constraints
@@ -2279,10 +2279,10 @@ int handleEventWarp(TransInfo *t, wmEvent *event)
if (event->type == MIDDLEMOUSE && event->val==KM_PRESS)
{
// Use customData pointer to signal warp direction
- if (t->customData == 0)
+ if (t->customData == NULL)
t->customData = (void*)1;
else
- t->customData = 0;
+ t->customData = NULL;
status = 1;
}
@@ -2420,7 +2420,7 @@ int handleEventShear(TransInfo *t, wmEvent *event)
if (event->type == MIDDLEMOUSE && event->val==KM_PRESS)
{
// Use customData pointer to signal Shear direction
- if (t->customData == 0)
+ if (t->customData == NULL)
{
initMouseInputMode(t, &t->mouse, INPUT_VERTICAL_ABSOLUTE);
t->customData = (void*)1;
@@ -2428,7 +2428,7 @@ int handleEventShear(TransInfo *t, wmEvent *event)
else
{
initMouseInputMode(t, &t->mouse, INPUT_HORIZONTAL_ABSOLUTE);
- t->customData = 0;
+ t->customData = NULL;
}
status = 1;
@@ -2472,7 +2472,7 @@ int Shear(TransInfo *t, short UNUSED(mval[2]))
unit_m3(smat);
// Custom data signals shear direction
- if (t->customData == 0)
+ if (t->customData == NULL)
smat[1][0] = value;
else
smat[0][1] = value;
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 11f82f4160d..9a70ec2f3be 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -1742,10 +1742,10 @@ static void createTransParticleVerts(bContext *C, TransInfo *t)
td->ival = *(key->time);
/* abuse size and quat for min/max values */
td->flag |= TD_NO_EXT;
- if(k==0) tx->size = 0;
+ if(k==0) tx->size = NULL;
else tx->size = (key - 1)->time;
- if(k == point->totkey - 1) tx->quat = 0;
+ if(k == point->totkey - 1) tx->quat = NULL;
else tx->quat = (key + 1)->time;
}
@@ -5088,7 +5088,7 @@ static void createTransObject(bContext *C, TransInfo *t)
}
/* select linked objects, but skip them later */
- if (ob->id.lib != 0) {
+ if (ob->id.lib != NULL) {
td->flag |= TD_SKIP;
}
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 01d30d67fdf..1fb57f2820d 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -338,7 +338,7 @@ void recalcData(TransInfo *t)
Scene *scene= t->scene;
SpaceAction *saction= (SpaceAction *)t->sa->spacedata.first;
- bAnimContext ac= {0};
+ bAnimContext ac= {NULL};
ListBase anim_data = {NULL, NULL};
bAnimListElem *ale;
int filter;
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c
index 45d1ceec30f..38df9a48fd0 100644
--- a/source/blender/editors/uvedit/uvedit_draw.c
+++ b/source/blender/editors/uvedit/uvedit_draw.c
@@ -179,7 +179,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, EditMesh *em, MTFac
totarea += EM_face_area(efa);
//totuvarea += tf_area(tf, efa->v4!=0);
- totuvarea += uv_area(tf_uv, efa->v4!=0);
+ totuvarea += uv_area(tf_uv, efa->v4 != NULL);
if(uvedit_face_visible(scene, ima, efa, tf)) {
efa->tmp.p = tf;
@@ -212,7 +212,7 @@ static void draw_uvs_stretch(SpaceImage *sima, Scene *scene, EditMesh *em, MTFac
area = EM_face_area(efa) / totarea;
uv_copy_aspect(tf->uv, tf_uv, aspx, aspy);
//uvarea = tf_area(tf, efa->v4!=0) / totuvarea;
- uvarea = uv_area(tf_uv, efa->v4!=0) / totuvarea;
+ uvarea = uv_area(tf_uv, efa->v4 != NULL) / totuvarea;
if(area < FLT_EPSILON || uvarea < FLT_EPSILON)
areadiff = 1.0;
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 9a48b6c9653..62ebee4ccfa 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -2935,7 +2935,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
for(efa= em->faces.first; efa; efa= efa->next) {
if(!(efa->h) && !(efa->f & SELECT)) {
/* All verts must be unselected for the face to be selected in the UV view */
- if((efa->v1->f&SELECT)==0 && (efa->v2->f&SELECT)==0 && (efa->v3->f&SELECT)==0 && (efa->v4==0 || (efa->v4->f&SELECT)==0)) {
+ if((efa->v1->f&SELECT)==0 && (efa->v2->f&SELECT)==0 && (efa->v3->f&SELECT)==0 && (efa->v4==NULL || (efa->v4->f&SELECT)==0)) {
tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
tf->flag |= TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4;
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index a797b461025..b914f63a384 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -430,7 +430,7 @@ void WM_exit(bContext *C)
// XXX UI_filelist_free_icons();
}
- GPU_buffer_pool_free(0);
+ GPU_buffer_pool_free(NULL);
GPU_free_unused_buffers();
GPU_extensions_exit();
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index bbcb4d60c77..b46f5f34271 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -1141,7 +1141,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
uiBlockSetEmboss(block, UI_EMBOSS);
/* show the splash menu (containing interaction presets), using python */
if (mt) {
- Menu menu= {0};
+ Menu menu= {NULL};
menu.layout= layout;
menu.type= mt;
mt->draw(C, &menu);
@@ -1499,7 +1499,7 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
{
Main *bmain= CTX_data_main(C);
Scene *scene= CTX_data_scene(C);
- Main *mainl= 0;
+ Main *mainl= NULL;
BlendHandle *bh;
PropertyRNA *prop;
char name[FILE_MAX], dir[FILE_MAX], libname[FILE_MAX], group[GROUP_MAX];