use NULL rather then 0 for pointer assignments & comparison, modifier, imbuf & editors.

This commit is contained in:
2011-03-05 10:29:10 +00:00
parent 10373238c1
commit c7fccc84bf
70 changed files with 479 additions and 479 deletions

View File

@@ -216,7 +216,7 @@ int AVI_is_avi (char *name) {
int AVI_is_avi (const char *name) { int AVI_is_avi (const char *name) {
int temp, fcca, j; int temp, fcca, j;
AviMovie movie= {0}; AviMovie movie= {NULL};
AviMainHeader header; AviMainHeader header;
AviBitmapInfoHeader bheader; AviBitmapInfoHeader bheader;
int movie_tracks = 0; int movie_tracks = 0;

View File

@@ -1039,7 +1039,7 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
} }
if(y1 < 0) { /* XXX butregion NULL check?, there is one above */ if(y1 < 0) { /* XXX butregion NULL check?, there is one above */
int newy1; int newy1;
UI_view2d_to_region_no_clip(&butregion->v2d, 0, but->y2 + ofsy, 0, &newy1); UI_view2d_to_region_no_clip(&butregion->v2d, 0, but->y2 + ofsy, NULL, &newy1);
newy1 += butregion->winrct.ymin; newy1 += butregion->winrct.ymin;
y2= y2-y1 + newy1; y2= y2-y1 + newy1;

View File

@@ -383,12 +383,12 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
if(id->lib) { if(id->lib) {
if(id->flag & LIB_INDIRECT) { if(id->flag & LIB_INDIRECT) {
but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_INDIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, 0, 0, 0, 0, 0, but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_INDIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0,
"Indirect library datablock, cannot change."); "Indirect library datablock, cannot change.");
uiButSetFlag(but, UI_BUT_DISABLED); uiButSetFlag(but, UI_BUT_DISABLED);
} }
else { else {
but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_DIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, 0, 0, 0, 0, 0, but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_DIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0,
"Direct linked library datablock, click to make local."); "Direct linked library datablock, click to make local.");
if(!id_make_local(id, 1 /* test */) || (idfrom && idfrom->lib)) if(!id_make_local(id, 1 /* test */) || (idfrom && idfrom->lib))
uiButSetFlag(but, UI_BUT_DISABLED); uiButSetFlag(but, UI_BUT_DISABLED);
@@ -403,9 +403,9 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
sprintf(str, "%d", id->us); sprintf(str, "%d", id->us);
if(id->us<10) if(id->us<10)
but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X,UI_UNIT_Y, 0, 0, 0, 0, 0, "Displays number of users of this data. Click to make a single-user copy."); but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Displays number of users of this data. Click to make a single-user copy.");
else else
but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X+10,UI_UNIT_Y, 0, 0, 0, 0, 0, "Displays number of users of this data. Click to make a single-user copy."); but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X+10,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Displays number of users of this data. Click to make a single-user copy.");
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ALONE)); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ALONE));
if(!id_copy(id, NULL, 1 /* test only */) || (idfrom && idfrom->lib)) if(!id_copy(id, NULL, 1 /* test only */) || (idfrom && idfrom->lib))
@@ -456,7 +456,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
if(unlinkop) { if(unlinkop) {
but= uiDefIconButO(block, BUT, unlinkop, WM_OP_INVOKE_REGION_WIN, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL); but= uiDefIconButO(block, BUT, unlinkop, WM_OP_INVOKE_REGION_WIN, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL);
/* so we can access the template from operators, font unlinking needs this */ /* so we can access the template from operators, font unlinking needs this */
uiButSetNFunc(but, NULL, MEM_dupallocN(template), 0); uiButSetNFunc(but, NULL, MEM_dupallocN(template), NULL);
} }
else { else {
but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Unlink datablock. Shift + Click to set users to zero, data gets not saved"); but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Unlink datablock. Shift + Click to set users to zero, data gets not saved");
@@ -1265,15 +1265,15 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand
if(coba==NULL) return; if(coba==NULL) return;
bt= uiDefBut(block, BUT, 0, "Add", 0+xoffs,100+yoffs,40,20, 0, 0, 0, 0, 0, "Add a new color stop to the colorband"); bt= uiDefBut(block, BUT, 0, "Add", 0+xoffs,100+yoffs,40,20, NULL, 0, 0, 0, 0, "Add a new color stop to the colorband");
uiButSetNFunc(bt, colorband_add_cb, MEM_dupallocN(cb), coba); uiButSetNFunc(bt, colorband_add_cb, MEM_dupallocN(cb), coba);
bt= uiDefBut(block, BUT, 0, "Delete", 45+xoffs,100+yoffs,45,20, 0, 0, 0, 0, 0, "Delete the active position"); bt= uiDefBut(block, BUT, 0, "Delete", 45+xoffs,100+yoffs,45,20, NULL, 0, 0, 0, 0, "Delete the active position");
uiButSetNFunc(bt, colorband_del_cb, MEM_dupallocN(cb), coba); uiButSetNFunc(bt, colorband_del_cb, MEM_dupallocN(cb), coba);
/* XXX, todo for later - convert to operator - campbell */ /* XXX, todo for later - convert to operator - campbell */
bt= uiDefBut(block, BUT, 0, "F", 95+xoffs,100+yoffs,20,20, 0, 0, 0, 0, 0, "Flip colorband"); bt= uiDefBut(block, BUT, 0, "F", 95+xoffs,100+yoffs,20,20, NULL, 0, 0, 0, 0, "Flip colorband");
uiButSetNFunc(bt, colorband_flip_cb, MEM_dupallocN(cb), coba); uiButSetNFunc(bt, colorband_flip_cb, MEM_dupallocN(cb), coba);
uiDefButS(block, NUM, 0, "", 120+xoffs,100+yoffs,80, 20, &coba->cur, 0.0, (float)(MAX2(0, coba->tot-1)), 0, 0, "Choose active color stop"); uiDefButS(block, NUM, 0, "", 120+xoffs,100+yoffs,80, 20, &coba->cur, 0.0, (float)(MAX2(0, coba->tot-1)), 0, 0, "Choose active color stop");

View File

@@ -1047,7 +1047,7 @@ static EnumPropertyItem convert_target_items[]= {
static void curvetomesh(Scene *scene, Object *ob) static void curvetomesh(Scene *scene, Object *ob)
{ {
if(ob->disp.first==0) if(ob->disp.first == NULL)
makeDispListCurveTypes(scene, ob, 0); /* force creation */ makeDispListCurveTypes(scene, ob, 0); /* force creation */
nurbs_to_mesh(ob); /* also does users */ nurbs_to_mesh(ob); /* also does users */
@@ -1213,19 +1213,19 @@ static int convert_exec(bContext *C, wmOperator *op)
if(cu->vfont) { if(cu->vfont) {
cu->vfont->id.us--; cu->vfont->id.us--;
cu->vfont= 0; cu->vfont= NULL;
} }
if(cu->vfontb) { if(cu->vfontb) {
cu->vfontb->id.us--; cu->vfontb->id.us--;
cu->vfontb= 0; cu->vfontb= NULL;
} }
if(cu->vfonti) { if(cu->vfonti) {
cu->vfonti->id.us--; cu->vfonti->id.us--;
cu->vfonti= 0; cu->vfonti= NULL;
} }
if(cu->vfontbi) { if(cu->vfontbi) {
cu->vfontbi->id.us--; cu->vfontbi->id.us--;
cu->vfontbi= 0; cu->vfontbi= NULL;
} }
if (!keep_original) { if (!keep_original) {

View File

@@ -315,7 +315,7 @@ static int bake_image_exec(bContext *C, wmOperator *op)
} }
else { else {
ListBase threads; ListBase threads;
BakeRender bkr= {0}; BakeRender bkr= {NULL};
init_bake_internal(&bkr, C); init_bake_internal(&bkr, C);
bkr.reports= op->reports; bkr.reports= op->reports;

View File

@@ -1797,7 +1797,7 @@ static void auto_timeoffs(Scene *scene, View3D *v3d)
int tot=0, a; int tot=0, a;
short offset=25; short offset=25;
if(BASACT==0 || v3d==NULL) return; if(BASACT==NULL || v3d==NULL) return;
// XXX if(button(&offset, 0, 1000,"Total time")==0) return; // XXX if(button(&offset, 0, 1000,"Total time")==0) return;
/* make array of all bases, xco yco (screen) */ /* make array of all bases, xco yco (screen) */
@@ -1835,7 +1835,7 @@ static void ofs_timeoffs(Scene *scene, View3D *v3d)
{ {
float offset=0.0f; float offset=0.0f;
if(BASACT==0 || v3d==NULL) return; if(BASACT==NULL || v3d==NULL) return;
// XXX if(fbutton(&offset, -10000.0f, 10000.0f, 10, 10, "Offset")==0) return; // XXX if(fbutton(&offset, -10000.0f, 10000.0f, 10, 10, "Offset")==0) return;
@@ -1855,7 +1855,7 @@ static void rand_timeoffs(Scene *scene, View3D *v3d)
Base *base; Base *base;
float rand_ofs=0.0f; float rand_ofs=0.0f;
if(BASACT==0 || v3d==NULL) return; if(BASACT==NULL || v3d==NULL) return;
// XXX if(fbutton(&rand_ofs, 0.0f, 10000.0f, 10, 10, "Randomize")==0) return; // XXX if(fbutton(&rand_ofs, 0.0f, 10000.0f, 10, 10, "Randomize")==0) return;

View File

@@ -323,7 +323,7 @@ static BPoint *findnearestLattvert(ViewContext *vc, short mval[2], int sel)
/* sel==1: selected gets a disadvantage */ /* sel==1: selected gets a disadvantage */
/* in nurb and bezt or bp the nearest is written */ /* in nurb and bezt or bp the nearest is written */
/* return 0 1 2: handlepunt */ /* return 0 1 2: handlepunt */
struct { BPoint *bp; short dist, select, mval[2]; } data = {0}; struct { BPoint *bp; short dist, select, mval[2]; } data = {NULL};
data.dist = 100; data.dist = 100;
data.select = sel; data.select = sel;

View File

@@ -296,7 +296,7 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene *
psys=((ParticleSystemModifierData *)md)->psys; psys=((ParticleSystemModifierData *)md)->psys;
part= psys->part; part= psys->part;
if(part->ren_as != PART_DRAW_PATH || psys->pathcache == 0) if(part->ren_as != PART_DRAW_PATH || psys->pathcache == NULL)
return 0; return 0;
totpart= psys->totcached; totpart= psys->totcached;

View File

@@ -1427,7 +1427,7 @@ static void new_id_matar(Material **matar, int totcol)
for(a=0; a<totcol; a++) { for(a=0; a<totcol; a++) {
id= (ID *)matar[a]; id= (ID *)matar[a];
if(id && id->lib==0) { if(id && id->lib == NULL) {
if(id->newid) { if(id->newid) {
matar[a]= (Material *)id->newid; matar[a]= (Material *)id->newid;
id_us_plus(id->newid); id_us_plus(id->newid);
@@ -1581,7 +1581,7 @@ static void do_single_tex_user(Tex **from)
Tex *tex, *texn; Tex *tex, *texn;
tex= *from; tex= *from;
if(tex==0) return; if(tex==NULL) return;
if(tex->id.newid) { if(tex->id.newid) {
*from= (Tex *)tex->id.newid; *from= (Tex *)tex->id.newid;

View File

@@ -187,7 +187,7 @@ static int object_select_linked_exec(bContext *C, wmOperator *op)
Object *ob; Object *ob;
void *obdata = NULL; void *obdata = NULL;
Material *mat = NULL, *mat1; Material *mat = NULL, *mat1;
Tex *tex=0; Tex *tex= NULL;
int a, b; int a, b;
int nr = RNA_enum_get(op->ptr, "type"); int nr = RNA_enum_get(op->ptr, "type");
short changed = 0, extend; short changed = 0, extend;
@@ -222,15 +222,15 @@ static int object_select_linked_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
else if(nr==2) { else if(nr==2) {
if(ob->data==0) return OPERATOR_CANCELLED; if(ob->data==NULL) return OPERATOR_CANCELLED;
obdata= ob->data; obdata= ob->data;
} }
else if(nr==3 || nr==4) { else if(nr==3 || nr==4) {
mat= give_current_material(ob, ob->actcol); mat= give_current_material(ob, ob->actcol);
if(mat==0) return OPERATOR_CANCELLED; if(mat==NULL) return OPERATOR_CANCELLED;
if(nr==4) { if(nr==4) {
if(mat->mtex[ (int)mat->texact ]) tex= mat->mtex[ (int)mat->texact ]->tex; if(mat->mtex[ (int)mat->texact ]) tex= mat->mtex[ (int)mat->texact ]->tex;
if(tex==0) return OPERATOR_CANCELLED; if(tex==NULL) return OPERATOR_CANCELLED;
} }
} }
else if(nr==5) { else if(nr==5) {
@@ -592,7 +592,7 @@ static int object_select_grouped_exec(bContext *C, wmOperator *op)
} }
ob= OBACT; ob= OBACT;
if(ob==0){ if(ob==NULL) {
BKE_report(op->reports, RPT_ERROR, "No Active Object"); BKE_report(op->reports, RPT_ERROR, "No Active Object");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@@ -629,7 +629,7 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys)
PTCacheEditPoint *point; PTCacheEditPoint *point;
PTCacheEditKey *ekey = NULL; PTCacheEditKey *ekey = NULL;
HairKey *key; HairKey *key;
BVHTreeFromMesh bvhtree= {0}; BVHTreeFromMesh bvhtree= {NULL};
BVHTreeNearest nearest; BVHTreeNearest nearest;
MFace *mface; MFace *mface;
DerivedMesh *dm = NULL; DerivedMesh *dm = NULL;

View File

@@ -177,7 +177,7 @@ void draw_tex_crop(Tex *tex)
rcti rct; rcti rct;
int ret= 0; int ret= 0;
if(tex==0) return; if(tex==NULL) return;
if(tex->type==TEX_IMAGE) { if(tex->type==TEX_IMAGE) {
if(tex->cropxmin==0.0f) ret++; if(tex->cropxmin==0.0f) ret++;
@@ -1219,7 +1219,7 @@ static void icon_preview_startjob(void *customdata, short *stop, short *do_updat
if(idtype == ID_IM) { if(idtype == ID_IM) {
Image *ima= (Image*)id; Image *ima= (Image*)id;
ImBuf *ibuf= NULL; ImBuf *ibuf= NULL;
ImageUser iuser= {0}; ImageUser iuser= {NULL};
/* ima->ok is zero when Image cannot load */ /* ima->ok is zero when Image cannot load */
if(ima==NULL || ima->ok==0) if(ima==NULL || ima->ok==0)

View File

@@ -1423,7 +1423,7 @@ void ED_region_header(const bContext *C, ARegion *ar)
uiBlock *block; uiBlock *block;
uiLayout *layout; uiLayout *layout;
HeaderType *ht; HeaderType *ht;
Header header = {0}; Header header = {NULL};
int maxco, xco, yco; int maxco, xco, yco;
/* clear */ /* clear */

View File

@@ -227,16 +227,16 @@ void removenotused_scredges(bScreen *sc)
sa= sc->areabase.first; sa= sc->areabase.first;
while(sa) { while(sa) {
se= screen_findedge(sc, sa->v1, sa->v2); se= screen_findedge(sc, sa->v1, sa->v2);
if(se==0) printf("error: area %d edge 1 doesn't exist\n", a); if(se==NULL) printf("error: area %d edge 1 doesn't exist\n", a);
else se->flag= 1; else se->flag= 1;
se= screen_findedge(sc, sa->v2, sa->v3); se= screen_findedge(sc, sa->v2, sa->v3);
if(se==0) printf("error: area %d edge 2 doesn't exist\n", a); if(se==NULL) printf("error: area %d edge 2 doesn't exist\n", a);
else se->flag= 1; else se->flag= 1;
se= screen_findedge(sc, sa->v3, sa->v4); se= screen_findedge(sc, sa->v3, sa->v4);
if(se==0) printf("error: area %d edge 3 doesn't exist\n", a); if(se==NULL) printf("error: area %d edge 3 doesn't exist\n", a);
else se->flag= 1; else se->flag= 1;
se= screen_findedge(sc, sa->v4, sa->v1); se= screen_findedge(sc, sa->v4, sa->v1);
if(se==0) printf("error: area %d edge 4 doesn't exist\n", a); if(se==NULL) printf("error: area %d edge 4 doesn't exist\n", a);
else se->flag= 1; else se->flag= 1;
sa= sa->next; sa= sa->next;
a++; a++;
@@ -1495,7 +1495,7 @@ int ED_screen_full_newspace(bContext *C, ScrArea *sa, int type)
bScreen *screen= CTX_wm_screen(C); bScreen *screen= CTX_wm_screen(C);
ScrArea *newsa= NULL; ScrArea *newsa= NULL;
if(!sa || sa->full==0) { if(!sa || sa->full==NULL) {
newsa= ED_screen_full_toggle(C, win, sa); newsa= ED_screen_full_toggle(C, win, sa);
} }

View File

@@ -1761,7 +1761,7 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op)
{ {
Scene *scene= CTX_data_scene(C); Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C); Object *ob= CTX_data_active_object(C);
bDopeSheet ads= {0}; bDopeSheet ads= {NULL};
DLRBT_Tree keys; DLRBT_Tree keys;
ActKeyColumn *ak; ActKeyColumn *ak;
float cfra= (scene)? (float)(CFRA) : 0.0f; float cfra= (scene)? (float)(CFRA) : 0.0f;

View File

@@ -5334,7 +5334,7 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
{ {
Scene *scene= CTX_data_scene(C); Scene *scene= CTX_data_scene(C);
Object *ob= CTX_data_active_object(C); Object *ob= CTX_data_active_object(C);
Mesh *me= 0; Mesh *me= NULL;
if(ob==NULL) if(ob==NULL)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
@@ -5459,7 +5459,7 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op)
{ {
Image *image= BLI_findlink(&CTX_data_main(C)->image, RNA_enum_get(op->ptr, "image")); Image *image= BLI_findlink(&CTX_data_main(C)->image, RNA_enum_get(op->ptr, "image"));
Scene *scene= CTX_data_scene(C); Scene *scene= CTX_data_scene(C);
ProjPaintState ps= {0}; ProjPaintState ps= {NULL};
int orig_brush_size; int orig_brush_size;
IDProperty *idgroup; IDProperty *idgroup;
IDProperty *view_data= NULL; IDProperty *view_data= NULL;

View File

@@ -167,7 +167,7 @@ static int load_tex(Sculpt *sd, Brush* br, ViewContext* vc)
static Snapshot snap; static Snapshot snap;
static int old_size = -1; static int old_size = -1;
GLubyte* buffer = 0; GLubyte* buffer = NULL;
int size; int size;
int j; int j;

View File

@@ -203,7 +203,7 @@ static void do_shared_vertexcol(Mesh *me)
short *scolmain, *scol; short *scolmain, *scol;
char *mcol; char *mcol;
if(me->mcol==0 || me->totvert==0 || me->totface==0) return; if(me->mcol==NULL || me->totvert==0 || me->totface==0) return;
scolmain= MEM_callocN(4*sizeof(short)*me->totvert, "colmain"); scolmain= MEM_callocN(4*sizeof(short)*me->totvert, "colmain");
@@ -264,7 +264,7 @@ static void make_vertexcol(Object *ob) /* single ob */
Mesh *me; Mesh *me;
if(!ob || ob->id.lib) return; if(!ob || ob->id.lib) return;
me= get_mesh(ob); me= get_mesh(ob);
if(me==0) return; if(me==NULL) return;
if(me->edit_mesh) return; if(me->edit_mesh) return;
/* copies from shadedisplist to mcol */ /* copies from shadedisplist to mcol */
@@ -322,7 +322,7 @@ void vpaint_fill(Object *ob, unsigned int paintcol)
int i, selected; int i, selected;
me= get_mesh(ob); me= get_mesh(ob);
if(me==0 || me->totface==0) return; if(me==NULL || me->totface==0) return;
if(!me->mcol) if(!me->mcol)
make_vertexcol(ob); make_vertexcol(ob);
@@ -358,7 +358,7 @@ void wpaint_fill(VPaint *wp, Object *ob, float paintweight)
int selected; int selected;
me= ob->data; me= ob->data;
if(me==0 || me->totface==0 || me->dvert==0 || !me->mface) return; if(me==NULL || me->totface==0 || me->dvert==NULL || !me->mface) return;
selected= (me->editflag & ME_EDIT_PAINT_MASK); selected= (me->editflag & ME_EDIT_PAINT_MASK);

View File

@@ -1220,7 +1220,7 @@ static int actkeys_framejump_exec(bContext *C, wmOperator *UNUSED(op))
ListBase anim_data= {NULL, NULL}; ListBase anim_data= {NULL, NULL};
bAnimListElem *ale; bAnimListElem *ale;
int filter; int filter;
KeyframeEditData ked= {{0}}; KeyframeEditData ked= {{NULL}};
/* get editor data */ /* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0) if (ANIM_animdata_get_context(C, &ac) == 0)
@@ -1290,7 +1290,7 @@ static void snap_action_keys(bAnimContext *ac, short mode)
bAnimListElem *ale; bAnimListElem *ale;
int filter; int filter;
KeyframeEditData ked= {{0}}; KeyframeEditData ked= {{NULL}};
KeyframeEditFunc edit_cb; KeyframeEditFunc edit_cb;
/* filter data */ /* filter data */
@@ -1389,7 +1389,7 @@ static void mirror_action_keys(bAnimContext *ac, short mode)
bAnimListElem *ale; bAnimListElem *ale;
int filter; int filter;
KeyframeEditData ked= {{0}}; KeyframeEditData ked= {{NULL}};
KeyframeEditFunc edit_cb; KeyframeEditFunc edit_cb;
/* get beztriple editing callbacks */ /* get beztriple editing callbacks */

View File

@@ -90,7 +90,7 @@ static void deselect_action_keys (bAnimContext *ac, short test, short sel)
bAnimListElem *ale; bAnimListElem *ale;
int filter; int filter;
KeyframeEditData ked= {{0}}; KeyframeEditData ked= {{NULL}};
KeyframeEditFunc test_cb, sel_cb; KeyframeEditFunc test_cb, sel_cb;
/* determine type-based settings */ /* determine type-based settings */
@@ -371,7 +371,7 @@ static void markers_selectkeys_between (bAnimContext *ac)
int filter; int filter;
KeyframeEditFunc ok_cb, select_cb; KeyframeEditFunc ok_cb, select_cb;
KeyframeEditData ked= {{0}}; KeyframeEditData ked= {{NULL}};
float min, max; float min, max;
/* get extreme markers */ /* get extreme markers */
@@ -422,7 +422,7 @@ static void columnselect_action_keys (bAnimContext *ac, short mode)
Scene *scene= ac->scene; Scene *scene= ac->scene;
CfraElem *ce; CfraElem *ce;
KeyframeEditFunc select_cb, ok_cb; KeyframeEditFunc select_cb, ok_cb;
KeyframeEditData ked= {{0}}; KeyframeEditData ked= {{NULL}};
/* initialise keyframe editing data */ /* initialise keyframe editing data */
@@ -608,7 +608,7 @@ static void select_moreless_action_keys (bAnimContext *ac, short mode)
bAnimListElem *ale; bAnimListElem *ale;
int filter; int filter;
KeyframeEditData ked= {{0}}; KeyframeEditData ked= {{NULL}};
KeyframeEditFunc build_cb; KeyframeEditFunc build_cb;
@@ -730,7 +730,7 @@ static void actkeys_select_leftright (bAnimContext *ac, short leftright, short s
int filter; int filter;
KeyframeEditFunc ok_cb, select_cb; KeyframeEditFunc ok_cb, select_cb;
KeyframeEditData ked= {{0}}; KeyframeEditData ked= {{NULL}};
Scene *scene= ac->scene; Scene *scene= ac->scene;
/* if select mode is replace, deselect all keyframes (and channels) first */ /* if select mode is replace, deselect all keyframes (and channels) first */
@@ -908,7 +908,7 @@ static void actkeys_mselect_single (bAnimContext *ac, bAnimListElem *ale, short
bDopeSheet *ads= (ac->datatype == ANIMCONT_DOPESHEET) ? ac->data : NULL; bDopeSheet *ads= (ac->datatype == ANIMCONT_DOPESHEET) ? ac->data : NULL;
int ds_filter = ((ads) ? (ads->filterflag) : (0)); int ds_filter = ((ads) ? (ads->filterflag) : (0));
KeyframeEditData ked= {{0}}; KeyframeEditData ked= {{NULL}};
KeyframeEditFunc select_cb, ok_cb; KeyframeEditFunc select_cb, ok_cb;
/* get functions for selecting keyframes */ /* get functions for selecting keyframes */
@@ -934,7 +934,7 @@ static void actkeys_mselect_column(bAnimContext *ac, short select_mode, float se
int filter; int filter;
KeyframeEditFunc select_cb, ok_cb; KeyframeEditFunc select_cb, ok_cb;
KeyframeEditData ked= {{0}}; KeyframeEditData ked= {{NULL}};
/* initialise keyframe editing data */ /* initialise keyframe editing data */

View File

@@ -107,7 +107,7 @@ static int file_browse_exec(bContext *C, wmOperator *op)
if (RNA_property_is_set(op->ptr, "filepath")==0 || fbo==NULL) if (RNA_property_is_set(op->ptr, "filepath")==0 || fbo==NULL)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
str= RNA_string_get_alloc(op->ptr, "filepath", 0, 0); str= RNA_string_get_alloc(op->ptr, "filepath", NULL, 0);
/* add slash for directories, important for some properties */ /* add slash for directories, important for some properties */
if(RNA_property_subtype(fbo->prop) == PROP_DIRPATH) { if(RNA_property_subtype(fbo->prop) == PROP_DIRPATH) {
@@ -155,7 +155,7 @@ static int file_browse_invoke(bContext *C, wmOperator *op, wmEvent *event)
if(!prop) if(!prop)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
str= RNA_property_string_get_alloc(&ptr, prop, 0, 0); str= RNA_property_string_get_alloc(&ptr, prop, NULL, 0);
/* useful yet irritating feature, Shift+Click to open the file /* useful yet irritating feature, Shift+Click to open the file
* Alt+Click to browse a folder in the OS's browser */ * Alt+Click to browse a folder in the OS's browser */

View File

@@ -717,7 +717,7 @@ static int copy_exec(bContext *C, wmOperator *UNUSED(op))
int sel[2]; int sel[2];
int offset= 0; int offset= 0;
ConsoleLine cl_dummy= {0}; ConsoleLine cl_dummy= {NULL};
#if 0 #if 0
/* copy whole file */ /* copy whole file */

View File

@@ -389,7 +389,7 @@ static void file_draw_preview(uiBlock *block, struct direntry *file, int sx, int
uiButSetDragImage(but, file->path, get_file_icon(file), imb, scale); uiButSetDragImage(but, file->path, get_file_icon(file), imb, scale);
glDisable(GL_BLEND); glDisable(GL_BLEND);
imb = 0; imb = NULL;
} }
} }

View File

@@ -540,20 +540,20 @@ void filelist_free(struct FileList* filelist)
if (filelist->filelist[i].image) { if (filelist->filelist[i].image) {
IMB_freeImBuf(filelist->filelist[i].image); IMB_freeImBuf(filelist->filelist[i].image);
} }
filelist->filelist[i].image = 0; filelist->filelist[i].image = NULL;
if (filelist->filelist[i].relname) if (filelist->filelist[i].relname)
MEM_freeN(filelist->filelist[i].relname); MEM_freeN(filelist->filelist[i].relname);
if (filelist->filelist[i].path) if (filelist->filelist[i].path)
MEM_freeN(filelist->filelist[i].path); MEM_freeN(filelist->filelist[i].path);
filelist->filelist[i].relname = 0; filelist->filelist[i].relname = NULL;
if (filelist->filelist[i].string) if (filelist->filelist[i].string)
MEM_freeN(filelist->filelist[i].string); MEM_freeN(filelist->filelist[i].string);
filelist->filelist[i].string = 0; filelist->filelist[i].string = NULL;
} }
filelist->numfiles = 0; filelist->numfiles = 0;
free(filelist->filelist); free(filelist->filelist);
filelist->filelist = 0; filelist->filelist = NULL;
filelist->filter = 0; filelist->filter = 0;
filelist->filter_glob[0] = '\0'; filelist->filter_glob[0] = '\0';
filelist->numfiltered =0; filelist->numfiltered =0;
@@ -564,7 +564,7 @@ void filelist_freelib(struct FileList* filelist)
{ {
if(filelist->libfiledata) if(filelist->libfiledata)
BLO_blendhandle_close(filelist->libfiledata); BLO_blendhandle_close(filelist->libfiledata);
filelist->libfiledata= 0; filelist->libfiledata= NULL;
} }
struct BlendHandle *filelist_lib(struct FileList* filelist) struct BlendHandle *filelist_lib(struct FileList* filelist)
@@ -841,8 +841,8 @@ static void filelist_read_dir(struct FileList* filelist)
char wdir[FILE_MAX]= ""; char wdir[FILE_MAX]= "";
if (!filelist) return; if (!filelist) return;
filelist->fidx = 0; filelist->fidx = NULL;
filelist->filelist = 0; filelist->filelist = NULL;
BLI_getwdN(wdir, sizeof(wdir)); /* backup cwd to restore after */ BLI_getwdN(wdir, sizeof(wdir)); /* backup cwd to restore after */
@@ -896,7 +896,7 @@ void filelist_readdir(struct FileList* filelist)
int filelist_empty(struct FileList* filelist) int filelist_empty(struct FileList* filelist)
{ {
return filelist->filelist == 0; return filelist->filelist == NULL;
} }
void filelist_parent(struct FileList* filelist) void filelist_parent(struct FileList* filelist)
@@ -977,7 +977,7 @@ void filelist_from_library(struct FileList* filelist)
if (!ok) { if (!ok) {
/* free */ /* free */
if(filelist->libfiledata) BLO_blendhandle_close(filelist->libfiledata); if(filelist->libfiledata) BLO_blendhandle_close(filelist->libfiledata);
filelist->libfiledata= 0; filelist->libfiledata= NULL;
return; return;
} }
@@ -985,9 +985,9 @@ void filelist_from_library(struct FileList* filelist)
/* there we go */ /* there we go */
/* for the time being only read filedata when libfiledata==0 */ /* for the time being only read filedata when libfiledata==0 */
if (filelist->libfiledata==0) { if (filelist->libfiledata == NULL) {
filelist->libfiledata= BLO_blendhandle_from_file(dir); filelist->libfiledata= BLO_blendhandle_from_file(dir);
if(filelist->libfiledata==0) return; if(filelist->libfiledata == NULL) return;
} }
idcode= groupname_to_code(group); idcode= groupname_to_code(group);
@@ -1116,7 +1116,7 @@ void filelist_from_main(struct FileList *filelist)
idcode= groupname_to_code(filelist->dir); idcode= groupname_to_code(filelist->dir);
lb= which_libbase(G.main, idcode ); lb= which_libbase(G.main, idcode );
if(lb==0) return; if(lb == NULL) return;
id= lb->first; id= lb->first;
filelist->numfiles= 0; filelist->numfiles= 0;

View File

@@ -405,12 +405,12 @@ static void column_widths(struct FileList* files, struct FileLayout* layout)
void ED_fileselect_init_layout(struct SpaceFile *sfile, struct ARegion *ar) void ED_fileselect_init_layout(struct SpaceFile *sfile, struct ARegion *ar)
{ {
FileSelectParams *params = ED_fileselect_get_params(sfile); FileSelectParams *params = ED_fileselect_get_params(sfile);
FileLayout *layout=0; FileLayout *layout= NULL;
View2D *v2d= &ar->v2d; View2D *v2d= &ar->v2d;
int maxlen = 0; int maxlen = 0;
int numfiles; int numfiles;
int textheight; int textheight;
if (sfile->layout == 0) { if (sfile->layout == NULL) {
sfile->layout = MEM_callocN(sizeof(struct FileLayout), "file_layout"); sfile->layout = MEM_callocN(sizeof(struct FileLayout), "file_layout");
sfile->layout->dirty = 1; sfile->layout->dirty = 1;
} }

View File

@@ -91,7 +91,7 @@ static void deselect_graph_keys (bAnimContext *ac, short test, short sel)
int filter; int filter;
SpaceIpo *sipo= (SpaceIpo *)ac->sa->spacedata.first; SpaceIpo *sipo= (SpaceIpo *)ac->sa->spacedata.first;
KeyframeEditData ked= {{0}}; KeyframeEditData ked= {{NULL}};
KeyframeEditFunc test_cb, sel_cb; KeyframeEditFunc test_cb, sel_cb;
/* determine type-based settings */ /* determine type-based settings */
@@ -729,7 +729,7 @@ static void graphkeys_select_leftright (bAnimContext *ac, short leftright, short
int filter; int filter;
KeyframeEditFunc ok_cb, select_cb; KeyframeEditFunc ok_cb, select_cb;
KeyframeEditData ked= {{0}}; KeyframeEditData ked= {{NULL}};
Scene *scene= ac->scene; Scene *scene= ac->scene;
/* if select mode is replace, deselect all keyframes (and channels) first */ /* if select mode is replace, deselect all keyframes (and channels) first */

View File

@@ -929,7 +929,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
uiItemR(col, userptr, "frame_duration", 0, str, ICON_NONE); uiItemR(col, userptr, "frame_duration", 0, str, ICON_NONE);
if(ima->anim) { if(ima->anim) {
block= uiLayoutGetBlock(row); block= uiLayoutGetBlock(row);
but= uiDefBut(block, BUT, 0, "Match Movie Length", 0, 0, UI_UNIT_X*2, UI_UNIT_Y, 0, 0, 0, 0, 0, "Set the number of frames to match the movie or sequence."); but= uiDefBut(block, BUT, 0, "Match Movie Length", 0, 0, UI_UNIT_X*2, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Set the number of frames to match the movie or sequence.");
uiButSetFunc(but, set_frames_cb, ima, iuser); uiButSetFunc(but, set_frames_cb, ima, iuser);
} }

View File

@@ -1423,7 +1423,7 @@ static int nlaedit_apply_scale_exec (bContext *C, wmOperator *UNUSED(op))
bAnimListElem *ale; bAnimListElem *ale;
int filter; int filter;
KeyframeEditData ked= {{0}}; KeyframeEditData ked= {{NULL}};
/* get editor data */ /* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0) if (ANIM_animdata_get_context(C, &ac) == 0)

View File

@@ -464,7 +464,7 @@ static void node_draw_mute_line(View2D *v2d, SpaceNode *snode, bNode *node)
{ {
bNodeSocket *valsock= NULL, *colsock= NULL, *vecsock= NULL; bNodeSocket *valsock= NULL, *colsock= NULL, *vecsock= NULL;
bNodeSocket *sock; bNodeSocket *sock;
bNodeLink link= {0}; bNodeLink link= {NULL};
int a; int a;
/* connect the first value buffer in with first value out */ /* connect the first value buffer in with first value out */

View File

@@ -3291,7 +3291,7 @@ static void id_local_cb(bContext *UNUSED(C), Scene *UNUSED(scene), TreeElement *
if(tselem->id->lib && (tselem->id->flag & LIB_EXTERN)) { if(tselem->id->lib && (tselem->id->flag & LIB_EXTERN)) {
tselem->id->lib= NULL; tselem->id->lib= NULL;
tselem->id->flag= LIB_LOCAL; tselem->id->flag= LIB_LOCAL;
new_id(0, tselem->id, 0); new_id(NULL, tselem->id, NULL);
} }
} }
@@ -5251,15 +5251,15 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar
uiBlockSetEmboss(block, UI_EMBOSSN); uiBlockSetEmboss(block, UI_EMBOSSN);
restrict_bool= group_restrict_flag(gr, OB_RESTRICT_VIEW); restrict_bool= group_restrict_flag(gr, OB_RESTRICT_VIEW);
bt = uiDefIconBut(block, BUT, 0, restrict_bool ? ICON_RESTRICT_VIEW_ON : ICON_RESTRICT_VIEW_OFF, (int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, (int)te->ys, 17, OL_H-1, 0, 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View"); bt = uiDefIconBut(block, BUT, 0, restrict_bool ? ICON_RESTRICT_VIEW_ON : ICON_RESTRICT_VIEW_OFF, (int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_VIEWX, (int)te->ys, 17, OL_H-1, NULL, 0, 0, 0, 0, "Restrict/Allow visibility in the 3D View");
uiButSetFunc(bt, restrictbutton_gr_restrict_view, scene, gr); uiButSetFunc(bt, restrictbutton_gr_restrict_view, scene, gr);
restrict_bool= group_restrict_flag(gr, OB_RESTRICT_SELECT); restrict_bool= group_restrict_flag(gr, OB_RESTRICT_SELECT);
bt = uiDefIconBut(block, BUT, 0, restrict_bool ? ICON_RESTRICT_SELECT_ON : ICON_RESTRICT_SELECT_OFF, (int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_SELECTX, (int)te->ys, 17, OL_H-1, 0, 0, 0, 0, 0, "Restrict/Allow selection in the 3D View"); bt = uiDefIconBut(block, BUT, 0, restrict_bool ? ICON_RESTRICT_SELECT_ON : ICON_RESTRICT_SELECT_OFF, (int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_SELECTX, (int)te->ys, 17, OL_H-1, NULL, 0, 0, 0, 0, "Restrict/Allow selection in the 3D View");
uiButSetFunc(bt, restrictbutton_gr_restrict_select, scene, gr); uiButSetFunc(bt, restrictbutton_gr_restrict_select, scene, gr);
restrict_bool= group_restrict_flag(gr, OB_RESTRICT_RENDER); restrict_bool= group_restrict_flag(gr, OB_RESTRICT_RENDER);
bt = uiDefIconBut(block, BUT, 0, restrict_bool ? ICON_RESTRICT_RENDER_ON : ICON_RESTRICT_RENDER_OFF, (int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_RENDERX, (int)te->ys, 17, OL_H-1, 0, 0, 0, 0, 0, "Restrict/Allow renderability"); bt = uiDefIconBut(block, BUT, 0, restrict_bool ? ICON_RESTRICT_RENDER_ON : ICON_RESTRICT_RENDER_OFF, (int)ar->v2d.cur.xmax-OL_TOG_RESTRICT_RENDERX, (int)te->ys, 17, OL_H-1, NULL, 0, 0, 0, 0, "Restrict/Allow renderability");
uiButSetFunc(bt, restrictbutton_gr_restrict_render, scene, gr); uiButSetFunc(bt, restrictbutton_gr_restrict_render, scene, gr);
uiBlockSetEmboss(block, UI_EMBOSS); uiBlockSetEmboss(block, UI_EMBOSS);

View File

@@ -367,7 +367,7 @@ static GPUTexture *GPU_texture_create_nD(int w, int h, int n, float *fpixels, in
} }
if (tex->target == GL_TEXTURE_1D) { if (tex->target == GL_TEXTURE_1D) {
glTexImage1D(tex->target, 0, internalformat, tex->w, 0, format, type, 0); glTexImage1D(tex->target, 0, internalformat, tex->w, 0, format, type, NULL);
if (fpixels) { if (fpixels) {
glTexSubImage1D(tex->target, 0, 0, w, format, type, glTexSubImage1D(tex->target, 0, 0, w, format, type,
@@ -380,7 +380,7 @@ static GPUTexture *GPU_texture_create_nD(int w, int h, int n, float *fpixels, in
} }
else { else {
glTexImage2D(tex->target, 0, internalformat, tex->w, tex->h, 0, glTexImage2D(tex->target, 0, internalformat, tex->w, tex->h, 0,
format, type, 0); format, type, NULL);
if (fpixels) { if (fpixels) {
glTexSubImage2D(tex->target, 0, 0, 0, w, h, glTexSubImage2D(tex->target, 0, 0, 0, w, h,

View File

@@ -90,7 +90,7 @@ ImFileType IMB_FILE_TYPES[]= {
#ifdef WITH_QUICKTIME #ifdef WITH_QUICKTIME
{quicktime_init, quicktime_exit, imb_is_a_quicktime, imb_ftype_quicktime, imb_quicktime_decode, NULL, NULL, 0, QUICKTIME}, {quicktime_init, quicktime_exit, imb_is_a_quicktime, imb_ftype_quicktime, imb_quicktime_decode, NULL, NULL, 0, QUICKTIME},
#endif #endif
{NULL, NULL, NULL, NULL, NULL, NULL, 0}}; {NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0}};
void imb_filetypes_init(void) void imb_filetypes_init(void)
{ {

View File

@@ -59,8 +59,8 @@ struct ImBuf *IMB_half_x(struct ImBuf *ibuf1)
float af,rf,gf,bf, *p1f, *_p1f, *destf; float af,rf,gf,bf, *p1f, *_p1f, *destf;
int do_rect, do_float; int do_rect, do_float;
if (ibuf1==NULL) return (0); if (ibuf1==NULL) return (NULL);
if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (0); if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (NULL);
do_rect= (ibuf1->rect != NULL); do_rect= (ibuf1->rect != NULL);
do_float= (ibuf1->rect_float != 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)); if (ibuf1->x <= 1) return(IMB_dupImBuf(ibuf1));
ibuf2 = IMB_allocImBuf((ibuf1->x)/2, ibuf1->y, ibuf1->depth, ibuf1->flags); 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; _p1 = (uchar *) ibuf1->rect;
dest=(uchar *) ibuf2->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; int *p1,*dest, i, col, do_rect, do_float;
float *p1f, *destf; float *p1f, *destf;
if (ibuf1==NULL) return (0); if (ibuf1==NULL) return (NULL);
if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (0); if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (NULL);
do_rect= (ibuf1->rect != NULL); do_rect= (ibuf1->rect != NULL);
do_float= (ibuf1->rect_float != NULL); do_float= (ibuf1->rect_float != NULL);
ibuf2 = IMB_allocImBuf(2 * ibuf1->x , ibuf1->y , ibuf1->depth, ibuf1->flags); 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; p1 = (int *) ibuf1->rect;
dest=(int *) ibuf2->rect; dest=(int *) ibuf2->rect;
@@ -159,8 +159,8 @@ struct ImBuf *IMB_double_x(struct ImBuf *ibuf1)
{ {
struct ImBuf *ibuf2; struct ImBuf *ibuf2;
if (ibuf1==NULL) return (0); if (ibuf1==NULL) return (NULL);
if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (0); if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (NULL);
ibuf2 = IMB_double_fast_x(ibuf1); ibuf2 = IMB_double_fast_x(ibuf1);
@@ -179,15 +179,15 @@ struct ImBuf *IMB_half_y(struct ImBuf *ibuf1)
p1= p2= NULL; p1= p2= NULL;
p1f= p2f= NULL; p1f= p2f= NULL;
if (ibuf1==NULL) return (0); if (ibuf1==NULL) return (NULL);
if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (0); if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (NULL);
if (ibuf1->y <= 1) return(IMB_dupImBuf(ibuf1)); if (ibuf1->y <= 1) return(IMB_dupImBuf(ibuf1));
do_rect= (ibuf1->rect != NULL); do_rect= (ibuf1->rect != NULL);
do_float= (ibuf1->rect_float != NULL); do_float= (ibuf1->rect_float != NULL);
ibuf2 = IMB_allocImBuf(ibuf1->x , (ibuf1->y) / 2 , ibuf1->depth, ibuf1->flags); 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; _p1 = (uchar *) ibuf1->rect;
dest=(uchar *) ibuf2->rect; dest=(uchar *) ibuf2->rect;
@@ -248,14 +248,14 @@ struct ImBuf *IMB_double_fast_y(struct ImBuf *ibuf1)
short x,y; short x,y;
int do_rect, do_float; int do_rect, do_float;
if (ibuf1==NULL) return (0); if (ibuf1==NULL) return (NULL);
if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (0); if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (NULL);
do_rect= (ibuf1->rect != NULL); do_rect= (ibuf1->rect != NULL);
do_float= (ibuf1->rect_float != NULL); do_float= (ibuf1->rect_float != NULL);
ibuf2 = IMB_allocImBuf(ibuf1->x , 2 * ibuf1->y , ibuf1->depth, ibuf1->flags); 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; p1 = (int *) ibuf1->rect;
dest1= (int *) ibuf2->rect; dest1= (int *) ibuf2->rect;
@@ -282,8 +282,8 @@ struct ImBuf *IMB_double_y(struct ImBuf *ibuf1)
{ {
struct ImBuf *ibuf2; struct ImBuf *ibuf2;
if (ibuf1==NULL) return (0); if (ibuf1==NULL) return (NULL);
if (ibuf1->rect==NULL) return (0); if (ibuf1->rect==NULL) return (NULL);
ibuf2 = IMB_double_fast_y(ibuf1); ibuf2 = IMB_double_fast_y(ibuf1);
@@ -345,14 +345,14 @@ struct ImBuf *IMB_onehalf(struct ImBuf *ibuf1)
{ {
struct ImBuf *ibuf2; struct ImBuf *ibuf2;
if (ibuf1==NULL) return (0); if (ibuf1==NULL) return (NULL);
if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (0); if (ibuf1->rect==NULL && ibuf1->rect_float==NULL) return (NULL);
if (ibuf1->x <= 1) return(IMB_half_y(ibuf1)); if (ibuf1->x <= 1) return(IMB_half_y(ibuf1));
if (ibuf1->y <= 1) return(IMB_half_x(ibuf1)); if (ibuf1->y <= 1) return(IMB_half_x(ibuf1));
ibuf2=IMB_allocImBuf((ibuf1->x)/2, (ibuf1->y)/2, ibuf1->depth, ibuf1->flags); 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); 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; nval[0]= nval[1]= nval[2]= nval[3]= 0.0f;
nvalf[0]=nvalf[1]=nvalf[2]=nvalf[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==NULL && ibuf->rect_float==NULL) return (ibuf);
if (ibuf->rect) { 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; nval[0]= nval[1]= nval[2]= nval[3]= 0.0f;
nvalf[0]=nvalf[1]=nvalf[2]=nvalf[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==NULL && ibuf->rect_float==NULL) return (ibuf);
if (ibuf->rect) { 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_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_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; 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==NULL && ibuf->rect_float==NULL) return (ibuf);
if (ibuf->rect) { 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_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_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; 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==NULL && ibuf->rect_float==NULL) return (ibuf);
if (ibuf->rect) { 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) 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 (ibuf->rect==NULL && ibuf->rect_float==NULL) return (ibuf);
if (newx == ibuf->x && newy == ibuf->y) { 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; rect = NULL; _newrect = NULL; newrect = NULL;
rectf = NULL; _newrectf = NULL; newrectf = 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) do_rect = 1;
if (ibuf->rect_float) do_float = 1; if (ibuf->rect_float) do_float = 1;
if (do_rect==0 && do_float==0) return(ibuf); if (do_rect==0 && do_float==0) return(ibuf);

View File

@@ -196,8 +196,8 @@ static int dumptarga(struct ImBuf * ibuf, FILE * file)
int size; int size;
uchar *rect; uchar *rect;
if (ibuf == 0) return (0); if (ibuf == NULL) return (0);
if (ibuf->rect == 0) return (0); if (ibuf->rect == NULL) return (0);
size = ibuf->x * ibuf->y; size = ibuf->x * ibuf->y;
rect = (uchar *) ibuf->rect; rect = (uchar *) ibuf->rect;
@@ -366,8 +366,8 @@ static void decodetarga(struct ImBuf *ibuf, unsigned char *mem, size_t mem_size,
unsigned int *rect; unsigned int *rect;
uchar * cp = (uchar *) &col; uchar * cp = (uchar *) &col;
if (ibuf == 0) return; if (ibuf == NULL) return;
if (ibuf->rect == 0) return; if (ibuf->rect == NULL) return;
size = ibuf->x * ibuf->y; size = ibuf->x * ibuf->y;
rect = ibuf->rect; rect = ibuf->rect;
@@ -477,8 +477,8 @@ static void ldtarga(struct ImBuf * ibuf,unsigned char * mem, size_t mem_size, in
unsigned int *rect; unsigned int *rect;
uchar * cp = (uchar *) &col; uchar * cp = (uchar *) &col;
if (ibuf == 0) return; if (ibuf == NULL) return;
if (ibuf->rect == 0) return; if (ibuf->rect == NULL) return;
size = ibuf->x * ibuf->y; size = ibuf->x * ibuf->y;
rect = ibuf->rect; 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; unsigned int *rect, *cmap= NULL, mincol= 0, maxcol= 0;
uchar * cp = (uchar *) &col; 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); 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); 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->ftype = TGA;
ibuf->profile = IB_PROFILE_SRGB; ibuf->profile = IB_PROFILE_SRGB;
mem = mem + 18 + tga.numid; mem = mem + 18 + tga.numid;

View File

@@ -272,7 +272,7 @@ ImBuf* IMB_thumb_create(const char* path, ThumbSize size, ThumbSource source, Im
tsize = 1; tsize = 1;
break; break;
default: default:
return 0; /* unknown size */ return NULL; /* unknown size */
} }
uri_from_filename(path, uri); 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) { if (size == THB_FAIL) {
img = IMB_allocImBuf(1,1,32, IB_rect | IB_metadata); img = IMB_allocImBuf(1,1,32, IB_rect | IB_metadata);
if (!img) return 0; if (!img) return NULL;
} else { } else {
if (THB_SOURCE_IMAGE == source || THB_SOURCE_BLEND == source) { 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); stat(path, &info);
BLI_snprintf(mtime, sizeof(mtime), "%ld", info.st_mtime); BLI_snprintf(mtime, sizeof(mtime), "%ld", info.st_mtime);
} }
if (!img) return 0; if (!img) return NULL;
if (img->x > img->y) { if (img->x > img->y) {
scaledx = (float)tsize; scaledx = (float)tsize;
@@ -365,7 +365,7 @@ ImBuf* IMB_thumb_read(const char* path, ThumbSize size)
{ {
char thumb[FILE_MAX]; char thumb[FILE_MAX];
char uri[FILE_MAX*3+8]; char uri[FILE_MAX*3+8];
ImBuf *img = 0; ImBuf *img = NULL;
if (!uri_from_filename(path,uri)) { if (!uri_from_filename(path,uri)) {
return NULL; 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)) { if (!IMB_metadata_get_field(img, "Thumb::MTime", mtime, 40)) {
/* illegal thumb, forget it! */ /* illegal thumb, forget it! */
IMB_freeImBuf(img); IMB_freeImBuf(img);
img = 0; img = NULL;
} else { } else {
time_t t = atol(mtime); time_t t = atol(mtime);
if (st.st_mtime != t) { if (st.st_mtime != t) {
/* recreate all thumbs */ /* recreate all thumbs */
IMB_freeImBuf(img); IMB_freeImBuf(img);
img = 0; img = NULL;
IMB_thumb_delete(path, THB_NORMAL); IMB_thumb_delete(path, THB_NORMAL);
IMB_thumb_delete(path, THB_LARGE); IMB_thumb_delete(path, THB_LARGE);
IMB_thumb_delete(path, THB_FAIL); IMB_thumb_delete(path, THB_FAIL);
@@ -445,7 +445,7 @@ ImBuf* IMB_thumb_manage(const char* path, ThumbSize size, ThumbSource source)
if (img) { if (img) {
/* we don't need failed thumb anymore */ /* we don't need failed thumb anymore */
IMB_freeImBuf(img); IMB_freeImBuf(img);
img = 0; img = NULL;
} }
} }
} }
@@ -458,7 +458,7 @@ ImBuf* IMB_thumb_manage(const char* path, ThumbSize size, ThumbSource source)
if (img) { if (img) {
/* we don't need failed thumb anymore */ /* we don't need failed thumb anymore */
IMB_freeImBuf(img); IMB_freeImBuf(img);
img = 0; img = NULL;
} }
} }
} }

View File

@@ -170,7 +170,7 @@ static int le_int(int temp)
int DNA_elem_array_size(const char *astr, int len) int DNA_elem_array_size(const char *astr, int len)
{ {
int a, mul=1; int a, mul=1;
char str[100], *cp=0; char str[100], *cp= NULL;
memcpy(str, astr, len+1); memcpy(str, astr, len+1);
@@ -259,7 +259,7 @@ static void printstruct(SDNA *sdna, short strnr)
static short *findstruct_name(SDNA *sdna, const char *str) static short *findstruct_name(SDNA *sdna, const char *str)
{ {
int a; int a;
short *sp=0; short *sp= NULL;
for(a=0; a<sdna->nr_structs; a++) { for(a=0; a<sdna->nr_structs; a++) {
@@ -269,12 +269,12 @@ static short *findstruct_name(SDNA *sdna, const char *str)
if(strcmp( sdna->types[ sp[0] ], str )==0) return sp; if(strcmp( sdna->types[ sp[0] ], str )==0) return sp;
} }
return 0; return NULL;
} }
int DNA_struct_find_nr(SDNA *sdna, const char *str) int DNA_struct_find_nr(SDNA *sdna, const char *str)
{ {
short *sp=0; short *sp= NULL;
int a; int a;
if(sdna->lastfind<sdna->nr_structs) { if(sdna->lastfind<sdna->nr_structs) {
@@ -808,12 +808,12 @@ static char *find_elem(SDNA *sdna, const char *type, const char *name, short *ol
return olddata; return olddata;
} }
return 0; return NULL;
} }
olddata+= len; olddata+= len;
} }
return 0; return NULL;
} }
static void reconstruct_elem(SDNA *newsdna, SDNA *oldsdna, char *type, const char *name, char *curdata, short *old, char *olddata) static void reconstruct_elem(SDNA *newsdna, SDNA *oldsdna, char *type, const char *name, char *curdata, short *old, char *olddata)
@@ -999,7 +999,7 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data)
/* test: is type a struct? */ /* test: is type a struct? */
if(spc[0]>=firststructtypenr && !ispointer(name)) { if(spc[0]>=firststructtypenr && !ispointer(name)) {
/* where does the old data start (is there one?) */ /* where does the old data start (is there one?) */
cpo= find_elem(oldsdna, type, name, spo, data, 0); cpo= find_elem(oldsdna, type, name, spo, data, NULL);
if(cpo) { if(cpo) {
oldSDNAnr= DNA_struct_find_nr(oldsdna, type); oldSDNAnr= DNA_struct_find_nr(oldsdna, type);

View File

@@ -194,15 +194,15 @@ ModifierTypeInfo modifierType_Armature = {
/* deformMatrices */ deformMatrices, /* deformMatrices */ deformMatrices,
/* deformVertsEM */ deformVertsEM, /* deformVertsEM */ deformVertsEM,
/* deformMatricesEM */ deformMatricesEM, /* deformMatricesEM */ deformMatricesEM,
/* applyModifier */ 0, /* applyModifier */ NULL,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ requiredDataMask, /* requiredDataMask */ requiredDataMask,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ isDisabled, /* isDisabled */ isDisabled,
/* updateDepgraph */ updateDepgraph, /* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ foreachObjectLink, /* foreachObjectLink */ foreachObjectLink,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -811,19 +811,19 @@ ModifierTypeInfo modifierType_Array = {
| eModifierTypeFlag_AcceptsCVs, | eModifierTypeFlag_AcceptsCVs,
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ 0, /* deformVerts */ NULL,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ 0, /* deformVertsEM */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ applyModifier, /* applyModifier */ applyModifier,
/* applyModifierEM */ applyModifierEM, /* applyModifierEM */ applyModifierEM,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ 0, /* requiredDataMask */ NULL,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ 0, /* isDisabled */ NULL,
/* updateDepgraph */ updateDepgraph, /* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ foreachObjectLink, /* foreachObjectLink */ foreachObjectLink,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -135,19 +135,19 @@ ModifierTypeInfo modifierType_Bevel = {
| eModifierTypeFlag_EnableInEditmode, | eModifierTypeFlag_EnableInEditmode,
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ 0, /* deformVerts */ NULL,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ 0, /* deformVertsEM */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ applyModifier, /* applyModifier */ applyModifier,
/* applyModifierEM */ applyModifierEM, /* applyModifierEM */ applyModifierEM,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ requiredDataMask, /* requiredDataMask */ requiredDataMask,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ 0, /* isDisabled */ NULL,
/* updateDepgraph */ 0, /* updateDepgraph */ NULL,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ 0, /* foreachObjectLink */ NULL,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -34,6 +34,7 @@
* \ingroup modifiers * \ingroup modifiers
*/ */
#include <stdio.h>
#include "DNA_object_types.h" #include "DNA_object_types.h"
@@ -144,19 +145,19 @@ ModifierTypeInfo modifierType_Boolean = {
| eModifierTypeFlag_UsesPointCache, | eModifierTypeFlag_UsesPointCache,
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ 0, /* deformVerts */ NULL,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ 0, /* deformVertsEM */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ applyModifier, /* applyModifier */ applyModifier,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ 0, /* initData */ NULL,
/* requiredDataMask */ requiredDataMask, /* requiredDataMask */ requiredDataMask,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ isDisabled, /* isDisabled */ isDisabled,
/* updateDepgraph */ updateDepgraph, /* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ foreachObjectLink, /* foreachObjectLink */ foreachObjectLink,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -624,18 +624,18 @@ ModifierTypeInfo modifierType_Cast = {
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ deformVerts, /* deformVerts */ deformVerts,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ deformVertsEM, /* deformVertsEM */ deformVertsEM,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ 0, /* applyModifier */ NULL,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ requiredDataMask, /* requiredDataMask */ requiredDataMask,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ isDisabled, /* isDisabled */ isDisabled,
/* updateDepgraph */ updateDepgraph, /* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ foreachObjectLink, /* foreachObjectLink */ foreachObjectLink,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -201,19 +201,19 @@ ModifierTypeInfo modifierType_Cloth = {
| eModifierTypeFlag_Single, | eModifierTypeFlag_Single,
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ 0, /* deformVerts */ NULL,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ 0, /* deformVertsEM */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ applyModifier, /* applyModifier */ applyModifier,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ requiredDataMask, /* requiredDataMask */ requiredDataMask,
/* freeData */ freeData, /* freeData */ freeData,
/* isDisabled */ 0, /* isDisabled */ NULL,
/* updateDepgraph */ updateDepgraph, /* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ dependsOnTime, /* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ 0, /* foreachObjectLink */ NULL,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -250,20 +250,20 @@ ModifierTypeInfo modifierType_Collision = {
/* flags */ eModifierTypeFlag_AcceptsMesh /* flags */ eModifierTypeFlag_AcceptsMesh
| eModifierTypeFlag_Single, | eModifierTypeFlag_Single,
/* copyData */ 0, /* copyData */ NULL,
/* deformVerts */ deformVerts, /* deformVerts */ deformVerts,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ 0, /* deformVertsEM */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ 0, /* applyModifier */ NULL,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ 0, /* requiredDataMask */ NULL,
/* freeData */ freeData, /* freeData */ freeData,
/* isDisabled */ 0, /* isDisabled */ NULL,
/* updateDepgraph */ 0, /* updateDepgraph */ NULL,
/* dependsOnTime */ dependsOnTime, /* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ 0, /* foreachObjectLink */ NULL,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -148,18 +148,18 @@ ModifierTypeInfo modifierType_Curve = {
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ deformVerts, /* deformVerts */ deformVerts,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ deformVertsEM, /* deformVertsEM */ deformVertsEM,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ 0, /* applyModifier */ NULL,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ requiredDataMask, /* requiredDataMask */ requiredDataMask,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ isDisabled, /* isDisabled */ isDisabled,
/* updateDepgraph */ updateDepgraph, /* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ foreachObjectLink, /* foreachObjectLink */ foreachObjectLink,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -203,19 +203,19 @@ ModifierTypeInfo modifierType_Decimate = {
/* type */ eModifierTypeType_Nonconstructive, /* type */ eModifierTypeType_Nonconstructive,
/* flags */ eModifierTypeFlag_AcceptsMesh, /* flags */ eModifierTypeFlag_AcceptsMesh,
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ 0, /* deformVerts */ NULL,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ 0, /* deformVertsEM */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ applyModifier, /* applyModifier */ applyModifier,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ 0, /* requiredDataMask */ NULL,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ 0, /* isDisabled */ NULL,
/* updateDepgraph */ 0, /* updateDepgraph */ NULL,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ 0, /* foreachObjectLink */ NULL,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -362,14 +362,14 @@ ModifierTypeInfo modifierType_Displace = {
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ deformVerts, /* deformVerts */ deformVerts,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ deformVertsEM, /* deformVertsEM */ deformVertsEM,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ 0, /* applyModifier */ NULL,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ requiredDataMask, /* requiredDataMask */ requiredDataMask,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ isDisabled, /* isDisabled */ isDisabled,
/* updateDepgraph */ updateDepgraph, /* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ dependsOnTime, /* dependsOnTime */ dependsOnTime,

View File

@@ -1289,19 +1289,19 @@ ModifierTypeInfo modifierType_EdgeSplit = {
| eModifierTypeFlag_EnableInEditmode, | eModifierTypeFlag_EnableInEditmode,
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ 0, /* deformVerts */ NULL,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ 0, /* deformVertsEM */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ applyModifier, /* applyModifier */ applyModifier,
/* applyModifierEM */ applyModifierEM, /* applyModifierEM */ applyModifierEM,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ 0, /* requiredDataMask */ NULL,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ 0, /* isDisabled */ NULL,
/* updateDepgraph */ 0, /* updateDepgraph */ NULL,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ 0, /* foreachObjectLink */ NULL,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -62,7 +62,7 @@ static void initData(ModifierData *md)
{ {
ExplodeModifierData *emd= (ExplodeModifierData*) md; ExplodeModifierData *emd= (ExplodeModifierData*) md;
emd->facepa=0; emd->facepa= NULL;
emd->flag |= eExplodeFlag_Unborn+eExplodeFlag_Alive+eExplodeFlag_Dead; emd->flag |= eExplodeFlag_Unborn+eExplodeFlag_Alive+eExplodeFlag_Dead;
} }
static void freeData(ModifierData *md) static void freeData(ModifierData *md)
@@ -76,7 +76,7 @@ static void copyData(ModifierData *md, ModifierData *target)
ExplodeModifierData *emd= (ExplodeModifierData*) md; ExplodeModifierData *emd= (ExplodeModifierData*) md;
ExplodeModifierData *temd= (ExplodeModifierData*) target; ExplodeModifierData *temd= (ExplodeModifierData*) target;
temd->facepa = 0; temd->facepa = NULL;
temd->flag = emd->flag; temd->flag = emd->flag;
temd->protect = emd->protect; temd->protect = emd->protect;
temd->vgroup = emd->vgroup; temd->vgroup = emd->vgroup;
@@ -101,12 +101,12 @@ static void createFacepa(ExplodeModifierData *emd,
DerivedMesh *dm) DerivedMesh *dm)
{ {
ParticleSystem *psys=psmd->psys; ParticleSystem *psys=psmd->psys;
MFace *fa=0, *mface=0; MFace *fa=NULL, *mface=NULL;
MVert *mvert = 0; MVert *mvert = NULL;
ParticleData *pa; ParticleData *pa;
KDTree *tree; KDTree *tree;
float center[3], co[3]; float center[3], co[3];
int *facepa=0,*vertpa=0,totvert=0,totface=0,totpart=0; int *facepa=NULL,*vertpa=NULL,totvert=0,totface=0,totpart=0;
int i,p,v1,v2,v3,v4=0; int i,p,v1,v2,v3,v4=0;
mvert = dm->getVertArray(dm); mvert = dm->getVertArray(dm);
@@ -148,7 +148,7 @@ static void createFacepa(ExplodeModifierData *emd,
/* make tree of emitter locations */ /* make tree of emitter locations */
tree=BLI_kdtree_new(totpart); tree=BLI_kdtree_new(totpart);
for(p=0,pa=psys->particles; p<totpart; p++,pa++){ for(p=0,pa=psys->particles; p<totpart; p++,pa++){
psys_particle_on_dm(psmd->dm,psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co,0,0,0,0,0); psys_particle_on_dm(psmd->dm,psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co,NULL,NULL,NULL,NULL,NULL);
BLI_kdtree_insert(tree, p, co, NULL); BLI_kdtree_insert(tree, p, co, NULL);
} }
BLI_kdtree_balance(tree); BLI_kdtree_balance(tree);
@@ -776,14 +776,14 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
DerivedMesh *to_explode) DerivedMesh *to_explode)
{ {
DerivedMesh *explode, *dm=to_explode; DerivedMesh *explode, *dm=to_explode;
MFace *mf=0, *mface; MFace *mf= NULL, *mface;
ParticleSettings *part=psmd->psys->part; ParticleSettings *part=psmd->psys->part;
ParticleSimulationData sim= {0}; ParticleSimulationData sim= {NULL};
ParticleData *pa=NULL, *pars=psmd->psys->particles; ParticleData *pa=NULL, *pars=psmd->psys->particles;
ParticleKey state; ParticleKey state;
EdgeHash *vertpahash; EdgeHash *vertpahash;
EdgeHashIterator *ehi; EdgeHashIterator *ehi;
float *vertco=0, imat[4][4]; float *vertco= NULL, imat[4][4];
float loc0[3], nor[3]; float loc0[3], nor[3];
float cfra; float cfra;
/* float timestep; */ /* float timestep; */
@@ -870,7 +870,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
pa= pars+i; pa= pars+i;
/* get particle state */ /* get particle state */
psys_particle_on_emitter(psmd,part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,loc0,nor,0,0,0,0); psys_particle_on_emitter(psmd,part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,loc0,nor,NULL,NULL,NULL,NULL);
mul_m4_v3(ob->obmat,loc0); mul_m4_v3(ob->obmat,loc0);
state.time=cfra; state.time=cfra;
@@ -960,7 +960,7 @@ static DerivedMesh * explodeMesh(ExplodeModifierData *emd,
static ParticleSystemModifierData * findPrecedingParticlesystem(Object *ob, ModifierData *emd) static ParticleSystemModifierData * findPrecedingParticlesystem(Object *ob, ModifierData *emd)
{ {
ModifierData *md; ModifierData *md;
ParticleSystemModifierData *psmd=0; ParticleSystemModifierData *psmd= NULL;
for (md=ob->modifiers.first; emd!=md; md=md->next){ for (md=ob->modifiers.first; emd!=md; md=md->next){
if(md->type==eModifierType_ParticleSystem) if(md->type==eModifierType_ParticleSystem)
@@ -980,12 +980,12 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
if(psmd){ if(psmd){
ParticleSystem * psys=psmd->psys; ParticleSystem * psys=psmd->psys;
if(psys==0 || psys->totpart==0) return derivedData; if(psys==NULL || psys->totpart==0) return derivedData;
if(psys->part==0 || psys->particles==0) return derivedData; if(psys->part==NULL || psys->particles==NULL) return derivedData;
if(psmd->dm==0) return derivedData; if(psmd->dm==NULL) return derivedData;
/* 1. find faces to be exploded if needed */ /* 1. find faces to be exploded if needed */
if(emd->facepa==0 if(emd->facepa == NULL
|| psmd->flag&eParticleSystemFlag_Pars || psmd->flag&eParticleSystemFlag_Pars
|| emd->flag&eExplodeFlag_CalcFaces || emd->flag&eExplodeFlag_CalcFaces
|| MEM_allocN_len(emd->facepa)/sizeof(int) != dm->getNumFaces(dm)) || MEM_allocN_len(emd->facepa)/sizeof(int) != dm->getNumFaces(dm))
@@ -1023,19 +1023,19 @@ ModifierTypeInfo modifierType_Explode = {
/* type */ eModifierTypeType_Nonconstructive, /* type */ eModifierTypeType_Nonconstructive,
/* flags */ eModifierTypeFlag_AcceptsMesh, /* flags */ eModifierTypeFlag_AcceptsMesh,
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ 0, /* deformVerts */ NULL,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ 0, /* deformVertsEM */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ applyModifier, /* applyModifier */ applyModifier,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ requiredDataMask, /* requiredDataMask */ requiredDataMask,
/* freeData */ freeData, /* freeData */ freeData,
/* isDisabled */ 0, /* isDisabled */ NULL,
/* updateDepgraph */ 0, /* updateDepgraph */ NULL,
/* dependsOnTime */ dependsOnTime, /* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ 0, /* foreachObjectLink */ NULL,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -147,19 +147,19 @@ ModifierTypeInfo modifierType_Fluidsim = {
| eModifierTypeFlag_Single, | eModifierTypeFlag_Single,
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ 0, /* deformVerts */ NULL,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ 0, /* deformVertsEM */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ applyModifier, /* applyModifier */ applyModifier,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ 0, /* requiredDataMask */ NULL,
/* freeData */ freeData, /* freeData */ freeData,
/* isDisabled */ 0, /* isDisabled */ NULL,
/* updateDepgraph */ updateDepgraph, /* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ dependsOnTime, /* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ 0, /* foreachObjectLink */ NULL,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -289,18 +289,18 @@ ModifierTypeInfo modifierType_Hook = {
| eModifierTypeFlag_SupportsEditmode, | eModifierTypeFlag_SupportsEditmode,
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ deformVerts, /* deformVerts */ deformVerts,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ deformVertsEM, /* deformVertsEM */ deformVertsEM,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ 0, /* applyModifier */ NULL,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ requiredDataMask, /* requiredDataMask */ requiredDataMask,
/* freeData */ freeData, /* freeData */ freeData,
/* isDisabled */ isDisabled, /* isDisabled */ isDisabled,
/* updateDepgraph */ updateDepgraph, /* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ foreachObjectLink, /* foreachObjectLink */ foreachObjectLink,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -142,18 +142,18 @@ ModifierTypeInfo modifierType_Lattice = {
| eModifierTypeFlag_SupportsEditmode, | eModifierTypeFlag_SupportsEditmode,
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ deformVerts, /* deformVerts */ deformVerts,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ deformVertsEM, /* deformVertsEM */ deformVertsEM,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ 0, /* applyModifier */ NULL,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ 0, /* initData */ NULL,
/* requiredDataMask */ requiredDataMask, /* requiredDataMask */ requiredDataMask,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ isDisabled, /* isDisabled */ isDisabled,
/* updateDepgraph */ updateDepgraph, /* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ foreachObjectLink, /* foreachObjectLink */ foreachObjectLink,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -404,19 +404,19 @@ ModifierTypeInfo modifierType_Mask = {
/* flags */ eModifierTypeFlag_AcceptsMesh|eModifierTypeFlag_SupportsMapping|eModifierTypeFlag_SupportsEditmode, /* flags */ eModifierTypeFlag_AcceptsMesh|eModifierTypeFlag_SupportsMapping|eModifierTypeFlag_SupportsEditmode,
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ 0, /* deformVerts */ NULL,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ 0, /* deformVertsEM */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ applyModifier, /* applyModifier */ applyModifier,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ 0, /* initData */ NULL,
/* requiredDataMask */ requiredDataMask, /* requiredDataMask */ requiredDataMask,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ 0, /* isDisabled */ NULL,
/* updateDepgraph */ updateDepgraph, /* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ foreachObjectLink, /* foreachObjectLink */ foreachObjectLink,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -450,18 +450,18 @@ ModifierTypeInfo modifierType_MeshDeform = {
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ deformVerts, /* deformVerts */ deformVerts,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ deformVertsEM, /* deformVertsEM */ deformVertsEM,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ 0, /* applyModifier */ NULL,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ requiredDataMask, /* requiredDataMask */ requiredDataMask,
/* freeData */ freeData, /* freeData */ freeData,
/* isDisabled */ isDisabled, /* isDisabled */ isDisabled,
/* updateDepgraph */ updateDepgraph, /* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ foreachObjectLink, /* foreachObjectLink */ foreachObjectLink,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -348,19 +348,19 @@ ModifierTypeInfo modifierType_Mirror = {
| eModifierTypeFlag_AcceptsCVs, | eModifierTypeFlag_AcceptsCVs,
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ 0, /* deformVerts */ NULL,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ 0, /* deformVertsEM */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ applyModifier, /* applyModifier */ applyModifier,
/* applyModifierEM */ applyModifierEM, /* applyModifierEM */ applyModifierEM,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ 0, /* requiredDataMask */ NULL,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ 0, /* isDisabled */ NULL,
/* updateDepgraph */ updateDepgraph, /* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ foreachObjectLink, /* foreachObjectLink */ foreachObjectLink,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -115,19 +115,19 @@ ModifierTypeInfo modifierType_Multires = {
| eModifierTypeFlag_RequiresOriginalData, | eModifierTypeFlag_RequiresOriginalData,
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ 0, /* deformVerts */ NULL,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ 0, /* deformVertsEM */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ applyModifier, /* applyModifier */ applyModifier,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ 0, /* requiredDataMask */ NULL,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ 0, /* isDisabled */ NULL,
/* updateDepgraph */ 0, /* updateDepgraph */ NULL,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ 0, /* foreachObjectLink */ NULL,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -38,8 +38,7 @@
* \ingroup modifiers * \ingroup modifiers
*/ */
#include <stdio.h>
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
@@ -62,20 +61,20 @@ ModifierTypeInfo modifierType_None = {
/* flags */ eModifierTypeFlag_AcceptsMesh /* flags */ eModifierTypeFlag_AcceptsMesh
| eModifierTypeFlag_AcceptsCVs, | eModifierTypeFlag_AcceptsCVs,
/* copyData */ 0, /* copyData */ NULL,
/* deformVerts */ 0, /* deformVerts */ NULL,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ 0, /* deformVertsEM */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ 0, /* applyModifier */ NULL,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ 0, /* initData */ NULL,
/* requiredDataMask */ 0, /* requiredDataMask */ NULL,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ isDisabled, /* isDisabled */ isDisabled,
/* updateDepgraph */ 0, /* updateDepgraph */ NULL,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ 0, /* foreachObjectLink */ NULL,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -115,8 +115,8 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
DerivedMesh *dm = derivedData, *result; DerivedMesh *dm = derivedData, *result;
ParticleInstanceModifierData *pimd= (ParticleInstanceModifierData*) md; ParticleInstanceModifierData *pimd= (ParticleInstanceModifierData*) md;
ParticleSimulationData sim; ParticleSimulationData sim;
ParticleSystem * psys=0; ParticleSystem *psys= NULL;
ParticleData *pa=0, *pars=0; ParticleData *pa= NULL, *pars= NULL;
MFace *mface, *orig_mface; MFace *mface, *orig_mface;
MVert *mvert, *orig_mvert; MVert *mvert, *orig_mvert;
int i,totvert, totpart=0, totface, maxvert, maxface, first_particle=0; int i,totvert, totpart=0, totface, maxvert, maxface, first_particle=0;
@@ -127,13 +127,13 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
trackneg=((ob->trackflag>2)?1:0); trackneg=((ob->trackflag>2)?1:0);
if(pimd->ob==ob){ if(pimd->ob==ob){
pimd->ob=0; pimd->ob= NULL;
return derivedData; return derivedData;
} }
if(pimd->ob){ if(pimd->ob){
psys = BLI_findlink(&pimd->ob->particlesystem,pimd->psys-1); psys = BLI_findlink(&pimd->ob->particlesystem,pimd->psys-1);
if(psys==0 || psys->totpart==0) if(psys==NULL || psys->totpart==0)
return derivedData; return derivedData;
} }
else return derivedData; else return derivedData;
@@ -274,7 +274,7 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
if(psys->part->childtype==PART_CHILD_PARTICLES) if(psys->part->childtype==PART_CHILD_PARTICLES)
pa=psys->particles+(psys->child+i/totface-psys->totpart)->parent; pa=psys->particles+(psys->child+i/totface-psys->totpart)->parent;
else else
pa=0; pa= NULL;
} }
else else
pa=pars+i/totface; pa=pars+i/totface;
@@ -283,7 +283,7 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
if(psys->part->childtype==PART_CHILD_PARTICLES) if(psys->part->childtype==PART_CHILD_PARTICLES)
pa=psys->particles+(psys->child+i/totface)->parent; pa=psys->particles+(psys->child+i/totface)->parent;
else else
pa=0; pa= NULL;
} }
if(pa){ if(pa){
@@ -335,19 +335,19 @@ ModifierTypeInfo modifierType_ParticleInstance = {
| eModifierTypeFlag_EnableInEditmode, | eModifierTypeFlag_EnableInEditmode,
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ 0, /* deformVerts */ NULL,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ 0, /* deformVertsEM */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ applyModifier, /* applyModifier */ applyModifier,
/* applyModifierEM */ applyModifierEM, /* applyModifierEM */ applyModifierEM,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ 0, /* requiredDataMask */ NULL,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ 0, /* isDisabled */ NULL,
/* updateDepgraph */ updateDepgraph, /* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ dependsOnTime, /* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ foreachObjectLink, /* foreachObjectLink */ foreachObjectLink,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -53,8 +53,8 @@
static void initData(ModifierData *md) static void initData(ModifierData *md)
{ {
ParticleSystemModifierData *psmd= (ParticleSystemModifierData*) md; ParticleSystemModifierData *psmd= (ParticleSystemModifierData*) md;
psmd->psys= 0; psmd->psys= NULL;
psmd->dm=0; psmd->dm= NULL;
psmd->totdmvert= psmd->totdmedge= psmd->totdmface= 0; psmd->totdmvert= psmd->totdmedge= psmd->totdmface= 0;
} }
static void freeData(ModifierData *md) static void freeData(ModifierData *md)
@@ -64,7 +64,7 @@ static void freeData(ModifierData *md)
if(psmd->dm){ if(psmd->dm){
psmd->dm->needsFree = 1; psmd->dm->needsFree = 1;
psmd->dm->release(psmd->dm); psmd->dm->release(psmd->dm);
psmd->dm=0; psmd->dm = NULL;
} }
/* ED_object_modifier_remove may have freed this first before calling /* ED_object_modifier_remove may have freed this first before calling
@@ -77,7 +77,7 @@ static void copyData(ModifierData *md, ModifierData *target)
ParticleSystemModifierData *psmd= (ParticleSystemModifierData*) md; ParticleSystemModifierData *psmd= (ParticleSystemModifierData*) md;
ParticleSystemModifierData *tpsmd= (ParticleSystemModifierData*) target; ParticleSystemModifierData *tpsmd= (ParticleSystemModifierData*) target;
tpsmd->dm = 0; tpsmd->dm = NULL;
tpsmd->totdmvert = tpsmd->totdmedge = tpsmd->totdmface = 0; tpsmd->totdmvert = tpsmd->totdmedge = tpsmd->totdmface = 0;
//tpsmd->facepa = 0; //tpsmd->facepa = 0;
tpsmd->flag = psmd->flag; tpsmd->flag = psmd->flag;
@@ -131,7 +131,7 @@ static void deformVerts(ModifierData *md, Object *ob,
{ {
DerivedMesh *dm = derivedData; DerivedMesh *dm = derivedData;
ParticleSystemModifierData *psmd= (ParticleSystemModifierData*) md; ParticleSystemModifierData *psmd= (ParticleSystemModifierData*) md;
ParticleSystem * psys=0; ParticleSystem * psys= NULL;
int needsFree=0; int needsFree=0;
if(ob->particlesystem.first) if(ob->particlesystem.first)
@@ -142,7 +142,7 @@ static void deformVerts(ModifierData *md, Object *ob,
if(!psys_check_enabled(ob, psys)) if(!psys_check_enabled(ob, psys))
return; return;
if(dm==0) { if(dm==NULL) {
dm= get_dm(ob, NULL, NULL, vertexCos, 1); dm= get_dm(ob, NULL, NULL, vertexCos, 1);
if(!dm) if(!dm)
@@ -228,18 +228,18 @@ ModifierTypeInfo modifierType_ParticleSystem = {
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ deformVerts, /* deformVerts */ deformVerts,
/* deformVertsEM */ 0 /* deformVertsEM */ , /* deformVertsEM */ NULL /* deformVertsEM */ ,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ 0, /* applyModifier */ NULL,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ requiredDataMask, /* requiredDataMask */ requiredDataMask,
/* freeData */ freeData, /* freeData */ freeData,
/* isDisabled */ 0, /* isDisabled */ NULL,
/* updateDepgraph */ 0, /* updateDepgraph */ NULL,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ 0, /* foreachObjectLink */ NULL,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -888,19 +888,19 @@ ModifierTypeInfo modifierType_Screw = {
| eModifierTypeFlag_EnableInEditmode, | eModifierTypeFlag_EnableInEditmode,
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ 0, /* deformVerts */ NULL,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ 0, /* deformVertsEM */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ applyModifier, /* applyModifier */ applyModifier,
/* applyModifierEM */ applyModifierEM, /* applyModifierEM */ applyModifierEM,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ 0, /* requiredDataMask */ NULL,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ 0, /* isDisabled */ NULL,
/* updateDepgraph */ updateDepgraph, /* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ dependsOnTime, /* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ foreachObjectLink, /* foreachObjectLink */ foreachObjectLink,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -172,18 +172,18 @@ ModifierTypeInfo modifierType_Shrinkwrap = {
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ deformVerts, /* deformVerts */ deformVerts,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ deformVertsEM, /* deformVertsEM */ deformVertsEM,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ 0, /* applyModifier */ NULL,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ requiredDataMask, /* requiredDataMask */ requiredDataMask,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ isDisabled, /* isDisabled */ isDisabled,
/* updateDepgraph */ updateDepgraph, /* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ foreachObjectLink, /* foreachObjectLink */ foreachObjectLink,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -381,18 +381,18 @@ ModifierTypeInfo modifierType_SimpleDeform = {
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ deformVerts, /* deformVerts */ deformVerts,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ deformVertsEM, /* deformVertsEM */ deformVertsEM,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ 0, /* applyModifier */ NULL,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ requiredDataMask, /* requiredDataMask */ requiredDataMask,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ 0, /* isDisabled */ NULL,
/* updateDepgraph */ updateDepgraph, /* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ foreachObjectLink, /* foreachObjectLink */ foreachObjectLink,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -159,18 +159,18 @@ ModifierTypeInfo modifierType_Smoke = {
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ deformVerts, /* deformVerts */ deformVerts,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ 0, /* deformVertsEM */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ 0, /* applyModifier */ NULL,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ 0, /* requiredDataMask */ NULL,
/* freeData */ freeData, /* freeData */ freeData,
/* isDisabled */ 0, /* isDisabled */ NULL,
/* updateDepgraph */ updateDepgraph, /* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ dependsOnTime, /* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ 0, /* foreachObjectLink */ NULL,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -261,18 +261,18 @@ ModifierTypeInfo modifierType_Smooth = {
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ deformVerts, /* deformVerts */ deformVerts,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ deformVertsEM, /* deformVertsEM */ deformVertsEM,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ 0, /* applyModifier */ NULL,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ requiredDataMask, /* requiredDataMask */ requiredDataMask,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ isDisabled, /* isDisabled */ isDisabled,
/* updateDepgraph */ 0, /* updateDepgraph */ NULL,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ 0, /* foreachObjectLink */ NULL,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -34,12 +34,12 @@
* \ingroup modifiers * \ingroup modifiers
*/ */
#include <stdio.h>
#include "DNA_scene_types.h" #include "DNA_scene_types.h"
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BKE_cdderivedmesh.h" #include "BKE_cdderivedmesh.h"
#include "BKE_particle.h" #include "BKE_particle.h"
#include "BKE_softbody.h" #include "BKE_softbody.h"
@@ -71,20 +71,20 @@ ModifierTypeInfo modifierType_Softbody = {
| eModifierTypeFlag_RequiresOriginalData | eModifierTypeFlag_RequiresOriginalData
| eModifierTypeFlag_Single, | eModifierTypeFlag_Single,
/* copyData */ 0, /* copyData */ NULL,
/* deformVerts */ deformVerts, /* deformVerts */ deformVerts,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ 0, /* deformVertsEM */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ 0, /* applyModifier */ NULL,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ 0, /* initData */ NULL,
/* requiredDataMask */ 0, /* requiredDataMask */ NULL,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ 0, /* isDisabled */ NULL,
/* updateDepgraph */ 0, /* updateDepgraph */ NULL,
/* dependsOnTime */ dependsOnTime, /* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ 0, /* foreachObjectLink */ NULL,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -137,19 +137,19 @@ ModifierTypeInfo modifierType_Subsurf = {
| eModifierTypeFlag_AcceptsCVs, | eModifierTypeFlag_AcceptsCVs,
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ 0, /* deformVerts */ NULL,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ 0, /* deformVertsEM */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ applyModifier, /* applyModifier */ applyModifier,
/* applyModifierEM */ applyModifierEM, /* applyModifierEM */ applyModifierEM,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ 0, /* requiredDataMask */ NULL,
/* freeData */ freeData, /* freeData */ freeData,
/* isDisabled */ isDisabled, /* isDisabled */ isDisabled,
/* updateDepgraph */ 0, /* updateDepgraph */ NULL,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ 0, /* foreachObjectLink */ NULL,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -176,20 +176,20 @@ ModifierTypeInfo modifierType_Surface = {
/* flags */ eModifierTypeFlag_AcceptsMesh /* flags */ eModifierTypeFlag_AcceptsMesh
| eModifierTypeFlag_NoUserAdd, | eModifierTypeFlag_NoUserAdd,
/* copyData */ 0, /* copyData */ NULL,
/* deformVerts */ deformVerts, /* deformVerts */ deformVerts,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ 0, /* deformVertsEM */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ 0, /* applyModifier */ NULL,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ 0, /* requiredDataMask */ NULL,
/* freeData */ freeData, /* freeData */ freeData,
/* isDisabled */ 0, /* isDisabled */ NULL,
/* updateDepgraph */ 0, /* updateDepgraph */ NULL,
/* dependsOnTime */ dependsOnTime, /* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ 0, /* foreachObjectLink */ NULL,
/* foreachIDLink */ 0, /* foreachIDLink */ NULL,
}; };

View File

@@ -417,19 +417,19 @@ ModifierTypeInfo modifierType_UVProject = {
| eModifierTypeFlag_EnableInEditmode, | eModifierTypeFlag_EnableInEditmode,
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ 0, /* deformVerts */ NULL,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ 0, /* deformVertsEM */ NULL,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ applyModifier, /* applyModifier */ applyModifier,
/* applyModifierEM */ applyModifierEM, /* applyModifierEM */ applyModifierEM,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ requiredDataMask, /* requiredDataMask */ requiredDataMask,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ 0, /* isDisabled */ NULL,
/* updateDepgraph */ updateDepgraph, /* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ 0, /* dependsOnTime */ NULL,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ foreachObjectLink, /* foreachObjectLink */ foreachObjectLink,
/* foreachIDLink */ foreachIDLink, /* foreachIDLink */ foreachIDLink,
}; };

View File

@@ -457,18 +457,18 @@ ModifierTypeInfo modifierType_Wave = {
| eModifierTypeFlag_SupportsEditmode, | eModifierTypeFlag_SupportsEditmode,
/* copyData */ copyData, /* copyData */ copyData,
/* deformVerts */ deformVerts, /* deformVerts */ deformVerts,
/* deformMatrices */ 0, /* deformMatrices */ NULL,
/* deformVertsEM */ deformVertsEM, /* deformVertsEM */ deformVertsEM,
/* deformMatricesEM */ 0, /* deformMatricesEM */ NULL,
/* applyModifier */ 0, /* applyModifier */ NULL,
/* applyModifierEM */ 0, /* applyModifierEM */ NULL,
/* initData */ initData, /* initData */ initData,
/* requiredDataMask */ requiredDataMask, /* requiredDataMask */ requiredDataMask,
/* freeData */ 0, /* freeData */ NULL,
/* isDisabled */ 0, /* isDisabled */ NULL,
/* updateDepgraph */ updateDepgraph, /* updateDepgraph */ updateDepgraph,
/* dependsOnTime */ dependsOnTime, /* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ 0, /* dependsOnNormals */ NULL,
/* foreachObjectLink */ foreachObjectLink, /* foreachObjectLink */ foreachObjectLink,
/* foreachIDLink */ foreachIDLink, /* foreachIDLink */ foreachIDLink,
}; };

View File

@@ -71,7 +71,7 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(o
if(in[1] && in[1]->hasinput) if(in[1] && in[1]->hasinput)
tex_input_vec(target->nor, in[1], &params, cdata->thread); tex_input_vec(target->nor, in[1], &params, cdata->thread);
else else
target->nor = 0; target->nor = NULL;
} }
} }
} }
@@ -80,7 +80,7 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **UNUSED(o
static void unique_name(bNode *node) static void unique_name(bNode *node)
{ {
TexNodeOutput *tno = (TexNodeOutput *)node->storage; TexNodeOutput *tno = (TexNodeOutput *)node->storage;
char *new_name = 0; char *new_name = NULL;
int new_len = 0; int new_len = 0;
int suffix; int suffix;
bNode *i; bNode *i;