diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-13 13:52:18 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-13 13:52:18 +0300 |
commit | 0955c664aa7c5fc5f0bd345c58219c40f04ab9c1 (patch) | |
tree | 20b6a2ab2e1130d75d119eba09f3b195a33a9434 /source/blender/blenkernel | |
parent | f3bd89b1b7a86778ff4c633a6b4115309a1b3c7e (diff) |
fix for warnings from Sparse static source code checker, mostly BKE/BLI and python functions.
- use NULL rather then 0 where possible (makes code & function calls more readable IMHO).
- set static variables and functions (exposed some unused vars/funcs).
- use func(void) rather then func() for definitions.
Diffstat (limited to 'source/blender/blenkernel')
56 files changed, 441 insertions, 434 deletions
diff --git a/source/blender/blenkernel/BKE_key.h b/source/blender/blenkernel/BKE_key.h index 416b89ef36e..d72dce3bf7c 100644 --- a/source/blender/blenkernel/BKE_key.h +++ b/source/blender/blenkernel/BKE_key.h @@ -79,9 +79,11 @@ float (*key_to_vertcos(struct Object *ob, struct KeyBlock *kb))[3]; void vertcos_to_key(struct Object *ob, struct KeyBlock *kb, float (*vertCos)[3]); void offset_to_key(struct Object *ob, struct KeyBlock *kb, float (*ofs)[3]); +/* key.c */ +extern int slurph_opt; + #ifdef __cplusplus }; #endif -#endif - +#endif // BKE_KEY_H diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c index 35ba8caedb0..8c265a1f8c9 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf.c +++ b/source/blender/blenkernel/intern/CCGSubSurf.c @@ -397,7 +397,7 @@ static CCGEdge *_vert_findEdgeTo(CCGVert *v, CCGVert *vQ) { (e->v1==v && e->v0==vQ)) return e; } - return 0; + return NULL; } static int _vert_isBoundary(CCGVert *v) { int i; @@ -599,7 +599,7 @@ static CCG_INLINE void *_face_getIFCoEdge(CCGFace *f, CCGEdge *e, int lvl, int e static float *_face_getIFNoEdge(CCGFace *f, CCGEdge *e, int lvl, int eX, int eY, int levels, int dataSize, int normalDataOffset) { return (float*) ((byte*) _face_getIFCoEdge(f, e, lvl, eX, eY, levels, dataSize) + normalDataOffset); } -void _face_calcIFNo(CCGFace *f, int lvl, int S, int x, int y, float *no, int levels, int dataSize) { +static void _face_calcIFNo(CCGFace *f, int lvl, int S, int x, int y, float *no, int levels, int dataSize) { float *a = _face_getIFCo(f, lvl, S, x+0, y+0, levels, dataSize); float *b = _face_getIFCo(f, lvl, S, x+1, y+0, levels, dataSize); float *c = _face_getIFCo(f, lvl, S, x+1, y+1, levels, dataSize); diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 3bfdbdc4fc9..328f2ccdc75 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -93,11 +93,11 @@ void make_local_action(bAction *act) bAction *actn; int local=0, lib=0; - if (act->id.lib==0) return; + if (act->id.lib==NULL) return; if (act->id.us==1) { - act->id.lib= 0; + act->id.lib= NULL; act->id.flag= LIB_LOCAL; - new_id(0, (ID *)act, 0); + new_id(NULL, (ID *)act, NULL); return; } @@ -113,10 +113,10 @@ void make_local_action(bAction *act) #endif if(local && lib==0) { - act->id.lib= 0; + act->id.lib= NULL; act->id.flag= LIB_LOCAL; //make_local_action_channels(act); - new_id(0, (ID *)act, 0); + new_id(NULL, (ID *)act, NULL); } else if(local && lib) { actn= copy_action(act); @@ -1144,7 +1144,7 @@ void what_does_obaction (Scene *UNUSED(scene), Object *ob, Object *workob, bPose animsys_evaluate_action_group(&id_ptr, act, agrp, NULL, cframe); } else { - AnimData adt= {0}; + AnimData adt= {NULL}; /* init animdata, and attach to workob */ workob->adt= &adt; diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 2c52e0b0c49..8fdfca33efb 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -64,6 +64,7 @@ #include "BKE_scene.h" #include "BKE_utildefines.h" #include "BKE_depsgraph.h" +#include "BKE_anim.h" // XXX bad level call... @@ -1159,12 +1160,12 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, float par_space_mat[][4], ParticleSystem *psys, int level, int animated) { GroupObject *go; - Object *ob=0, **oblist=0, obcopy, *obcopylist=0; + Object *ob=NULL, **oblist=NULL, obcopy, *obcopylist=NULL; DupliObject *dob; ParticleDupliWeight *dw; ParticleSettings *part; ParticleData *pa; - ChildParticle *cpa=0; + ChildParticle *cpa=NULL; ParticleKey state; ParticleCacheKey *cache; float ctime, pa_time, scale = 1.0f; @@ -1175,14 +1176,14 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p int no_draw_flag = PARS_UNEXIST; - if(psys==0) return; + if(psys==NULL) return; /* simple preventing of too deep nested groups */ if(level>MAX_DUPLI_RECUR) return; part=psys->part; - if(part==0) + if(part==NULL) return; if(!psys_check_enabled(par, psys)) @@ -1199,7 +1200,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p BLI_srandom(31415926 + psys->seed); if((psys->renderdata || part->draw_as==PART_DRAW_REND) && ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) { - ParticleSimulationData sim= {0}; + ParticleSimulationData sim= {NULL}; sim.scene= scene; sim.ob= par; sim.psys= psys; @@ -1298,7 +1299,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p pa_num = a; pa_time = psys->particles[cpa->parent].time; - size = psys_get_child_size(psys, cpa, ctime, 0); + size = psys_get_child_size(psys, cpa, ctime, NULL); } /* some hair paths might be non-existent so they can't be used for duplication */ @@ -1329,11 +1330,11 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p /* hair we handle separate and compute transform based on hair keys */ if(a < totpart) { cache = psys->pathcache[a]; - psys_get_dupli_path_transform(&sim, pa, 0, cache, pamat, &scale); + psys_get_dupli_path_transform(&sim, pa, NULL, cache, pamat, &scale); } else { cache = psys->childcache[a-totpart]; - psys_get_dupli_path_transform(&sim, 0, cpa, cache, pamat, &scale); + psys_get_dupli_path_transform(&sim, NULL, cpa, cache, pamat, &scale); } VECCOPY(pamat[3], cache->co); @@ -1449,7 +1450,7 @@ static Object *find_family_object(Object **obar, char *family, char ch) static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int level, int animated) { - Object *ob, *obar[256]= {0}; + Object *ob, *obar[256]= {NULL}; Curve *cu; struct chartrans *ct, *chartransdata; float vec[3], obmat[4][4], pmat[4][4], fsize, xof, yof; @@ -1463,7 +1464,7 @@ static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int level, i /* in par the family name is stored, use this to find the other objects */ chartransdata= BKE_text_to_curve(scene, par, FO_DUPLI); - if(chartransdata==0) return; + if(chartransdata==NULL) return; cu= par->data; slen= strlen(cu->str); diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index e46c1179111..499a1ac6ed8 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -809,7 +809,7 @@ KS_Path *BKE_keyingset_find_path (KeyingSet *ks, ID *id, const char group_name[] eq_id= 0; /* path */ - if ((ksp->rna_path==0) || strcmp(rna_path, ksp->rna_path)) + if ((ksp->rna_path==NULL) || strcmp(rna_path, ksp->rna_path)) eq_path= 0; /* index - need to compare whole-array setting too... */ @@ -1856,7 +1856,7 @@ static void animsys_evaluate_nla (PointerRNA *ptr, AnimData *adt, float ctime) /* if there are strips, evaluate action as per NLA rules */ if ((has_strips) || (adt->actstrip)) { /* make dummy NLA strip, and add that to the stack */ - NlaStrip dummy_strip= {0}; + NlaStrip dummy_strip= {NULL}; ListBase dummy_trackslist; dummy_trackslist.first= dummy_trackslist.last= &dummy_strip; @@ -1915,11 +1915,13 @@ static void animsys_evaluate_nla (PointerRNA *ptr, AnimData *adt, float ctime) /* Clear all overides */ /* Add or get existing Override for given setting */ +#if 0 AnimOverride *BKE_animsys_validate_override (PointerRNA *UNUSED(ptr), char *UNUSED(path), int UNUSED(array_index)) { // FIXME: need to define how to get overrides return NULL; } +#endif /* -------------------- */ diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index e23fe357141..cc01438fd5d 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -136,19 +136,19 @@ void make_local_armature(bArmature *arm) Object *ob; bArmature *newArm; - if (arm->id.lib==0) + if (arm->id.lib==NULL) return; if (arm->id.us==1) { - arm->id.lib= 0; + arm->id.lib= NULL; arm->id.flag= LIB_LOCAL; - new_id(0, (ID*)arm, 0); + new_id(NULL, (ID*)arm, NULL); return; } if(local && lib==0) { - arm->id.lib= 0; + arm->id.lib= NULL; arm->id.flag= LIB_LOCAL; - new_id(0, (ID *)arm, 0); + new_id(NULL, (ID *)arm, NULL); } else if(local && lib) { newArm= copy_armature(arm); @@ -158,7 +158,7 @@ void make_local_armature(bArmature *arm) while(ob) { if(ob->data==arm) { - if(ob->id.lib==0) { + if(ob->id.lib==NULL) { ob->data= newArm; newArm->id.us++; arm->id.us--; diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 828f7ca0fa3..e34b4bef8d4 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -88,10 +88,10 @@ Global G; UserDef U; -ListBase WMlist= {NULL, NULL}; +/* ListBase = {NULL, NULL}; */ short ENDIAN_ORDER; -char versionstr[48]= ""; +static char versionstr[48]= ""; /* ********** free ********** */ @@ -350,7 +350,7 @@ int BKE_read_file(bContext *C, const char *dir, ReportList *reports) BlendFileData *bfd; int retval= 1; - if(strstr(dir, BLENDER_STARTUP_FILE)==0) /* dont print user-pref loading */ + if(strstr(dir, BLENDER_STARTUP_FILE)==NULL) /* dont print user-pref loading */ printf("read blend: %s\n", dir); bfd= BLO_read_from_file(dir, reports); diff --git a/source/blender/blenkernel/intern/bmfont.c b/source/blender/blenkernel/intern/bmfont.c index e2a6c04450b..aa0669903c5 100644 --- a/source/blender/blenkernel/intern/bmfont.c +++ b/source/blender/blenkernel/intern/bmfont.c @@ -54,6 +54,7 @@ #include "BKE_global.h" #include "IMB_imbuf_types.h" +#include "BKE_bmfont.h" #include "BKE_bmfont_types.h" void printfGlyph(bmGlyph * glyph) diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index b1931ebe0a7..4ad3b8bb3cf 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -186,13 +186,13 @@ void make_local_brush(Brush *brush) Scene *scene; int local= 0, lib= 0; - if(brush->id.lib==0) return; + if(brush->id.lib==NULL) return; if(brush->clone.image) { /* special case: ima always local immediately */ - brush->clone.image->id.lib= 0; + brush->clone.image->id.lib= NULL; brush->clone.image->id.flag= LIB_LOCAL; - new_id(0, (ID *)brush->clone.image, 0); + new_id(NULL, (ID *)brush->clone.image, NULL); } for(scene= G.main->scene.first; scene; scene=scene->id.next) @@ -202,9 +202,9 @@ void make_local_brush(Brush *brush) } if(local && lib==0) { - brush->id.lib= 0; + brush->id.lib= NULL; brush->id.flag= LIB_LOCAL; - new_id(0, (ID *)brush, 0); + new_id(NULL, (ID *)brush, NULL); /* enable fake user by default */ if (!(brush->id.flag & LIB_FAKEUSER)) { @@ -219,7 +219,7 @@ void make_local_brush(Brush *brush) for(scene= G.main->scene.first; scene; scene=scene->id.next) if(paint_brush(&scene->toolsettings->imapaint.paint)==brush) - if(scene->id.lib==0) { + if(scene->id.lib==NULL) { paint_brush_set(&scene->toolsettings->imapaint.paint, brushn); brushn->id.us++; brush->id.us--; @@ -227,10 +227,10 @@ void make_local_brush(Brush *brush) } } -void brush_debug_print_state(Brush *br) +static void brush_debug_print_state(Brush *br) { /* create a fake brush and set it to the defaults */ - Brush def= {{0}}; + Brush def= {{NULL}}; brush_set_defaults(&def); #define BR_TEST(field, t) \ @@ -424,7 +424,7 @@ int brush_texture_set_nr(Brush *brush, int nr) id= (ID *)brush->mtex.tex; idtest= (ID*)BLI_findlink(&G.main->tex, nr-1); - if(idtest==0) { /* new tex */ + if(idtest==NULL) { /* new tex */ if(id) idtest= (ID *)copy_texture((Tex *)id); else idtest= (ID *)add_texture("Tex"); idtest->us--; diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 0006e5bfa38..abf2257877b 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -729,7 +729,7 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm, GPU_vertex_setup( dm ); GPU_normal_setup( dm ); GPU_uv_setup( dm ); - if( col != 0 ) { + if( col != NULL ) { /*if( realcol && dm->drawObject->colType == CD_TEXTURE_MCOL ) { col = 0; } else if( mcol && dm->drawObject->colType == CD_MCOL ) { @@ -983,7 +983,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo glShadeModel(GL_SMOOTH); - if( GPU_buffer_legacy(dm) || setDrawOptions != 0 ) { + if( GPU_buffer_legacy(dm) || setDrawOptions != NULL ) { DEBUG_VBO( "Using legacy code. cdDM_drawMappedFacesGLSL\n" ); memset(&attribs, 0, sizeof(attribs)); @@ -1086,8 +1086,8 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo glEnd(); } else { - GPUBuffer *buffer = 0; - char *varray = 0; + GPUBuffer *buffer = NULL; + char *varray = NULL; int numdata = 0, elementsize = 0, offset; int start = 0, numfaces = 0, prevdraw = 0, curface = 0; int i; @@ -1124,9 +1124,9 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo if( numdata != 0 ) { - GPU_buffer_free(buffer,0); + GPU_buffer_free(buffer, NULL); - buffer = 0; + buffer = NULL; } } @@ -1164,16 +1164,16 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo } if( numdata != 0 ) { elementsize = GPU_attrib_element_size( datatypes, numdata ); - buffer = GPU_buffer_alloc( elementsize*dm->drawObject->nelements, 0 ); - if( buffer == 0 ) { + buffer = GPU_buffer_alloc( elementsize*dm->drawObject->nelements, NULL ); + if( buffer == NULL ) { GPU_buffer_unbind(); dm->drawObject->legacy = 1; return; } varray = GPU_buffer_lock_stream(buffer); - if( varray == 0 ) { + if( varray == NULL ) { GPU_buffer_unbind(); - GPU_buffer_free(buffer, 0); + GPU_buffer_free(buffer, NULL); dm->drawObject->legacy = 1; return; } @@ -1312,7 +1312,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo } GPU_buffer_unbind(); } - GPU_buffer_free( buffer, 0 ); + GPU_buffer_free( buffer, NULL ); } glShadeModel(GL_FLAT); diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 8cdfd60b9a7..02b3de83ee1 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -164,8 +164,8 @@ Collision modifier code end */ #define mySWAP(a,b) do { double tmp = b ; b = a ; a = tmp ; } while(0) - -int +#if 0 /* UNUSED */ +static int gsl_poly_solve_cubic (double a, double b, double c, double *x0, double *x1, double *x2) { @@ -255,7 +255,7 @@ gsl_poly_solve_cubic (double a, double b, double c, * * copied from GSL */ -int +static int gsl_poly_solve_quadratic (double a, double b, double c, double *x0, double *x1) { @@ -313,7 +313,7 @@ gsl_poly_solve_quadratic (double a, double b, double c, return 0; } } - +#endif /* UNUSED */ diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 086cd237be8..b3f83019ff1 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -3469,7 +3469,7 @@ static void shrinkwrap_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstr BVHTreeRayHit hit; BVHTreeNearest nearest; - BVHTreeFromMesh treeData= {0}; + BVHTreeFromMesh treeData= {NULL}; nearest.index = -1; nearest.dist = FLT_MAX; diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index 09321ddea81..58a7944f78b 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -85,7 +85,7 @@ struct bContext { /* context */ -bContext *CTX_create() +bContext *CTX_create(void) { bContext *C; @@ -788,7 +788,7 @@ static const char *data_mode_strings[] = { "texturepaint", "particlemode", "objectmode", - 0 + NULL }; const char *CTX_data_mode_string(const bContext *C) { diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 2678b077b66..5dc62f2c7af 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -174,7 +174,7 @@ Curve *copy_curve(Curve *cu) int a; cun= copy_libblock(cu); - cun->nurb.first= cun->nurb.last= 0; + cun->nurb.first= cun->nurb.last= NULL; duplicateNurblist( &(cun->nurb), &(cu->nurb)); cun->mat= MEM_dupallocN(cu->mat); @@ -190,9 +190,9 @@ Curve *copy_curve(Curve *cu) cun->key= copy_key(cu->key); if(cun->key) cun->key->from= (ID *)cun; - cun->disp.first= cun->disp.last= 0; - cun->bev.first= cun->bev.last= 0; - cun->path= 0; + cun->disp.first= cun->disp.last= NULL; + cun->bev.first= cun->bev.last= NULL; + cun->path= NULL; cun->editnurb= NULL; cun->editfont= NULL; @@ -212,7 +212,7 @@ Curve *copy_curve(Curve *cu) void make_local_curve(Curve *cu) { - Object *ob = 0; + Object *ob = NULL; Curve *cun; int local=0, lib=0; @@ -221,7 +221,7 @@ void make_local_curve(Curve *cu) * - mixed: do a copy */ - if(cu->id.lib==0) return; + if(cu->id.lib==NULL) return; if(cu->vfont) cu->vfont->id.lib= NULL; if(cu->vfontb) cu->vfontb->id.lib= NULL; @@ -229,9 +229,9 @@ void make_local_curve(Curve *cu) if(cu->vfontbi) cu->vfontbi->id.lib= NULL; if(cu->id.us==1) { - cu->id.lib= 0; + cu->id.lib= NULL; cu->id.flag= LIB_LOCAL; - new_id(0, (ID *)cu, 0); + new_id(NULL, (ID *)cu, NULL); return; } @@ -245,9 +245,9 @@ void make_local_curve(Curve *cu) } if(local && lib==0) { - cu->id.lib= 0; + cu->id.lib= NULL; cu->id.flag= LIB_LOCAL; - new_id(0, (ID *)cu, 0); + new_id(NULL, (ID *)cu, NULL); } else if(local && lib) { cun= copy_curve(cu); @@ -257,7 +257,7 @@ void make_local_curve(Curve *cu) while(ob) { if(ob->data==cu) { - if(ob->id.lib==0) { + if(ob->id.lib==NULL) { ob->data= cun; cun->id.us++; cu->id.us--; @@ -381,12 +381,12 @@ int count_curveverts_without_handles(ListBase *nurb) void freeNurb(Nurb *nu) { - if(nu==0) return; + if(nu==NULL) return; if(nu->bezt) MEM_freeN(nu->bezt); - nu->bezt= 0; + nu->bezt= NULL; if(nu->bp) MEM_freeN(nu->bp); - nu->bp= 0; + nu->bp= NULL; if(nu->knotsu) MEM_freeN(nu->knotsu); nu->knotsu= NULL; if(nu->knotsv) MEM_freeN(nu->knotsv); @@ -402,7 +402,7 @@ void freeNurblist(ListBase *lb) { Nurb *nu, *next; - if(lb==0) return; + if(lb==NULL) return; nu= lb->first; while(nu) { @@ -410,7 +410,7 @@ void freeNurblist(ListBase *lb) freeNurb(nu); nu= next; } - lb->first= lb->last= 0; + lb->first= lb->last= NULL; } Nurb *duplicateNurb(Nurb *nu) @@ -419,7 +419,7 @@ Nurb *duplicateNurb(Nurb *nu) int len; newnu= (Nurb*)MEM_mallocN(sizeof(Nurb),"duplicateNurb"); - if(newnu==0) return 0; + if(newnu==NULL) return NULL; memcpy(newnu, nu, sizeof(Nurb)); if(nu->bezt) { @@ -615,7 +615,7 @@ static void makecyclicknots(float *knots, short pnts, short order) { int a, b, order2, c; - if(knots==0) return; + if(knots==NULL) return; order2=order-1; @@ -918,7 +918,7 @@ void makeNurbcurve(Nurb *nu, float *coord_array, float *tilt_array, float *radiu if(nu->knotsu==NULL) return; if(nu->orderu>nu->pntsu) return; - if(coord_array==0) return; + if(coord_array==NULL) return; /* allocate and initialize */ len= nu->pntsu; @@ -1269,7 +1269,7 @@ void makebevelcurve(Scene *scene, Object *ob, ListBase *disp, int forRender) dl= bevdisp.first; } else { dl= cu->bevobj->disp.first; - if(dl==0) { + if(dl==NULL) { makeDispListCurveTypes(scene, cu->bevobj, 0); dl= cu->bevobj->disp.first; } @@ -1811,8 +1811,6 @@ static void make_bevel_list_3D_minimum_twist(BevList *bl) int nr; float q[4]; - float cross_tmp[3]; - bevel_list_calc_bisect(bl); bevp2= (BevPoint *)(bl+1); @@ -1829,6 +1827,7 @@ static void make_bevel_list_3D_minimum_twist(BevList *bl) float angle= angle_normalized_v3v3(bevp0->dir, bevp1->dir); if(angle > 0.0f) { /* otherwise we can keep as is */ + float cross_tmp[3]; cross_v3_v3v3(cross_tmp, bevp0->dir, bevp1->dir); axis_angle_to_quat(q, cross_tmp, angle); mul_qt_qtqt(bevp1->quat, q, bevp0->quat); @@ -2426,7 +2425,7 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode) p2= bezt->vec[1]; - if(prev==0) { + if(prev==NULL) { p3= next->vec[1]; pt[0]= 2*p2[0]- p3[0]; pt[1]= 2*p2[1]- p3[1]; @@ -2435,7 +2434,7 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode) } else p1= prev->vec[1]; - if(next==0) { + if(next==NULL) { pt[0]= 2*p2[0]- p1[0]; pt[1]= 2*p2[1]- p1[1]; pt[2]= 2*p2[2]- p1[2]; @@ -2616,7 +2615,7 @@ void calchandlesNurb(Nurb *nu) /* first, if needed, set handle flags */ a= nu->pntsu; bezt= nu->bezt; if(nu->flagu & CU_NURB_CYCLIC) prev= bezt+(a-1); - else prev= 0; + else prev= NULL; next= bezt+1; while(a--) { @@ -2624,7 +2623,7 @@ void calchandlesNurb(Nurb *nu) /* first, if needed, set handle flags */ prev= bezt; if(a==1) { if(nu->flagu & CU_NURB_CYCLIC) next= nu->bezt; - else next= 0; + else next= NULL; } else next++; @@ -2683,7 +2682,7 @@ void autocalchandlesNurb(Nurb *nu, int flag) BezTriple *bezt2, *bezt1, *bezt0; int i, align, leftsmall, rightsmall; - if(nu==0 || nu->bezt==0) return; + if(nu==NULL || nu->bezt==NULL) return; bezt2 = nu->bezt; bezt1 = bezt2 + (nu->pntsu-1); diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 0ed479b899a..7788f9f28a2 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -469,19 +469,19 @@ static void layerInterp_mdisps(void **sources, float *UNUSED(weights), vindex[x] = y; for(i = 0; i < 2; i++) { - float sw[4][4] = {{0}}; + float sw_m4[4][4] = {{0}}; int a = 7 & ~(1 << vindex[i*2] | 1 << vindex[i*2+1]); - sw[0][vindex[i*2+1]] = 1; - sw[1][vindex[i*2]] = 1; + sw_m4[0][vindex[i*2+1]] = 1; + sw_m4[1][vindex[i*2]] = 1; for(x = 0; x < 3; x++) if(a & (1 << x)) - sw[2][x] = 1; + sw_m4[2][x] = 1; tris[i] = *((MDisps*)sources[i]); tris[i].disps = MEM_dupallocN(tris[i].disps); - layerInterp_mdisps(&sources[i], NULL, (float*)sw, 1, &tris[i]); + layerInterp_mdisps(&sources[i], NULL, (float*)sw_m4, 1, &tris[i]); } mdisp_join_tris(d, &tris[0], &tris[1]); @@ -803,7 +803,7 @@ static void layerDefault_mcol(void *data, int count) -const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = { +static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = { {sizeof(MVert), "MVert", 1, NULL, NULL, NULL, NULL, NULL, NULL}, {sizeof(MSticky), "MSticky", 1, NULL, NULL, NULL, layerInterp_msticky, NULL, NULL}, @@ -842,7 +842,7 @@ const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = { {sizeof(float)*3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL} }; -const char *LAYERTYPENAMES[CD_NUMTYPES] = { +static const char *LAYERTYPENAMES[CD_NUMTYPES] = { /* 0-4 */ "CDMVert", "CDMSticky", "CDMDeformVert", "CDMEdge", "CDMFace", /* 5-9 */ "CDMTFace", "CDMCol", "CDOrigIndex", "CDNormal", "CDFlags", /* 10-14 */ "CDMFloatProperty", "CDMIntProperty","CDMStringProperty", "CDOrigSpace", "CDOrco", diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c index b90ded5c78d..7f51cfdc8b6 100644 --- a/source/blender/blenkernel/intern/deform.c +++ b/source/blender/blenkernel/intern/deform.c @@ -50,7 +50,7 @@ void defgroup_copy_list (ListBase *outbase, ListBase *inbase) { bDeformGroup *defgroup, *defgroupn; - outbase->first= outbase->last= 0; + outbase->first= outbase->last= NULL; for (defgroup = inbase->first; defgroup; defgroup=defgroup->next){ defgroupn= defgroup_duplicate(defgroup); diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 07a47f84af5..d102a83d69f 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -278,7 +278,7 @@ int queue_count(struct DagNodeQueue *queue){ } -DagForest * dag_init() +DagForest *dag_init(void) { DagForest *forest; /* use callocN to init all zero */ diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 3bb62f817cd..837c3bd8356 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -121,7 +121,7 @@ DispList *find_displist(ListBase *lb, int type) dl= dl->next; } - return 0; + return NULL; } int displist_has_faces(ListBase *lb) @@ -930,13 +930,13 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal) { EditVert *eve, *v1, *vlast; EditFace *efa; - DispList *dlnew=0, *dl; + DispList *dlnew=NULL, *dl; float *f1; int colnr=0, charidx=0, cont=1, tot, a, *index, nextcol= 0; intptr_t totvert; - if(dispbase==0) return; - if(dispbase->first==0) return; + if(dispbase==NULL) return; + if(dispbase->first==NULL) return; while(cont) { cont= 0; @@ -953,7 +953,7 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal) /* make editverts and edges */ f1= dl->verts; a= dl->nr; - eve= v1= 0; + eve= v1= NULL; while(a--) { vlast= eve; @@ -961,14 +961,14 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal) eve= BLI_addfillvert(f1); totvert++; - if(vlast==0) v1= eve; + if(vlast==NULL) v1= eve; else { BLI_addfilledge(vlast, eve); } f1+=3; } - if(eve!=0 && v1!=0) { + if(eve!=NULL && v1!=NULL) { BLI_addfilledge(eve, v1); } } else if (colnr<dl->col) { @@ -1058,7 +1058,7 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase) float *fp, *fp1; int a, dpoly; - front.first= front.last= back.first= back.last= 0; + front.first= front.last= back.first= back.last= NULL; dl= dispbase->first; while(dl) { @@ -1944,7 +1944,7 @@ void imagestodisplist(void) /* this is confusing, there's also min_max_object, appplying the obmat... */ static void boundbox_displist(Object *ob) { - BoundBox *bb=0; + BoundBox *bb=NULL; float min[3], max[3]; DispList *dl; float *vert; @@ -1956,7 +1956,7 @@ static void boundbox_displist(Object *ob) Curve *cu= ob->data; int doit= 0; - if(cu->bb==0) cu->bb= MEM_callocN(sizeof(BoundBox), "boundbox"); + if(cu->bb==NULL) cu->bb= MEM_callocN(sizeof(BoundBox), "boundbox"); bb= cu->bb; dl= ob->disp.first; diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 43ca7435712..ddfc58b7491 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -166,7 +166,7 @@ PartEff *give_parteff(Object *ob) if(paf->type==EFF_PARTICLE) return paf; paf= paf->next; } - return 0; + return NULL; } void free_effect(Effect *eff) @@ -636,7 +636,7 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin if(eff->psys == point->psys && *efd->index == point->index) ; else { - ParticleSimulationData sim= {0}; + ParticleSimulationData sim= {NULL}; sim.scene= eff->scene; sim.ob= eff->ob; sim.psys= eff->psys; @@ -781,7 +781,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP if(!eff->pd->tex) return; - result[0].nor = result[1].nor = result[2].nor = result[3].nor = 0; + result[0].nor = result[1].nor = result[2].nor = result[3].nor = NULL; strength= eff->pd->f_strength * efd->falloff; @@ -845,7 +845,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP add_v3_v3(total_force, force); } -void do_physical_effector(EffectorCache *eff, EffectorData *efd, EffectedPoint *point, float *total_force) +static void do_physical_effector(EffectorCache *eff, EffectorData *efd, EffectedPoint *point, float *total_force) { PartDeflect *pd = eff->pd; RNG *rng = pd->rng; diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c index 469fc39be10..e7596001400 100644 --- a/source/blender/blenkernel/intern/exotic.c +++ b/source/blender/blenkernel/intern/exotic.c @@ -513,9 +513,6 @@ int BKE_read_exotic(Scene *scene, const char *name) /* ************************ WRITE ************************** */ - -char temp_dir[160]= {0, 0}; - static void write_vert_stl(Object *ob, MVert *verts, int index, FILE *fpSTL) { float vert[3]; @@ -588,7 +585,6 @@ void write_stl(Scene *scene, char *str) BKE_reportf(reports, RPT_ERROR, "Can't open file: %s.", strerror(errno)); return; } - strcpy(temp_dir, str); //XXX waitcursor(1); @@ -874,7 +870,6 @@ void write_dxf(struct Scene *scene, char *str) //XXX error("Can't write file"); return; } - strcpy(temp_dir, str); //XXX waitcursor(1); @@ -1134,7 +1129,7 @@ static void dxf_add_mat (Object *ob, Mesh *me, float color[3], char *layer) ma= G.main->mat.first; while(ma) { - if(ma->mtex[0]==0) { + if(ma->mtex[0]==NULL) { if(color[0]==ma->r && color[1]==ma->g && color[2]==ma->b) { me->mat[0]= ma; ma->id.us++; @@ -1143,7 +1138,7 @@ static void dxf_add_mat (Object *ob, Mesh *me, float color[3], char *layer) } ma= ma->id.next; } - if(ma==0) { + if(ma==NULL) { ma= add_material("ext"); me->mat[0]= ma; ma->r= color[0]; diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index ef1ac582c1e..fc5aecb5def 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -1202,7 +1202,7 @@ static float dvar_eval_transChan (ChannelDriver *driver, DriverVar *dvar) /* ......... */ /* Table of Driver Varaiable Type Info Data */ -DriverVarTypeInfo dvar_types[MAX_DVAR_TYPES] = { +static DriverVarTypeInfo dvar_types[MAX_DVAR_TYPES] = { BEGIN_DVAR_TYPEDEF(DVAR_TYPE_SINGLE_PROP) dvar_eval_singleProp, /* eval callback */ 1, /* number of targets used */ @@ -1233,7 +1233,7 @@ DriverVarTypeInfo dvar_types[MAX_DVAR_TYPES] = { }; /* Get driver variable typeinfo */ -DriverVarTypeInfo *get_dvar_typeinfo (int type) +static DriverVarTypeInfo *get_dvar_typeinfo (int type) { /* check if valid type */ if ((type >= 0) && (type < MAX_DVAR_TYPES)) diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 9de8af2c981..bf0427e4fee 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -208,7 +208,7 @@ int utf8towchar(wchar_t *w, char *c) /* The vfont code */ void free_vfont(struct VFont *vf) { - if (vf == 0) return; + if (vf == NULL) return; if (vf->data) { while(vf->data->characters.first) @@ -476,7 +476,7 @@ static void build_underline(Curve *cu, float x1, float y1, float x2, float y2, i nu2->flagu = CU_NURB_CYCLIC; bp = (BPoint*)MEM_callocN(4 * sizeof(BPoint),"underline_bp"); - if (bp == 0){ + if (bp == NULL){ MEM_freeN(nu2); return; } @@ -544,10 +544,10 @@ static void buildchar(Curve *cu, unsigned long character, CharInfo *info, float bezt1 = nu1->bezt; if (bezt1){ nu2 =(Nurb*) MEM_mallocN(sizeof(Nurb),"duplichar_nurb"); - if (nu2 == 0) break; + if (nu2 == NULL) break; memcpy(nu2, nu1, sizeof(struct Nurb)); nu2->resolu= cu->resolu; - nu2->bp = 0; + nu2->bp = NULL; nu2->knotsu = nu2->knotsv = NULL; nu2->flag= CU_SMOOTH; nu2->charidx = charidx; @@ -562,7 +562,7 @@ static void buildchar(Curve *cu, unsigned long character, CharInfo *info, float i = nu2->pntsu; bezt2 = (BezTriple*)MEM_mallocN(i * sizeof(BezTriple),"duplichar_bezt2"); - if (bezt2 == 0){ + if (bezt2 == NULL){ MEM_freeN(nu2); break; } @@ -686,14 +686,14 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) /* renark: do calculations including the trailing '\0' of a string because the cursor can be at that location */ - if(ob->type!=OB_FONT) return 0; + if(ob->type!=OB_FONT) return NULL; // Set font data cu= (Curve *) ob->data; vfont= cu->vfont; - if(cu->str == NULL) return 0; - if(vfont == NULL) return 0; + if(cu->str == NULL) return NULL; + if(vfont == NULL) return NULL; // Create unicode string utf8len = utf8slen(cu->str); @@ -723,7 +723,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) if(!vfd) { if(mem) MEM_freeN(mem); - return 0; + return NULL; } /* calc offset and rotation of each char */ @@ -787,11 +787,11 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) che= find_vfont_char(vfd, ascii); /* No VFont found */ - if (vfont==0) { + if (vfont==NULL) { if(mem) MEM_freeN(mem); MEM_freeN(chartransdata); - return 0; + return NULL; } if (vfont != oldvfont) { @@ -804,7 +804,7 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) if(mem) MEM_freeN(mem); MEM_freeN(chartransdata); - return 0; + return NULL; } twidth = char_width(cu, che, info); @@ -1219,7 +1219,5 @@ struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) MEM_freeN(mem); MEM_freeN(chartransdata); - return 0; + return NULL; } - - diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c index 1df272fad30..b575305171a 100644 --- a/source/blender/blenkernel/intern/icons.c +++ b/source/blender/blenkernel/intern/icons.c @@ -106,14 +106,14 @@ void BKE_icons_init(int first_dyn_id) gIcons = BLI_ghash_new(BLI_ghashutil_inthash, BLI_ghashutil_intcmp, "icons_init gh"); } -void BKE_icons_free() +void BKE_icons_free(void) { if(gIcons) - BLI_ghash_free(gIcons, 0, icon_free); + BLI_ghash_free(gIcons, NULL, icon_free); gIcons = NULL; } -struct PreviewImage* BKE_previewimg_create() +struct PreviewImage* BKE_previewimg_create(void) { PreviewImage* prv_img = NULL; int i; @@ -219,7 +219,7 @@ PreviewImage* BKE_previewimg_get(ID *id) void BKE_icon_changed(int id) { - Icon* icon = 0; + Icon* icon = NULL; if (!id || G.background) return; @@ -242,7 +242,7 @@ void BKE_icon_changed(int id) int BKE_icon_getid(struct ID* id) { - Icon* new_icon = 0; + Icon* new_icon = NULL; if (!id || G.background) return 0; @@ -263,8 +263,8 @@ int BKE_icon_getid(struct ID* id) new_icon->type = GS(id->name); /* next two lines make sure image gets created */ - new_icon->drawinfo = 0; - new_icon->drawinfo_free = 0; + new_icon->drawinfo = NULL; + new_icon->drawinfo_free = NULL; BLI_ghash_insert(gIcons, SET_INT_IN_POINTER(id->icon_id), new_icon); @@ -273,13 +273,13 @@ int BKE_icon_getid(struct ID* id) Icon* BKE_icon_get(int icon_id) { - Icon* icon = 0; + Icon* icon = NULL; icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(icon_id)); if (!icon) { printf("BKE_icon_get: Internal error, no icon for icon ID: %d\n", icon_id); - return 0; + return NULL; } return icon; @@ -287,7 +287,7 @@ Icon* BKE_icon_get(int icon_id) void BKE_icon_set(int icon_id, struct Icon* icon) { - Icon* old_icon = 0; + Icon* old_icon = NULL; old_icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(icon_id)); @@ -305,6 +305,6 @@ void BKE_icon_delete(struct ID* id) if (!id->icon_id) return; /* no icon defined for library object */ - BLI_ghash_remove(gIcons, SET_INT_IN_POINTER(id->icon_id), 0, icon_free); + BLI_ghash_remove(gIcons, SET_INT_IN_POINTER(id->icon_id), NULL, icon_free); id->icon_id = 0; } diff --git a/source/blender/blenkernel/intern/idcode.c b/source/blender/blenkernel/intern/idcode.c index 359603e9a50..17f7dd06e29 100644 --- a/source/blender/blenkernel/intern/idcode.c +++ b/source/blender/blenkernel/intern/idcode.c @@ -33,6 +33,8 @@ #include "DNA_ID.h" +#include "BKE_idcode.h" + typedef struct { unsigned short code; const char *name, *plural; diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index f8025d38f74..97fbcce1aec 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -266,7 +266,7 @@ void IDP_FreeArray(IDProperty *prop) return newp; } -IDProperty *IDP_CopyArray(IDProperty *prop) +static IDProperty *IDP_CopyArray(IDProperty *prop) { IDProperty *newp = idp_generic_copy(prop); @@ -328,7 +328,7 @@ IDProperty *IDP_NewString(const char *st, const char *name, int maxlen) return prop; } -IDProperty *IDP_CopyString(IDProperty *prop) +static IDProperty *IDP_CopyString(IDProperty *prop) { IDProperty *newp = idp_generic_copy(prop); @@ -402,7 +402,7 @@ void IDP_UnlinkID(IDProperty *prop) /*-------- Group Functions -------*/ /*checks if a property with the same name as prop exists, and if so replaces it.*/ -IDProperty *IDP_CopyGroup(IDProperty *prop) +static IDProperty *IDP_CopyGroup(IDProperty *prop) { IDProperty *newp = idp_generic_copy(prop), *link; newp->len = prop->len; diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 4092abb07d4..64327b2005d 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -100,7 +100,7 @@ static void de_interlace_ng(struct ImBuf *ibuf) /* neogeo fields */ { struct ImBuf * tbuf1, * tbuf2; - if (ibuf == 0) return; + if (ibuf == NULL) return; if (ibuf->flags & IB_fields) return; ibuf->flags |= IB_fields; @@ -128,7 +128,7 @@ static void de_interlace_st(struct ImBuf *ibuf) /* standard fields */ { struct ImBuf * tbuf1, * tbuf2; - if (ibuf == 0) return; + if (ibuf == NULL) return; if (ibuf->flags & IB_fields) return; ibuf->flags |= IB_fields; @@ -514,7 +514,7 @@ static void tag_all_images_time() } #endif -void free_old_images() +void free_old_images(void) { Image *ima; static int lasttime = 0; @@ -1359,7 +1359,7 @@ struct anim *openanim(char *name, int flags) struct ImBuf *ibuf; anim = IMB_open_anim(name, flags); - if (anim == NULL) return(0); + if (anim == NULL) return NULL; ibuf = IMB_anim_absolute(anim, 0); if (ibuf == NULL) { @@ -1368,7 +1368,7 @@ struct anim *openanim(char *name, int flags) else printf("anim file doesn't exist: %s\n", name); IMB_free_anim(anim); - return(0); + return NULL; } IMB_freeImBuf(ibuf); diff --git a/source/blender/blenkernel/intern/image_gen.c b/source/blender/blenkernel/intern/image_gen.c index a2d41920217..c21e347d6d8 100644 --- a/source/blender/blenkernel/intern/image_gen.c +++ b/source/blender/blenkernel/intern/image_gen.c @@ -25,6 +25,8 @@ #include <math.h> #include <stdlib.h> + +#include "BKE_image.h" #include "BLI_math_color.h" #include "BLF_api.h" diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 41639a619b3..329058b3115 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -62,7 +62,7 @@ #include "BLI_utildefines.h" - +#include "BKE_ipo.h" #include "BKE_animsys.h" #include "BKE_action.h" #include "BKE_fcurve.h" diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index a3c8ea0c194..3681dc910cd 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -150,7 +150,7 @@ Key *copy_key(Key *key) Key *keyn; KeyBlock *kbn, *kb; - if(key==0) return 0; + if(key==NULL) return NULL; keyn= copy_libblock(key); @@ -177,10 +177,10 @@ void make_local_key(Key *key) * - only local users: set flag * - mixed: make copy */ - if(key==0) return; + if(key==NULL) return; - key->id.lib= 0; - new_id(0, (ID *)key, 0); + key->id.lib= NULL; + new_id(NULL, (ID *)key, NULL); } /* Sort shape keys and Ipo curves after a change. This assumes that at most @@ -365,14 +365,14 @@ static int setkeys(float fac, ListBase *lb, KeyBlock *k[], float *t, int cycl) /* if(fac<0.0 || fac>1.0) return 1; */ - if(k1->next==0) return 1; + if(k1->next==NULL) return 1; if(cycl) { /* pre-sort */ k[2]= k1->next; k[3]= k[2]->next; - if(k[3]==0) k[3]=k1; + if(k[3]==NULL) k[3]=k1; while(k1) { - if(k1->next==0) k[0]=k1; + if(k1->next==NULL) k[0]=k1; k1=k1->next; } k1= k[1]; @@ -393,13 +393,13 @@ static int setkeys(float fac, ListBase *lb, KeyBlock *k[], float *t, int cycl) k[2]= k1->next; t[2]= k[2]->pos; k[3]= k[2]->next; - if(k[3]==0) k[3]= k[2]; + if(k[3]==NULL) k[3]= k[2]; t[3]= k[3]->pos; k1= k[3]; } while( t[2]<fac ) { /* find correct location */ - if(k1->next==0) { + if(k1->next==NULL) { if(cycl) { k1= firstkey; ofs+= dpos; @@ -1081,7 +1081,7 @@ static void do_mesh_key(Scene *scene, Object *ob, Key *key, char *out, const int for(a=0; a<tot; a+=step, cfra+= delta) { - ctime= bsystem_time(scene, 0, cfra, 0.0); // xxx ugly cruft! + ctime= bsystem_time(scene, NULL, cfra, 0.0); // xxx ugly cruft! #if 0 // XXX old animation system if(calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) { ctime /= 100.0; @@ -1213,7 +1213,7 @@ static void do_curve_key(Scene *scene, Object *ob, Key *key, char *out, const in while (a < estep) { if (remain <= 0) { cfra+= delta; - ctime= bsystem_time(scene, 0, cfra, 0.0f); // XXX old cruft + ctime= bsystem_time(scene, NULL, cfra, 0.0f); // XXX old cruft ctime /= 100.0f; CLAMP(ctime, 0.0f, 1.0f); // XXX for compat, we use this, but this clamping was confusing @@ -1276,7 +1276,7 @@ static void do_latt_key(Scene *scene, Object *ob, Key *key, char *out, const int for(a=0; a<tot; a++, cfra+= delta) { - ctime= bsystem_time(scene, 0, cfra, 0.0); // XXX old cruft + ctime= bsystem_time(scene, NULL, cfra, 0.0); // XXX old cruft #if 0 // XXX old animation system if(calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) { ctime /= 100.0; diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index be3ec62374f..bd7fdfebe97 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -251,11 +251,11 @@ void make_local_lattice(Lattice *lt) * - mixed: make copy */ - if(lt->id.lib==0) return; + if(lt->id.lib==NULL) return; if(lt->id.us==1) { - lt->id.lib= 0; + lt->id.lib= NULL; lt->id.flag= LIB_LOCAL; - new_id(0, (ID *)lt, 0); + new_id(NULL, (ID *)lt, NULL); return; } @@ -269,9 +269,9 @@ void make_local_lattice(Lattice *lt) } if(local && lib==0) { - lt->id.lib= 0; + lt->id.lib= NULL; lt->id.flag= LIB_LOCAL; - new_id(0, (ID *)lt, 0); + new_id(NULL, (ID *)lt, NULL); } else if(local && lib) { ltn= copy_lattice(lt); @@ -281,7 +281,7 @@ void make_local_lattice(Lattice *lt) while(ob) { if(ob->data==lt) { - if(ob->id.lib==0) { + if(ob->id.lib==NULL) { ob->data= ltn; ltn->id.us++; lt->id.us--; diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 671f4d91922..99fcd3f4a50 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -419,7 +419,7 @@ ListBase *which_libbase(Main *mainlib, short type) case ID_GD: return &(mainlib->gpencil); } - return 0; + return NULL; } /* Flag all ids in listbase */ @@ -688,7 +688,7 @@ void set_free_windowmanager_cb(void (*func)(bContext *C, wmWindowManager *) ) free_windowmanager_cb= func; } -void animdata_dtar_clear_cb(ID *UNUSED(id), AnimData *adt, void *userdata) +static void animdata_dtar_clear_cb(ID *UNUSED(id), AnimData *adt, void *userdata) { ChannelDriver *driver; FCurve *fcu; @@ -1007,7 +1007,7 @@ static void sort_alpha_id(ListBase *lb, ID *id) idtest= idtest->next; } /* as last */ - if(idtest==0) { + if(idtest==NULL) { BLI_addtail(lb, id); } } @@ -1189,7 +1189,7 @@ int new_id(ListBase *lb, ID *id, const char *tname) } /* next to indirect usage in read/writefile also in editobject.c scene.c */ -void clear_id_newpoins() +void clear_id_newpoins(void) { ListBase *lbarray[MAX_LIBARRAY]; ID *id; @@ -1199,7 +1199,7 @@ void clear_id_newpoins() while(a--) { id= lbarray[a]->first; while(id) { - id->newid= 0; + id->newid= NULL; id->flag &= ~LIB_NEW; id= id->next; } @@ -1293,7 +1293,7 @@ void tag_main(struct Main *mainvar, const short tag) /* if lib!=NULL, only all from lib local */ void all_local(Library *lib, int untagged_only) { - ListBase *lbarray[MAX_LIBARRAY], tempbase={0, 0}; + ListBase *lbarray[MAX_LIBARRAY], tempbase={NULL, NULL}; ID *id, *idn; int a; @@ -1322,7 +1322,7 @@ void all_local(Library *lib, int untagged_only) image_fix_relative_path((Image *)id); id->lib= NULL; - new_id(lbarray[a], id, 0); /* new_id only does it with double names */ + new_id(lbarray[a], id, NULL); /* new_id only does it with double names */ sort_alpha_id(lbarray[a], id); } } @@ -1334,7 +1334,7 @@ void all_local(Library *lib, int untagged_only) while( (id=tempbase.first) ) { BLI_remlink(&tempbase, id); BLI_addtail(lbarray[a], id); - new_id(lbarray[a], id, 0); + new_id(lbarray[a], id, NULL); } } @@ -1355,7 +1355,7 @@ void test_idbutton(char *name) lb= which_libbase(G.main, GS(name-2) ); - if(lb==0) return; + if(lb==NULL) return; /* search for id */ idtest= BLI_findstring(lb, name, offsetof(ID, name) + 2); diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 152323dfb4d..954de9c86e2 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -278,11 +278,11 @@ void make_local_material(Material *ma) * - mixed: make copy */ - if(ma->id.lib==0) return; + if(ma->id.lib==NULL) return; if(ma->id.us==1) { - ma->id.lib= 0; + ma->id.lib= NULL; ma->id.flag= LIB_LOCAL; - new_id(0, (ID *)ma, 0); + new_id(NULL, (ID *)ma, NULL); for(a=0; a<MAX_MTEX; a++) { if(ma->mtex[a]) id_lib_extern((ID *)ma->mtex[a]->tex); } @@ -344,14 +344,14 @@ void make_local_material(Material *ma) } if(local && lib==0) { - ma->id.lib= 0; + ma->id.lib= NULL; ma->id.flag= LIB_LOCAL; for(a=0; a<MAX_MTEX; a++) { if(ma->mtex[a]) id_lib_extern((ID *)ma->mtex[a]->tex); } - new_id(0, (ID *)ma, 0); + new_id(NULL, (ID *)ma, NULL); } else if(local && lib) { @@ -364,7 +364,7 @@ void make_local_material(Material *ma) if(ob->mat) { for(a=0; a<ob->totcol; a++) { if(ob->mat[a]==ma) { - if(ob->id.lib==0) { + if(ob->id.lib==NULL) { ob->mat[a]= man; man->id.us++; ma->id.us--; @@ -380,7 +380,7 @@ void make_local_material(Material *ma) if(me->mat) { for(a=0; a<me->totcol; a++) { if(me->mat[a]==ma) { - if(me->id.lib==0) { + if(me->id.lib==NULL) { me->mat[a]= man; man->id.us++; ma->id.us--; @@ -396,7 +396,7 @@ void make_local_material(Material *ma) if(cu->mat) { for(a=0; a<cu->totcol; a++) { if(cu->mat[a]==ma) { - if(cu->id.lib==0) { + if(cu->id.lib==NULL) { cu->mat[a]= man; man->id.us++; ma->id.us--; @@ -412,7 +412,7 @@ void make_local_material(Material *ma) if(mb->mat) { for(a=0; a<mb->totcol; a++) { if(mb->mat[a]==ma) { - if(mb->id.lib==0) { + if(mb->id.lib==NULL) { mb->mat[a]= man; man->id.us++; ma->id.us--; @@ -583,7 +583,7 @@ Material *give_current_material(Object *ob, int act) matarar= give_matarar(ob); if(matarar && *matarar) ma= (*matarar)[act-1]; - else ma= 0; + else ma= NULL; } @@ -593,7 +593,7 @@ Material *give_current_material(Object *ob, int act) ID *material_from(Object *ob, int act) { - if(ob==0) return 0; + if(ob==NULL) return NULL; if(ob->totcol==0) return ob->data; if(act==0) act= 1; @@ -688,7 +688,7 @@ void assign_material(Object *ob, Material *ma, int act) totcolp= give_totcolp(ob); matarar= give_matarar(ob); - if(totcolp==0 || matarar==0) return; + if(totcolp==NULL || matarar==NULL) return; if(act > *totcolp) { matar= MEM_callocN(sizeof(void *)*act, "matarray1"); @@ -782,7 +782,7 @@ int object_add_material_slot(Object *ob) { Material *ma; - if(ob==0) return FALSE; + if(ob==NULL) return FALSE; if(ob->totcol>=MAXMAT) return FALSE; ma= give_current_material(ob, ob->actcol); @@ -964,7 +964,7 @@ int material_in_material(Material *parmat, Material *mat) /* ****************** */ -char colname_array[125][20]= { +static char colname_array[125][20]= { "Black","DarkRed","HalfRed","Red","Red", "DarkGreen","DarkOlive","Brown","Chocolate","OrangeRed", "HalfGreen","GreenOlive","DryOlive","Goldenrod","DarkOrange", @@ -997,7 +997,7 @@ void automatname(Material *ma) int nr, r, g, b; float ref; - if(ma==0) return; + if(ma==NULL) return; if(ma->mode & MA_SHLESS) ref= 1.0; else ref= ma->ref; @@ -1045,7 +1045,7 @@ int object_remove_material_slot(Object *ob) if(*totcolp==0) { MEM_freeN(*matarar); - *matarar= 0; + *matarar= NULL; } actcol= ob->actcol; @@ -1068,7 +1068,7 @@ int object_remove_material_slot(Object *ob) if(obt->totcol==0) { MEM_freeN(obt->mat); MEM_freeN(obt->matbits); - obt->mat= 0; + obt->mat= NULL; obt->matbits= NULL; } } @@ -1349,7 +1349,7 @@ void ramp_blend(int type, float *r, float *g, float *b, float fac, float *col) /* copy/paste buffer, if we had a propper py api that would be better */ Material matcopybuf; -static short matcopied=0; +static short matcopied= 0; void clear_matcopybuf(void) { diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index a22fc165de7..d89bc3cd6f2 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -77,7 +77,7 @@ void unlink_mball(MetaBall *mb) for(a=0; a<mb->totcol; a++) { if(mb->mat[a]) mb->mat[a]->id.us--; - mb->mat[a]= 0; + mb->mat[a]= NULL; } } @@ -142,9 +142,9 @@ void make_local_mball(MetaBall *mb) * - mixed: make copy */ - if(mb->id.lib==0) return; + if(mb->id.lib==NULL) return; if(mb->id.us==1) { - mb->id.lib= 0; + mb->id.lib= NULL; mb->id.flag= LIB_LOCAL; return; } @@ -159,7 +159,7 @@ void make_local_mball(MetaBall *mb) } if(local && lib==0) { - mb->id.lib= 0; + mb->id.lib= NULL; mb->id.flag= LIB_LOCAL; } else if(local && lib) { @@ -170,7 +170,7 @@ void make_local_mball(MetaBall *mb) while(ob) { if(ob->data==mb) { - if(ob->id.lib==0) { + if(ob->id.lib==NULL) { ob->data= mbn; mbn->id.us++; mb->id.us--; @@ -242,7 +242,7 @@ void tex_space_mball(Object *ob) float *data, min[3], max[3], loc[3], size[3]; int tot, doit=0; - if(ob->bb==0) ob->bb= MEM_callocN(sizeof(BoundBox), "mb boundbox"); + if(ob->bb==NULL) ob->bb= MEM_callocN(sizeof(BoundBox), "mb boundbox"); bb= ob->bb; /* Weird one, this. */ @@ -372,7 +372,7 @@ void copy_mball_properties(Scene *scene, Object *active_object) BLI_split_name_num(basisname, &basisnr, active_object->id.name+2, '.'); /* XXX recursion check, see scene.c, just too simple code this next_object() */ - if(F_ERROR==next_object(&sce_iter, 0, 0, 0)) + if(F_ERROR==next_object(&sce_iter, 0, NULL, NULL)) return; while(next_object(&sce_iter, 1, &base, &ob)) { @@ -418,7 +418,7 @@ Object *find_basis_mball(Scene *scene, Object *basis) totelem= 0; /* XXX recursion check, see scene.c, just too simple code this next_object() */ - if(F_ERROR==next_object(&sce_iter, 0, 0, 0)) + if(F_ERROR==next_object(&sce_iter, 0, NULL, NULL)) return NULL; while(next_object(&sce_iter, 1, &base, &ob)) { @@ -698,8 +698,8 @@ float metaball(float x, float y, float z) /* ******************************************** */ -int *indices=NULL; -int totindex, curindex; +static int *indices=NULL; +static int totindex, curindex; void accum_mballfaces(int i1, int i2, int i3, int i4) @@ -742,8 +742,8 @@ void *new_pgn_element(int size) */ int blocksize= 16384; static int offs= 0; /* the current free address */ - static struct pgn_elements *cur= 0; - static ListBase lb= {0, 0}; + static struct pgn_elements *cur= NULL; + static ListBase lb= {NULL, NULL}; void *adr; if(size>10000 || size==0) { @@ -925,14 +925,14 @@ void testface(int i, int j, int k, CUBE* old, int bit, int c1, int c2, int c3, i newc.corners[FLIP(c3, bit)] = corn3; newc.corners[FLIP(c4, bit)] = corn4; - if(newc.corners[0]==0) newc.corners[0] = setcorner(p, i, j, k); - if(newc.corners[1]==0) newc.corners[1] = setcorner(p, i, j, k+1); - if(newc.corners[2]==0) newc.corners[2] = setcorner(p, i, j+1, k); - if(newc.corners[3]==0) newc.corners[3] = setcorner(p, i, j+1, k+1); - if(newc.corners[4]==0) newc.corners[4] = setcorner(p, i+1, j, k); - if(newc.corners[5]==0) newc.corners[5] = setcorner(p, i+1, j, k+1); - if(newc.corners[6]==0) newc.corners[6] = setcorner(p, i+1, j+1, k); - if(newc.corners[7]==0) newc.corners[7] = setcorner(p, i+1, j+1, k+1); + if(newc.corners[0]==NULL) newc.corners[0] = setcorner(p, i, j, k); + if(newc.corners[1]==NULL) newc.corners[1] = setcorner(p, i, j, k+1); + if(newc.corners[2]==NULL) newc.corners[2] = setcorner(p, i, j+1, k); + if(newc.corners[3]==NULL) newc.corners[3] = setcorner(p, i, j+1, k+1); + if(newc.corners[4]==NULL) newc.corners[4] = setcorner(p, i+1, j, k); + if(newc.corners[5]==NULL) newc.corners[5] = setcorner(p, i+1, j, k+1); + if(newc.corners[6]==NULL) newc.corners[6] = setcorner(p, i+1, j+1, k); + if(newc.corners[7]==NULL) newc.corners[7] = setcorner(p, i+1, j+1, k+1); p->cubes->cube= newc; } @@ -1031,7 +1031,7 @@ void makecubetable (void) for (c = 0; c < 8; c++) pos[c] = MB_BIT(i, c); for (e = 0; e < 12; e++) if (!done[e] && (pos[corner1[e]] != pos[corner2[e]])) { - INTLIST *ints = 0; + INTLIST *ints = NULL; INTLISTS *lists = (INTLISTS *) MEM_callocN(sizeof(INTLISTS), "mball_intlist"); int start = e, edge = e; @@ -1080,7 +1080,7 @@ void BKE_freecubetable(void) MEM_freeN(lists); lists= nlists; } - cubetable[i]= 0; + cubetable[i]= NULL; } } @@ -1594,7 +1594,7 @@ float init_meta(Scene *scene, Object *ob) /* return totsize */ BLI_split_name_num(obname, &obnr, ob->id.name+2, '.'); /* make main array */ - next_object(&sce_iter, 0, 0, 0); + next_object(&sce_iter, 0, NULL, NULL); while(next_object(&sce_iter, 1, &base, &bob)) { if(bob->type==OB_MBALL) { @@ -2174,7 +2174,7 @@ void metaball_polygonize(Scene *scene, Object *ob, ListBase *dispbase) if(G.moving && mb->flag==MB_UPDATE_FAST) return; curindex= totindex= 0; - indices= 0; + indices= NULL; thresh= mb->thresh; /* total number of MetaElems (totelem) is precomputed in find_basis_mball() function */ @@ -2229,7 +2229,7 @@ void metaball_polygonize(Scene *scene, Object *ob, ListBase *dispbase) mbproc.function = metaball; mbproc.size = width; mbproc.bounds = nr_cubes; - mbproc.cubes= 0; + mbproc.cubes= NULL; mbproc.delta = width/(float)(RES*RES); polygonize(&mbproc, mb); @@ -2251,7 +2251,7 @@ void metaball_polygonize(Scene *scene, Object *ob, ListBase *dispbase) dl->parts= curindex; dl->index= indices; - indices= 0; + indices= NULL; a= mbproc.vertices.count; dl->verts= ve= MEM_mallocN(sizeof(float)*3*a, "mballverts"); diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 8117a626c03..3c56cb4663b 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -98,11 +98,11 @@ void unlink_mesh(Mesh *me) { int a; - if(me==0) return; + if(me==NULL) return; for(a=0; a<me->totcol; a++) { if(me->mat[a]) me->mat[a]->id.us--; - me->mat[a]= 0; + me->mat[a]= NULL; } if(me->key) { @@ -110,9 +110,9 @@ void unlink_mesh(Mesh *me) if (me->key->id.us == 0 && me->key->ipo ) me->key->ipo->id.us--; } - me->key= 0; + me->key= NULL; - if(me->texcomesh) me->texcomesh= 0; + if(me->texcomesh) me->texcomesh= NULL; } @@ -255,9 +255,9 @@ void make_local_tface(Mesh *me) if(tface->tpage) { ima= tface->tpage; if(ima->id.lib) { - ima->id.lib= 0; + ima->id.lib= NULL; ima->id.flag= LIB_LOCAL; - new_id(0, (ID *)ima, 0); + new_id(NULL, (ID *)ima, NULL); } } } @@ -277,11 +277,11 @@ void make_local_mesh(Mesh *me) * - mixed: make copy */ - if(me->id.lib==0) return; + if(me->id.lib==NULL) return; if(me->id.us==1) { - me->id.lib= 0; + me->id.lib= NULL; me->id.flag= LIB_LOCAL; - new_id(0, (ID *)me, 0); + new_id(NULL, (ID *)me, NULL); if(me->mtface) make_local_tface(me); @@ -298,9 +298,9 @@ void make_local_mesh(Mesh *me) } if(local && lib==0) { - me->id.lib= 0; + me->id.lib= NULL; me->id.flag= LIB_LOCAL; - new_id(0, (ID *)me, 0); + new_id(NULL, (ID *)me, NULL); if(me->mtface) make_local_tface(me); @@ -312,7 +312,7 @@ void make_local_mesh(Mesh *me) ob= bmain->object.first; while(ob) { if( me==get_mesh(ob) ) { - if(ob->id.lib==0) { + if(ob->id.lib==NULL) { set_mesh(ob, men); } } @@ -327,7 +327,7 @@ void boundbox_mesh(Mesh *me, float *loc, float *size) float min[3], max[3]; float mloc[3], msize[3]; - if(me->bb==0) me->bb= MEM_callocN(sizeof(BoundBox), "boundbox"); + if(me->bb==NULL) me->bb= MEM_callocN(sizeof(BoundBox), "boundbox"); bb= me->bb; if (!loc) loc= mloc; @@ -512,18 +512,18 @@ int test_index_face(MFace *mface, CustomData *fdata, int mfindex, int nr) Mesh *get_mesh(Object *ob) { - if(ob==0) return 0; + if(ob==NULL) return NULL; if(ob->type==OB_MESH) return ob->data; - else return 0; + else return NULL; } void set_mesh(Object *ob, Mesh *me) { - Mesh *old=0; + Mesh *old=NULL; multires_force_update(ob); - if(ob==0) return; + if(ob==NULL) return; if(ob->type==OB_MESH) { old= ob->data; @@ -730,7 +730,7 @@ void mball_to_mesh(ListBase *lb, Mesh *me) int a, *index; dl= lb->first; - if(dl==0) return; + if(dl==NULL) return; if(dl->type==DL_INDEX4) { me->totvert= dl->nr; @@ -1023,7 +1023,7 @@ void nurbs_to_mesh(Object *ob) tex_space_mesh(me); - cu->mat= 0; + cu->mat= NULL; cu->totcol= 0; if(ob->data) { diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 6f8075310c7..db0c649d290 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -57,7 +57,7 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) { - static ModifierTypeInfo *types[NUM_MODIFIER_TYPES]= {0}; + static ModifierTypeInfo *types[NUM_MODIFIER_TYPES]= {NULL}; static int types_init = 1; if (types_init) { diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 2601adbcb5e..29726ccbc99 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -449,7 +449,7 @@ void multiresModifier_del_levels(MultiresModifierData *mmd, Object *ob, int dire static DerivedMesh *multires_dm_create_local(Object *ob, DerivedMesh *dm, int lvl, int totlvl, int simple) { - MultiresModifierData mmd= {{0}}; + MultiresModifierData mmd= {{NULL}}; mmd.lvl = lvl; mmd.sculptlvl = lvl; @@ -462,7 +462,7 @@ static DerivedMesh *multires_dm_create_local(Object *ob, DerivedMesh *dm, int lv static DerivedMesh *subsurf_dm_create_local(Object *UNUSED(ob), DerivedMesh *dm, int lvl, int simple, int optimal) { - SubsurfModifierData smd= {{0}}; + SubsurfModifierData smd= {{NULL}}; smd.levels = smd.renderLevels = lvl; smd.flags |= eSubsurfModifierFlag_SubsurfUv; @@ -596,7 +596,7 @@ void multiresModifier_base_apply(MultiresModifierData *mmd, Object *ob) dispdm->release(dispdm); } -void multires_subdivide(MultiresModifierData *mmd, Object *ob, int totlvl, int updateblock, int simple) +static void multires_subdivide(MultiresModifierData *mmd, Object *ob, int totlvl, int updateblock, int simple) { Mesh *me = ob->data; MDisps *mdisps; @@ -1591,7 +1591,7 @@ static void multires_sync_levels(Scene *scene, Object *ob, Object *to_ob) else multires_subdivide(mmd, ob, to_mmd->totlvl, 0, mmd->simple); } -void multires_apply_smat(Scene *scene, Object *ob, float smat[3][3]) +static void multires_apply_smat(Scene *scene, Object *ob, float smat[3][3]) { DerivedMesh *dm= NULL, *cddm= NULL, *subdm= NULL; DMGridData **gridData, **subGridData; diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 6db03909aa3..da0f3f8a448 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -1320,7 +1320,7 @@ static void nlastrip_get_endpoint_overlaps (NlaStrip *strip, NlaTrack *track, fl } /* Determine auto-blending for the given strip */ -void BKE_nlastrip_validate_autoblends (NlaTrack *nlt, NlaStrip *nls) +static void BKE_nlastrip_validate_autoblends (NlaTrack *nlt, NlaStrip *nls) { float *ps=NULL, *pe=NULL; float *ns=NULL, *ne=NULL; @@ -1576,7 +1576,7 @@ void BKE_nla_tweakmode_exit (AnimData *adt) /* Baking Tools ------------------------------------------- */ -void BKE_nla_bake (Scene *scene, ID *UNUSED(id), AnimData *adt, int UNUSED(flag)) +static void BKE_nla_bake (Scene *scene, ID *UNUSED(id), AnimData *adt, int UNUSED(flag)) { /* verify that data is valid diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 218539b311a..057d90dc8bb 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -1499,9 +1499,9 @@ void ntreeMakeLocal(bNodeTree *ntree) if(ntree->id.lib==NULL) return; if(ntree->id.us==1) { - ntree->id.lib= 0; + ntree->id.lib= NULL; ntree->id.flag= LIB_LOCAL; - new_id(0, (ID *)ntree, 0); + new_id(NULL, (ID *)ntree, NULL); return; } @@ -1559,7 +1559,7 @@ void ntreeMakeLocal(bNodeTree *ntree) if(local && lib==0) { ntree->id.lib= NULL; ntree->id.flag= LIB_LOCAL; - new_id(0, (ID *)ntree, 0); + new_id(NULL, (ID *)ntree, NULL); } else if(local && lib) { /* this is the mixed case, we copy the tree and assign it to local users */ @@ -2437,7 +2437,7 @@ static void *exec_composite_node(void *node_v) } node->exec |= NODE_READY; - return 0; + return NULL; } /* return total of executable nodes, for timecursor */ diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 5d5271bba8c..6149f7d380b 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -273,7 +273,7 @@ void free_object(Object *ob) else if(ob->type==OB_CURVE) unlink_curve(ob->data); else if(ob->type==OB_MBALL) unlink_mball(ob->data); } - ob->data= 0; + ob->data= NULL; } for(a=0; a<ob->totcol; a++) { @@ -281,12 +281,12 @@ void free_object(Object *ob) } if(ob->mat) MEM_freeN(ob->mat); if(ob->matbits) MEM_freeN(ob->matbits); - ob->mat= 0; - ob->matbits= 0; + ob->mat= NULL; + ob->matbits= NULL; if(ob->bb) MEM_freeN(ob->bb); - ob->bb= 0; + ob->bb= NULL; if(ob->path) free_path(ob->path); - ob->path= 0; + ob->path= NULL; if(ob->adt) BKE_free_animdata((ID *)ob); if(ob->poselib) ob->poselib->id.us--; if(ob->gpd) ((ID *)ob->gpd)->us--; @@ -739,11 +739,11 @@ void make_local_camera(Camera *cam) * - mixed: make copy */ - if(cam->id.lib==0) return; + if(cam->id.lib==NULL) return; if(cam->id.us==1) { - cam->id.lib= 0; + cam->id.lib= NULL; cam->id.flag= LIB_LOCAL; - new_id(0, (ID *)cam, 0); + new_id(NULL, (ID *)cam, NULL); return; } @@ -757,9 +757,9 @@ void make_local_camera(Camera *cam) } if(local && lib==0) { - cam->id.lib= 0; + cam->id.lib= NULL; cam->id.flag= LIB_LOCAL; - new_id(0, (ID *)cam, 0); + new_id(NULL, (ID *)cam, NULL); } else if(local && lib) { camn= copy_camera(cam); @@ -769,7 +769,7 @@ void make_local_camera(Camera *cam) while(ob) { if(ob->data==cam) { - if(ob->id.lib==0) { + if(ob->id.lib==NULL) { ob->data= camn; camn->id.us++; cam->id.us--; @@ -888,11 +888,11 @@ void make_local_lamp(Lamp *la) * - mixed: make copy */ - if(la->id.lib==0) return; + if(la->id.lib==NULL) return; if(la->id.us==1) { - la->id.lib= 0; + la->id.lib= NULL; la->id.flag= LIB_LOCAL; - new_id(0, (ID *)la, 0); + new_id(NULL, (ID *)la, NULL); return; } @@ -906,9 +906,9 @@ void make_local_lamp(Lamp *la) } if(local && lib==0) { - la->id.lib= 0; + la->id.lib= NULL; la->id.flag= LIB_LOCAL; - new_id(0, (ID *)la, 0); + new_id(NULL, (ID *)la, NULL); } else if(local && lib) { lan= copy_lamp(la); @@ -918,7 +918,7 @@ void make_local_lamp(Lamp *la) while(ob) { if(ob->data==la) { - if(ob->id.lib==0) { + if(ob->id.lib==NULL) { ob->data= lan; lan->id.us++; la->id.us--; @@ -1127,7 +1127,7 @@ BulletSoftBody *copy_bulletsoftbody(BulletSoftBody *bsb) return bsbn; } -ParticleSystem *copy_particlesystem(ParticleSystem *psys) +static ParticleSystem *copy_particlesystem(ParticleSystem *psys) { ParticleSystem *psysn; ParticleData *pa; @@ -2262,7 +2262,7 @@ void what_does_parent(Scene *scene, Object *ob, Object *workob) where_is_object(scene, workob); } -BoundBox *unit_boundbox() +BoundBox *unit_boundbox(void) { BoundBox *bb; float min[3] = {-1.0f,-1.0f,-1.0f}, max[3] = {-1.0f,-1.0f,-1.0f}; diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 12ebaf7578a..1fc0a2259fb 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -459,7 +459,7 @@ int unpackVFont(ReportList *reports, VFont *vfont, int how) if (newname != NULL) { ret_value = RET_OK; freePackedFile(vfont->packedfile); - vfont->packedfile = 0; + vfont->packedfile = NULL; strcpy(vfont->name, newname); MEM_freeN(newname); } @@ -485,7 +485,7 @@ int unpackSound(Main *bmain, ReportList *reports, bSound *sound, int how) MEM_freeN(newname); freePackedFile(sound->packedfile); - sound->packedfile = 0; + sound->packedfile = NULL; sound_load(bmain, sound); diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index b2f4b6bdc97..3204a1c38e7 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -157,21 +157,21 @@ static void psys_free_path_cache_buffers(ParticleCacheKey **cache, ListBase *buf ParticleSystem *psys_get_current(Object *ob) { ParticleSystem *psys; - if(ob==0) return 0; + if(ob==NULL) return NULL; for(psys=ob->particlesystem.first; psys; psys=psys->next){ if(psys->flag & PSYS_CURRENT) return psys; } - return 0; + return NULL; } short psys_get_current_num(Object *ob) { ParticleSystem *psys; short i; - if(ob==0) return 0; + if(ob==NULL) return 0; for(psys=ob->particlesystem.first, i=0; psys; psys=psys->next, i++) if(psys->flag & PSYS_CURRENT) @@ -184,7 +184,7 @@ void psys_set_current_num(Object *ob, int index) ParticleSystem *psys; short i; - if(ob==0) return; + if(ob==NULL) return; for(psys=ob->particlesystem.first, i=0; psys; psys=psys->next, i++) { if(i == index) @@ -209,7 +209,7 @@ Object *psys_find_object(Scene *scene, ParticleSystem *psys) } Object *psys_get_lattice(ParticleSimulationData *sim) { - Object *lattice=0; + Object *lattice=NULL; if(psys_in_edit_mode(sim->scene, sim->psys)==0){ @@ -223,7 +223,7 @@ Object *psys_get_lattice(ParticleSimulationData *sim) } } if(lattice) - init_latt_deform(lattice,0); + init_latt_deform(lattice, NULL); } return lattice; @@ -358,7 +358,7 @@ int psys_uses_gravity(ParticleSimulationData *sim) /************************************************/ /* Freeing stuff */ /************************************************/ -void fluid_free_settings(SPHFluidSettings *fluid) +static void fluid_free_settings(SPHFluidSettings *fluid) { if(fluid) MEM_freeN(fluid); @@ -459,7 +459,7 @@ void psys_free_children(ParticleSystem *psys) { if(psys->child) { MEM_freeN(psys->child); - psys->child=0; + psys->child= NULL; psys->totchild=0; } @@ -529,7 +529,7 @@ void psys_free(Object *ob, ParticleSystem * psys) if(psys->child){ MEM_freeN(psys->child); - psys->child = 0; + psys->child = NULL; psys->totchild = 0; } @@ -550,7 +550,7 @@ void psys_free(Object *ob, ParticleSystem * psys) if(psys->part){ psys->part->id.us--; - psys->part=0; + psys->part=NULL; } BKE_ptcache_free_list(&psys->ptcaches); diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 409e9876599..e29293a3087 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -120,7 +120,8 @@ static int particles_are_dynamic(ParticleSystem *psys) { else return ELEM3(psys->part->phystype, PART_PHYS_NEWTON, PART_PHYS_BOIDS, PART_PHYS_FLUID); } -int psys_get_current_display_percentage(ParticleSystem *psys) + +static int psys_get_current_display_percentage(ParticleSystem *psys) { ParticleSettings *part=psys->part; @@ -173,7 +174,7 @@ void psys_reset(ParticleSystem *psys, int mode) /* reset children */ if(psys->child) { MEM_freeN(psys->child); - psys->child= 0; + psys->child= NULL; } psys->totchild= 0; @@ -277,7 +278,7 @@ static void realloc_particles(ParticleSimulationData *sim, int new_totpart) if(psys->child) { MEM_freeN(psys->child); - psys->child=0; + psys->child=NULL; psys->totchild=0; } } @@ -312,7 +313,7 @@ static void alloc_child_particles(ParticleSystem *psys, int tot) } MEM_freeN(psys->child); - psys->child=0; + psys->child=NULL; psys->totchild=0; } @@ -401,7 +402,7 @@ void psys_calc_dmcache(Object *ob, DerivedMesh *dm, ParticleSystem *psys) static void distribute_particles_in_grid(DerivedMesh *dm, ParticleSystem *psys) { - ParticleData *pa=0; + ParticleData *pa=NULL; float min[3], max[3], delta[3], d; MVert *mv, *mvert = dm->getVertDataArray(dm,0); int totvert=dm->getNumVerts(dm), from=psys->part->from; diff --git a/source/blender/blenkernel/intern/property.c b/source/blender/blenkernel/intern/property.c index dd57fef50c5..e907b628242 100644 --- a/source/blender/blenkernel/intern/property.c +++ b/source/blender/blenkernel/intern/property.c @@ -43,6 +43,8 @@ #include "BLI_blenlib.h" +#include "BKE_property.h" + void free_property(bProperty *prop) { @@ -93,7 +95,7 @@ void init_property(bProperty *prop) /* also use when property changes type */ if(prop->poin && prop->poin != &prop->data) MEM_freeN(prop->poin); - prop->poin= 0; + prop->poin= NULL; prop->data= 0; diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c index 12f82d041f9..c8ef834fbbb 100644 --- a/source/blender/blenkernel/intern/sca.c +++ b/source/blender/blenkernel/intern/sca.c @@ -86,7 +86,7 @@ void copy_sensors(ListBase *lbn, ListBase *lbo) { bSensor *sens, *sensn; - lbn->first= lbn->last= 0; + lbn->first= lbn->last= NULL; sens= lbo->first; while(sens) { sensn= copy_sensor(sens); @@ -253,7 +253,7 @@ void copy_controllers(ListBase *lbn, ListBase *lbo) { bController *cont, *contn; - lbn->first= lbn->last= 0; + lbn->first= lbn->last= NULL; cont= lbo->first; while(cont) { contn= copy_controller(cont); @@ -267,7 +267,7 @@ void init_controller(bController *cont) /* also use when controller changes type, leave actuators... */ if(cont->data) MEM_freeN(cont->data); - cont->data= 0; + cont->data= NULL; switch(cont->type) { case CONT_EXPRESSION: @@ -375,7 +375,7 @@ void copy_actuators(ListBase *lbn, ListBase *lbo) { bActuator *act, *actn; - lbn->first= lbn->last= 0; + lbn->first= lbn->last= NULL; act= lbo->first; while(act) { actn= copy_actuator(act); @@ -393,7 +393,7 @@ void init_actuator(bActuator *act) bSoundActuator *sa; if(act->data) MEM_freeN(act->data); - act->data= 0; + act->data= NULL; switch(act->type) { case ACT_ACTION: @@ -512,7 +512,7 @@ void clear_sca_new_poins_ob(Object *ob) } } -void clear_sca_new_poins() +void clear_sca_new_poins(void) { Object *ob; @@ -595,7 +595,7 @@ void set_sca_new_poins_ob(Object *ob) } -void set_sca_new_poins() +void set_sca_new_poins(void) { Object *ob; diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c index 6f1d32898f9..58900e603e3 100644 --- a/source/blender/blenkernel/intern/screen.c +++ b/source/blender/blenkernel/intern/screen.c @@ -109,7 +109,7 @@ ARegionType *BKE_regiontype_from_id(SpaceType *st, int regionid) } -const ListBase *BKE_spacetypes_list() +const ListBase *BKE_spacetypes_list(void) { return &spacetypes; } diff --git a/source/blender/blenkernel/intern/seqcache.c b/source/blender/blenkernel/intern/seqcache.c index 78cd4bb51fe..1c40ef020be 100644 --- a/source/blender/blenkernel/intern/seqcache.c +++ b/source/blender/blenkernel/intern/seqcache.c @@ -54,10 +54,10 @@ typedef struct seqCacheEntry MEM_CacheLimiterHandleC * c_handle; } seqCacheEntry; -static GHash * hash = 0; -static MEM_CacheLimiterC * limitor = 0; -static struct BLI_mempool * entrypool = 0; -static struct BLI_mempool * keypool = 0; +static GHash * hash = NULL; +static MEM_CacheLimiterC * limitor = NULL; +static struct BLI_mempool * entrypool = NULL; +static struct BLI_mempool * keypool = NULL; static int ibufs_in = 0; static int ibufs_rem = 0; @@ -119,8 +119,8 @@ static void HashValFree(void *val) ibufs_rem++; } - e->ibuf = 0; - e->c_handle = 0; + e->ibuf = NULL; + e->c_handle = NULL; BLI_mempool_free(entrypool, e); } @@ -135,12 +135,12 @@ static void IMB_seq_cache_destructor(void * p) IMB_freeImBuf(e->ibuf); ibufs_rem++; - e->ibuf = 0; - e->c_handle = 0; + e->ibuf = NULL; + e->c_handle = NULL; } } -void seq_stripelem_cache_init() +void seq_stripelem_cache_init(void) { hash = BLI_ghash_new(HashHash, HashCmp, "seq stripelem cache hash"); limitor = new_MEM_CacheLimiter( IMB_seq_cache_destructor ); @@ -149,7 +149,7 @@ void seq_stripelem_cache_init() keypool = BLI_mempool_create(sizeof(seqCacheKey), 64, 64, 0); } -void seq_stripelem_cache_destruct() +void seq_stripelem_cache_destruct(void) { if (!entrypool) { return; @@ -160,7 +160,7 @@ void seq_stripelem_cache_destruct() BLI_mempool_destroy(keypool); } -void seq_stripelem_cache_cleanup() +void seq_stripelem_cache_cleanup(void) { if (!entrypool) { seq_stripelem_cache_init(); @@ -185,7 +185,7 @@ struct ImBuf * seq_stripelem_cache_get( seqCacheEntry * e; if (!seq) { - return 0; + return NULL; } if (!entrypool) { @@ -205,7 +205,7 @@ struct ImBuf * seq_stripelem_cache_get( MEM_CacheLimiter_touch(e->c_handle); return e->ibuf; } - return 0; + return NULL; } void seq_stripelem_cache_put( @@ -239,7 +239,7 @@ void seq_stripelem_cache_put( e = (seqCacheEntry*) BLI_mempool_alloc(entrypool); e->ibuf = i; - e->c_handle = 0; + e->c_handle = NULL; BLI_ghash_remove(hash, key, HashKeyFree, HashValFree); BLI_ghash_insert(hash, key, e); diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 11075fe402e..da90ce4a715 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -125,12 +125,12 @@ static void open_plugin_seq(PluginSeq *pis, const char *seqname) char *cp; /* to be sure: (is tested for) */ - pis->doit= 0; - pis->pname= 0; - pis->varstr= 0; - pis->cfra= 0; + pis->doit= NULL; + pis->pname= NULL; + pis->varstr= NULL; + pis->cfra= NULL; pis->version= 0; - pis->instance_private_data = 0; + pis->instance_private_data = NULL; /* clear the error list */ PIL_dynlib_get_error_as_string(NULL); @@ -142,12 +142,12 @@ static void open_plugin_seq(PluginSeq *pis, const char *seqname) pis->handle= PIL_dynlib_open(pis->name); if(test_dlerr(pis->name, pis->name)) return; - if (pis->handle != 0) { + if (pis->handle != NULL) { /* find the address of the version function */ version= (int (*)(void))PIL_dynlib_find_symbol(pis->handle, "plugin_seq_getversion"); if (test_dlerr(pis->name, "plugin_seq_getversion")) return; - if (version != 0) { + if (version != NULL) { pis->version= version(); if (pis->version >= 2 && pis->version <= 6) { int (*info_func)(PluginInfo *); @@ -201,11 +201,11 @@ static PluginSeq *add_plugin_seq(const char *str, const char *seqname) strncpy(pis->name, str, FILE_MAXDIR+FILE_MAXFILE); open_plugin_seq(pis, seqname); - if(pis->doit==0) { - if(pis->handle==0) error("no plugin: %s", str); + if(pis->doit==NULL) { + if(pis->handle==NULL) error("no plugin: %s", str); else error("in plugin: %s", str); MEM_freeN(pis); - return 0; + return NULL; } /* default values */ @@ -222,7 +222,7 @@ static PluginSeq *add_plugin_seq(const char *str, const char *seqname) static void free_plugin_seq(PluginSeq *pis) { - if(pis==0) return; + if(pis==NULL) return; /* no PIL_dynlib_close: same plugin can be opened multiple times with 1 handle */ @@ -270,7 +270,7 @@ static void copy_plugin(Sequence * dst, Sequence * src) static ImBuf * IMB_cast_away_list(ImBuf * i) { if (!i) { - return 0; + return NULL; } return (ImBuf*) (((void**) i) + 2); } @@ -383,7 +383,7 @@ static int do_plugin_early_out(struct Sequence *UNUSED(seq), static void free_plugin(struct Sequence * seq) { free_plugin_seq(seq->plugin); - seq->plugin = 0; + seq->plugin = NULL; } /* ********************************************************************** @@ -554,7 +554,7 @@ static struct ImBuf * do_alphaover_effect( ALPHA UNDER ********************************************************************** */ -void do_alphaunder_effect_byte( +static void do_alphaunder_effect_byte( float facf0, float facf1, int x, int y, char *rect1, char *rect2, char *out) { @@ -726,7 +726,7 @@ static struct ImBuf* do_alphaunder_effect( CROSS ********************************************************************** */ -void do_cross_effect_byte(float facf0, float facf1, int x, int y, +static void do_cross_effect_byte(float facf0, float facf1, int x, int y, char *rect1, char *rect2, char *out) { @@ -774,7 +774,7 @@ void do_cross_effect_byte(float facf0, float facf1, int x, int y, } } -void do_cross_effect_float(float facf0, float facf1, int x, int y, +static void do_cross_effect_float(float facf0, float facf1, int x, int y, float *rect1, float *rect2, float *out) { float fac1, fac2, fac3, fac4; @@ -1864,7 +1864,7 @@ static int num_inputs_wipe(void) static void free_wipe_effect(Sequence *seq) { if(seq->effectdata)MEM_freeN(seq->effectdata); - seq->effectdata = 0; + seq->effectdata = NULL; } static void copy_wipe_effect(Sequence *dst, Sequence *src) @@ -2048,7 +2048,7 @@ static int num_inputs_transform(void) static void free_transform_effect(Sequence *seq) { if(seq->effectdata)MEM_freeN(seq->effectdata); - seq->effectdata = 0; + seq->effectdata = NULL; } static void copy_transform_effect(Sequence *dst, Sequence *src) @@ -2617,7 +2617,7 @@ static int num_inputs_glow(void) static void free_glow_effect(Sequence *seq) { if(seq->effectdata)MEM_freeN(seq->effectdata); - seq->effectdata = 0; + seq->effectdata = NULL; } static void copy_glow_effect(Sequence *dst, Sequence *src) @@ -2704,7 +2704,7 @@ static int num_inputs_color(void) static void free_solid_color(Sequence *seq) { if(seq->effectdata)MEM_freeN(seq->effectdata); - seq->effectdata = 0; + seq->effectdata = NULL; } static void copy_solid_color(Sequence *dst, Sequence *src) @@ -2827,21 +2827,21 @@ static struct ImBuf * do_multicam( ListBase * seqbasep; if (seq->multicam_source == 0 || seq->multicam_source >= seq->machine) { - return 0; + return NULL; } ed = context.scene->ed; if (!ed) { - return 0; + return NULL; } seqbasep = seq_seqbase(&ed->seqbase, seq); if (!seqbasep) { - return 0; + return NULL; } i = give_ibuf_seqbase(context, cfra, seq->multicam_source, seqbasep); if (!i) { - return 0; + return NULL; } if (input_have_to_preprocess(context, seq, cfra)) { @@ -2867,7 +2867,7 @@ static void init_speed_effect(Sequence *seq) v = (SpeedControlVars *)seq->effectdata; v->globalSpeed = 1.0; - v->frameMap = 0; + v->frameMap = NULL; v->flags |= SEQ_SPEED_INTEGRATE; /* should be default behavior */ v->length = 0; } @@ -2876,7 +2876,7 @@ static void load_speed_effect(Sequence * seq) { SpeedControlVars * v = (SpeedControlVars *)seq->effectdata; - v->frameMap = 0; + v->frameMap = NULL; v->length = 0; } @@ -2890,7 +2890,7 @@ static void free_speed_effect(Sequence *seq) SpeedControlVars * v = (SpeedControlVars *)seq->effectdata; if(v->frameMap) MEM_freeN(v->frameMap); if(seq->effectdata) MEM_freeN(seq->effectdata); - seq->effectdata = 0; + seq->effectdata = NULL; } static void copy_speed_effect(Sequence *dst, Sequence *src) @@ -2898,7 +2898,7 @@ static void copy_speed_effect(Sequence *dst, Sequence *src) SpeedControlVars * v; dst->effectdata = MEM_dupallocN(src->effectdata); v = (SpeedControlVars *)dst->effectdata; - v->frameMap = 0; + v->frameMap = NULL; v->length = 0; } @@ -3260,7 +3260,7 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type) struct SeqEffectHandle get_sequence_effect(Sequence * seq) { - struct SeqEffectHandle rval= {0}; + struct SeqEffectHandle rval= {NULL}; if (seq->type & SEQ_EFFECT) { rval = get_sequence_effect_impl(seq->type); @@ -3275,7 +3275,7 @@ struct SeqEffectHandle get_sequence_effect(Sequence * seq) struct SeqEffectHandle get_sequence_blend(Sequence * seq) { - struct SeqEffectHandle rval= {0}; + struct SeqEffectHandle rval= {NULL}; if (seq->blend_mode != 0) { rval = get_sequence_effect_impl(seq->blend_mode); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 8f07ed48803..9537931faec 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -135,7 +135,7 @@ static void free_proxy_seq(Sequence *seq) { if (seq->strip && seq->strip->proxy && seq->strip->proxy->anim) { IMB_free_anim(seq->strip->proxy->anim); - seq->strip->proxy->anim = 0; + seq->strip->proxy->anim = NULL; } } @@ -429,7 +429,7 @@ void seq_end(SeqIterator *iter) * in metastrips!) ********************************************************************** */ - +#if 0 /* UNUSED */ static void do_seq_count(ListBase *seqbase, int *totseq) { Sequence *seq; @@ -456,7 +456,7 @@ static void do_build_seqar(ListBase *seqbase, Sequence ***seqar, int depth) } } -void build_seqar(ListBase *seqbase, Sequence ***seqar, int *totseq) +static void build_seqar(ListBase *seqbase, Sequence ***seqar, int *totseq) { Sequence **tseqar; @@ -473,6 +473,7 @@ void build_seqar(ListBase *seqbase, Sequence ***seqar, int *totseq) do_build_seqar(seqbase, seqar, 0); *seqar= tseqar; } +#endif /* UNUSED */ static void do_seq_count_cb(ListBase *seqbase, int *totseq, int (*test_func)(Sequence * seq)) @@ -762,8 +763,8 @@ void sort_seq(Scene *scene) if(ed==NULL) return; - seqbase.first= seqbase.last= 0; - effbase.first= effbase.last= 0; + seqbase.first= seqbase.last= NULL; + effbase.first= effbase.last= NULL; while( (seq= ed->seqbasep->first) ) { BLI_remlink(ed->seqbasep, seq); @@ -777,7 +778,7 @@ void sort_seq(Scene *scene) } seqt= seqt->next; } - if(seqt==0) BLI_addtail(&effbase, seq); + if(seqt==NULL) BLI_addtail(&effbase, seq); } else { seqt= seqbase.first; @@ -788,7 +789,7 @@ void sort_seq(Scene *scene) } seqt= seqt->next; } - if(seqt==0) BLI_addtail(&seqbase, seq); + if(seqt==NULL) BLI_addtail(&seqbase, seq); } } @@ -933,7 +934,7 @@ static void make_black_ibuf(ImBuf *ibuf) float *rect_float; int tot; - if(ibuf==0 || (ibuf->rect==0 && ibuf->rect_float==0)) return; + if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) return; tot= ibuf->x*ibuf->y; @@ -1024,7 +1025,7 @@ StripElem *give_stripelem(Sequence *seq, int cfra) if(seq->type != SEQ_MOVIE) { /* movie use the first */ int nr = (int) give_stripelem_index(seq, cfra); - if (nr == -1 || se == 0) return 0; + if (nr == -1 || se == NULL) return NULL; se += nr + seq->anim_startofs; } @@ -1076,7 +1077,7 @@ static int get_shown_sequences( ListBase * seqbasep, int cfra, int chanshown, Se if(evaluate_seq_frame_gen(seq_arr, seqbasep, cfra)) { if (b > 0) { - if (seq_arr[b] == 0) { + if (seq_arr[b] == NULL) { return 0; } } else { @@ -1173,38 +1174,38 @@ static struct ImBuf * seq_proxy_fetch(SeqRenderData context, Sequence * seq, int char name[PROXY_MAXFILE]; if (!(seq->flag & SEQ_USE_PROXY)) { - return 0; + return NULL; } /* rendering at 100% ? No real sense in proxy-ing, right? */ if (context.preview_render_size == 100) { - return 0; + return NULL; } if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) { int frameno = (int) give_stripelem_index(seq, cfra) + seq->anim_startofs; if (seq->strip->proxy->anim == NULL) { if (seq_proxy_get_fname(context, seq, cfra, name)==0) { - return 0; + return NULL; } seq->strip->proxy->anim = openanim(name, IB_rect); } if (seq->strip->proxy->anim==NULL) { - return 0; + return NULL; } return IMB_anim_absolute(seq->strip->proxy->anim, frameno); } if (seq_proxy_get_fname(context, seq, cfra, name) == 0) { - return 0; + return NULL; } if (BLI_exists(name)) { return IMB_loadiffname(name, IB_rect); } else { - return 0; + return NULL; } } @@ -1659,7 +1660,7 @@ static ImBuf * input_preprocess( } if(seq->flag & SEQ_MAKE_PREMUL) { - if(ibuf->depth == 32 && ibuf->zbuf == 0) { + if(ibuf->depth == 32 && ibuf->zbuf == NULL) { IMB_premultiply_alpha(ibuf); } } @@ -1678,8 +1679,8 @@ static ImBuf * input_preprocess( static ImBuf * copy_from_ibuf_still(SeqRenderData context, Sequence * seq, float nr) { - ImBuf * rval = 0; - ImBuf * ibuf = 0; + ImBuf * rval = NULL; + ImBuf * ibuf = NULL; if (nr == 0) { ibuf = seq_stripelem_cache_get( @@ -1828,7 +1829,7 @@ static ImBuf* seq_render_effect_strip_impl( static ImBuf * seq_render_scene_strip_impl( SeqRenderData context, Sequence * seq, float nr) { - ImBuf * ibuf = 0; + ImBuf * ibuf = NULL; float frame= seq->sfra + nr + seq->anim_startofs; float oldcfra; Object *oldcamera; @@ -2065,7 +2066,7 @@ static ImBuf * seq_render_strip(SeqRenderData context, Sequence * seq, float cfr } case SEQ_MOVIE: { - if(seq->anim==0) { + if(seq->anim==NULL) { BLI_join_dirfile(name, sizeof(name), seq->strip->dir, seq->strip->stripdata->name); BLI_path_abs(name, G.main->name); @@ -2248,11 +2249,11 @@ static ImBuf* seq_render_strip_stack( if (swap_input) { out = sh.execute(context, seq, cfra, facf, facf, - ibuf2, ibuf1, 0); + ibuf2, ibuf1, NULL); } else { out = sh.execute(context, seq, cfra, facf, facf, - ibuf1, ibuf2, 0); + ibuf1, ibuf2, NULL); } IMB_freeImBuf(ibuf1); @@ -2641,7 +2642,7 @@ ImBuf *give_ibuf_seq_threaded(SeqRenderData context, float cfra, int chanshown) } } - return e ? e->ibuf : 0; + return e ? e->ibuf : NULL; } /* Functions to free imbuf and anim data on changes */ @@ -2650,7 +2651,7 @@ static void free_anim_seq(Sequence *seq) { if(seq->anim) { IMB_free_anim(seq->anim); - seq->anim = 0; + seq->anim = NULL; } } @@ -3541,7 +3542,7 @@ static Sequence *seq_dupli(struct Scene *scene, struct Scene *scene_to, Sequence if (seq->strip->proxy) { seqn->strip->proxy = MEM_dupallocN(seq->strip->proxy); - seqn->strip->proxy->anim = 0; + seqn->strip->proxy->anim = NULL; } if (seq->strip->color_balance) { @@ -3550,19 +3551,19 @@ static Sequence *seq_dupli(struct Scene *scene, struct Scene *scene_to, Sequence } if(seq->type==SEQ_META) { - seqn->strip->stripdata = 0; + seqn->strip->stripdata = NULL; - seqn->seqbase.first= seqn->seqbase.last= 0; + seqn->seqbase.first= seqn->seqbase.last= NULL; /* WATCH OUT!!! - This metastrip is not recursively duplicated here - do this after!!! */ /* - seq_dupli_recursive(&seq->seqbase,&seqn->seqbase);*/ } else if(seq->type == SEQ_SCENE) { - seqn->strip->stripdata = 0; + seqn->strip->stripdata = NULL; if(seq->scene_sound) seqn->scene_sound = sound_scene_add_scene_sound(sce_audio, seqn, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs); } else if(seq->type == SEQ_MOVIE) { seqn->strip->stripdata = MEM_dupallocN(seq->strip->stripdata); - seqn->anim= 0; + seqn->anim= NULL; } else if(seq->type == SEQ_SOUND) { seqn->strip->stripdata = MEM_dupallocN(seq->strip->stripdata); @@ -3585,7 +3586,7 @@ static Sequence *seq_dupli(struct Scene *scene, struct Scene *scene_to, Sequence sh.copy(seq, seqn); } - seqn->strip->stripdata = 0; + seqn->strip->stripdata = NULL; } else { fprintf(stderr, "Aiiiiekkk! sequence type not " @@ -3620,7 +3621,7 @@ Sequence * seq_dupli_recursive(struct Scene *scene, struct Scene *scene_to, Sequ void seqbase_dupli_recursive(Scene *scene, Scene *scene_to, ListBase *nseqbase, ListBase *seqbase, int dupe_flag) { Sequence *seq; - Sequence *seqn = 0; + Sequence *seqn = NULL; Sequence *last_seq = seq_active_get(scene); for(seq= seqbase->first; seq; seq= seq->next) { diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 48d9a4e0dee..29c29fb5158 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -102,7 +102,7 @@ void space_transform_from_matrixs(SpaceTransform *data, float local[4][4], float { float itarget[4][4]; invert_m4_m4(itarget, target); - mul_serie_m4(data->local2target, itarget, local, 0, 0, 0, 0, 0, 0); + mul_serie_m4(data->local2target, itarget, local, NULL, NULL, NULL, NULL, NULL, NULL); invert_m4_m4(data->target2local, data->local2target); } diff --git a/source/blender/blenkernel/intern/sketch.c b/source/blender/blenkernel/intern/sketch.c index 06c6e0f197a..1d5f9b4c463 100644 --- a/source/blender/blenkernel/intern/sketch.c +++ b/source/blender/blenkernel/intern/sketch.c @@ -54,7 +54,7 @@ void freeSketch(SK_Sketch *sketch) MEM_freeN(sketch); } -SK_Sketch* createSketch() +SK_Sketch* createSketch(void) { SK_Sketch *sketch; @@ -102,7 +102,7 @@ void sk_freeStroke(SK_Stroke *stk) MEM_freeN(stk); } -SK_Stroke* sk_createStroke() +SK_Stroke* sk_createStroke(void) { SK_Stroke *stk; diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 19f7884b4cf..ca8df76311d 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -161,7 +161,7 @@ typedef struct SB_thread_context { #define BFF_CLOSEVERT 2 /* collider vertex repulses face */ -float SoftHeunTol = 1.0f; /* humm .. this should be calculated from sb parameters and sizes */ +static float SoftHeunTol = 1.0f; /* humm .. this should be calculated from sb parameters and sizes */ /* local prototypes */ static void free_softbody_intern(SoftBody *sb); @@ -261,7 +261,7 @@ float operations still /* just an ID here to reduce the prob for killing objects ** ob->sumohandle points to we should not kill :) */ -const int CCD_SAVETY = 190561; +static const int CCD_SAVETY = 190561; typedef struct ccdf_minmax{ float minx,miny,minz,maxx,maxy,maxz; @@ -549,7 +549,7 @@ static void ccd_build_deflector_hash(Scene *scene, Object *vertexowner, GHash *h } /*+++ only with deflecting set */ - if(ob->pd && ob->pd->deflect && BLI_ghash_lookup(hash, ob) == 0) { + if(ob->pd && ob->pd->deflect && BLI_ghash_lookup(hash, ob) == NULL) { DerivedMesh *dm= NULL; if(ob->softflag & OB_SB_COLLFINAL) /* so maybe someone wants overkill to collide with subsurfed */ @@ -1655,7 +1655,7 @@ static void *exec_scan_for_ext_spring_forces(void *data) { SB_thread_context *pctx = (SB_thread_context*)data; _scan_for_ext_spring_forces(pctx->scene, pctx->ob, pctx->timenow, pctx->ifirst, pctx->ilast, pctx->do_effector); - return 0; + return NULL; } static void sb_sfesf_threads_run(Scene *scene, struct Object *ob, float timenow,int totsprings,int *UNUSED(ptr_to_break_func(void))) @@ -2382,7 +2382,7 @@ static void *exec_softbody_calc_forces(void *data) { SB_thread_context *pctx = (SB_thread_context*)data; _softbody_calc_forces_slice_in_a_thread(pctx->scene, pctx->ob, pctx->forcetime, pctx->timenow, pctx->ifirst, pctx->ilast, NULL, pctx->do_effector,pctx->do_deflector,pctx->fieldfactor,pctx->windfactor); - return 0; + return NULL; } static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float timenow,int totpoint,int *UNUSED(ptr_to_break_func(void)),struct ListBase *do_effector,int do_deflector,float fieldfactor, float windfactor) @@ -3822,7 +3822,7 @@ void SB_estimate_transform(Object *ob,float lloc[3],float lrot[3][3],float lscal { BodyPoint *bp; ReferenceVert *rp; - SoftBody *sb = 0; + SoftBody *sb = NULL; float (*opos)[3]; float (*rpos)[3]; float com[3],rcom[3]; diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 3dc2221e0c8..be6c4d22f9c 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -74,7 +74,7 @@ void sound_force_device(int device) force_device = device; } -void sound_init_once() +void sound_init_once(void) { AUD_initOnce(); } @@ -115,7 +115,7 @@ void sound_init(struct Main *bmain) #endif } -void sound_exit() +void sound_exit(void) { AUD_exit(); } @@ -382,7 +382,7 @@ void sound_move_scene_sound(struct Scene *scene, void* handle, int startframe, i AUD_moveSequencer(scene->sound_scene, handle, startframe / FPS, endframe / FPS, frameskip / FPS); } -void sound_start_play_scene(struct Scene *scene) +static void sound_start_play_scene(struct Scene *scene) { scene->sound_scene_handle = AUD_play(scene->sound_scene, 1); AUD_setLoop(scene->sound_scene_handle, -1); diff --git a/source/blender/blenkernel/intern/suggestions.c b/source/blender/blenkernel/intern/suggestions.c index 7d39203cefc..b506ac55371 100644 --- a/source/blender/blenkernel/intern/suggestions.c +++ b/source/blender/blenkernel/intern/suggestions.c @@ -77,7 +77,7 @@ static void txttl_free_docs(void) { /* General tool functions */ /**************************/ -void free_texttools() { +void free_texttools(void) { txttl_free_suggest(); txttl_free_docs(); } @@ -191,15 +191,15 @@ void texttool_suggest_prefix(const char *prefix) { } } -void texttool_suggest_clear() { +void texttool_suggest_clear(void) { txttl_free_suggest(); } -SuggItem *texttool_suggest_first() { +SuggItem *texttool_suggest_first(void) { return suggestions.firstmatch; } -SuggItem *texttool_suggest_last() { +SuggItem *texttool_suggest_last(void) { return suggestions.lastmatch; } @@ -207,11 +207,11 @@ void texttool_suggest_select(SuggItem *sel) { suggestions.selected = sel; } -SuggItem *texttool_suggest_selected() { +SuggItem *texttool_suggest_selected(void) { return suggestions.selected; } -int *texttool_suggest_top() { +int *texttool_suggest_top(void) { return &suggestions.top; } @@ -243,10 +243,10 @@ void texttool_docs_show(const char *docs) { documentation[len] = '\0'; } -char *texttool_docs_get() { +char *texttool_docs_get(void) { return documentation; } -void texttool_docs_clear() { +void texttool_docs_clear(void) { txttl_free_docs(); } diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 0129e709505..6bd64e1e2f5 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -93,14 +93,14 @@ void open_plugin_tex(PluginTex *pit) int (*version)(void); /* init all the happy variables */ - pit->doit= 0; - pit->pname= 0; - pit->stnames= 0; - pit->varstr= 0; - pit->result= 0; - pit->cfra= 0; + pit->doit= NULL; + pit->pname= NULL; + pit->stnames= NULL; + pit->varstr= NULL; + pit->result= NULL; + pit->cfra= NULL; pit->version= 0; - pit->instance_init= 0; + pit->instance_init= NULL; /* clear the error list */ PIL_dynlib_get_error_as_string(NULL); @@ -113,12 +113,12 @@ void open_plugin_tex(PluginTex *pit) pit->handle= PIL_dynlib_open(pit->name); if(test_dlerr(pit->name, pit->name)) return; - if (pit->handle != 0) { + if (pit->handle != NULL) { /* find the address of the version function */ version= (int (*)(void)) PIL_dynlib_find_symbol(pit->handle, "plugin_tex_getversion"); if (test_dlerr(pit->name, "plugin_tex_getversion")) return; - if (version != 0) { + if (version != NULL) { pit->version= version(); if( pit->version >= 2 && pit->version <=6) { int (*info_func)(PluginInfo *); @@ -168,8 +168,8 @@ PluginTex *add_plugin_tex(char *str) strcpy(pit->name, str); open_plugin_tex(pit); - if(pit->doit==0) { - if(pit->handle==0) {;} //XXX error("no plugin: %s", str); + if(pit->doit==NULL) { + if(pit->handle==NULL) {;} //XXX error("no plugin: %s", str); else {;} //XXX error("in plugin: %s", str); MEM_freeN(pit); return NULL; @@ -193,7 +193,7 @@ PluginTex *add_plugin_tex(char *str) void free_plugin_tex(PluginTex *pit) { - if(pit==0) return; + if(pit==NULL) return; /* no PIL_dynlib_close: same plugin can be opened multiple times, 1 handle */ MEM_freeN(pit); @@ -619,7 +619,7 @@ void default_mtex(MTex *mtex) { mtex->texco= TEXCO_ORCO; mtex->mapto= MAP_COL; - mtex->object= 0; + mtex->object= NULL; mtex->projx= PROJ_X; mtex->projy= PROJ_Y; mtex->projz= PROJ_Z; @@ -630,7 +630,7 @@ void default_mtex(MTex *mtex) mtex->size[0]= 1.0; mtex->size[1]= 1.0; mtex->size[2]= 1.0; - mtex->tex= 0; + mtex->tex= NULL; mtex->texflag= MTEX_3TAP_BUMP | MTEX_BUMP_OBJECTSPACE; mtex->colormodel= 0; mtex->r= 1.0; @@ -681,7 +681,7 @@ void default_mtex(MTex *mtex) /* ------------------------------------------------------------------------- */ -MTex *add_mtex() +MTex *add_mtex(void) { MTex *mtex; @@ -743,7 +743,7 @@ Tex *copy_texture(Tex *tex) texn= copy_libblock(tex); if(texn->type==TEX_IMAGE) id_us_plus((ID *)texn->ima); - else texn->ima= 0; + else texn->ima= NULL; #if 0 // XXX old animation system id_us_plus((ID *)texn->ipo); @@ -786,19 +786,19 @@ void make_local_texture(Tex *tex) * - mixed: make copy */ - if(tex->id.lib==0) return; + if(tex->id.lib==NULL) return; /* special case: ima always local immediately */ if(tex->ima) { - tex->ima->id.lib= 0; + tex->ima->id.lib= NULL; tex->ima->id.flag= LIB_LOCAL; - new_id(0, (ID *)tex->ima, 0); + new_id(NULL, (ID *)tex->ima, NULL); } if(tex->id.us==1) { - tex->id.lib= 0; + tex->id.lib= NULL; tex->id.flag= LIB_LOCAL; - new_id(0, (ID *)tex, 0); + new_id(NULL, (ID *)tex, NULL); return; } @@ -843,9 +843,9 @@ void make_local_texture(Tex *tex) } if(local && lib==0) { - tex->id.lib= 0; + tex->id.lib= NULL; tex->id.flag= LIB_LOCAL; - new_id(0, (ID *)tex, 0); + new_id(NULL, (ID *)tex, NULL); } else if(local && lib) { texn= copy_texture(tex); @@ -855,7 +855,7 @@ void make_local_texture(Tex *tex) while(ma) { for(a=0; a<MAX_MTEX; a++) { if(ma->mtex[a] && ma->mtex[a]->tex==tex) { - if(ma->id.lib==0) { + if(ma->id.lib==NULL) { ma->mtex[a]->tex= texn; texn->id.us++; tex->id.us--; @@ -868,7 +868,7 @@ void make_local_texture(Tex *tex) while(la) { for(a=0; a<MAX_MTEX; a++) { if(la->mtex[a] && la->mtex[a]->tex==tex) { - if(la->id.lib==0) { + if(la->id.lib==NULL) { la->mtex[a]->tex= texn; texn->id.us++; tex->id.us--; @@ -881,7 +881,7 @@ void make_local_texture(Tex *tex) while(wrld) { for(a=0; a<MAX_MTEX; a++) { if(wrld->mtex[a] && wrld->mtex[a]->tex==tex) { - if(wrld->id.lib==0) { + if(wrld->id.lib==NULL) { wrld->mtex[a]->tex= texn; texn->id.us++; tex->id.us--; @@ -893,7 +893,7 @@ void make_local_texture(Tex *tex) br= bmain->brush.first; while(br) { if(br->mtex.tex==tex) { - if(br->id.lib==0) { + if(br->id.lib==NULL) { br->mtex.tex= texn; texn->id.us++; tex->id.us--; @@ -943,8 +943,8 @@ Tex *give_current_object_texture(Object *ob) Material *ma; Tex *tex= NULL; - if(ob==0) return 0; - if(ob->totcol==0 && !(ob->type==OB_LAMP)) return 0; + if(ob==NULL) return NULL; + if(ob->totcol==0 && !(ob->type==OB_LAMP)) return NULL; if(ob->type==OB_LAMP) { tex= give_current_lamp_texture(ob->data); @@ -1124,7 +1124,7 @@ Tex *give_current_world_texture(World *world) MTex *mtex= NULL; Tex *tex= NULL; - if(!world) return 0; + if(!world) return NULL; mtex= world->mtex[(int)(world->texact)]; if(mtex) tex= mtex->tex; @@ -1175,7 +1175,7 @@ Tex *give_current_particle_texture(ParticleSettings *part) MTex *mtex= NULL; Tex *tex= NULL; - if(!part) return 0; + if(!part) return NULL; mtex= part->mtex[(int)(part->texact)]; if(mtex) tex= mtex->tex; diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index 1b04589c1f2..c3a34e1942f 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -264,10 +264,10 @@ static struct bUnitCollection buNaturalRotCollection = {buNaturalRotDef, 0, 0, s #define UNIT_SYSTEM_TOT (((sizeof(bUnitSystems) / 9) / sizeof(void *)) - 1) static struct bUnitCollection *bUnitSystems[][9] = { - {0, 0, 0, 0, 0, &buNaturalRotCollection, &buNaturalTimeCollecton, 0, 0}, - {0, &buMetricLenCollecton, &buMetricAreaCollecton, &buMetricVolCollecton, &buMetricMassCollecton, &buNaturalRotCollection, &buNaturalTimeCollecton, &buMetricVelCollecton, &buMetricAclCollecton}, /* metric */ - {0, &buImperialLenCollecton, &buImperialAreaCollecton, &buImperialVolCollecton, &buImperialMassCollecton, &buNaturalRotCollection, &buNaturalTimeCollecton, &buImperialVelCollecton, &buImperialAclCollecton}, /* imperial */ - {0, 0, 0, 0, 0, 0, 0, 0, 0} + {NULL, NULL, NULL, NULL, NULL, &buNaturalRotCollection, &buNaturalTimeCollecton, NULL, NULL}, + {NULL, &buMetricLenCollecton, &buMetricAreaCollecton, &buMetricVolCollecton, &buMetricMassCollecton, &buNaturalRotCollection, &buNaturalTimeCollecton, &buMetricVelCollecton, &buMetricAclCollecton}, /* metric */ + {NULL, &buImperialLenCollecton, &buImperialAreaCollecton, &buImperialVolCollecton, &buImperialMassCollecton, &buNaturalRotCollection, &buNaturalTimeCollecton, &buImperialVelCollecton, &buImperialAclCollecton}, /* imperial */ + {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL} }; diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c index a86b039e918..5412e44f0eb 100644 --- a/source/blender/blenkernel/intern/world.c +++ b/source/blender/blenkernel/intern/world.c @@ -38,6 +38,7 @@ #include "DNA_scene_types.h" #include "DNA_texture_types.h" +#include "BKE_world.h" #include "BKE_library.h" #include "BKE_animsys.h" #include "BKE_global.h" @@ -136,11 +137,11 @@ void make_local_world(World *wrld) * - mixed: make copy */ - if(wrld->id.lib==0) return; + if(wrld->id.lib==NULL) return; if(wrld->id.us==1) { - wrld->id.lib= 0; + wrld->id.lib= NULL; wrld->id.flag= LIB_LOCAL; - new_id(0, (ID *)wrld, 0); + new_id(NULL, (ID *)wrld, NULL); return; } @@ -156,7 +157,7 @@ void make_local_world(World *wrld) if(local && lib==0) { wrld->id.lib= 0; wrld->id.flag= LIB_LOCAL; - new_id(0, (ID *)wrld, 0); + new_id(NULL, (ID *)wrld, NULL); } else if(local && lib) { wrldn= copy_world(wrld); @@ -165,7 +166,7 @@ void make_local_world(World *wrld) sce= bmain->scene.first; while(sce) { if(sce->world==wrld) { - if(sce->id.lib==0) { + if(sce->id.lib==NULL) { sce->world= wrldn; wrldn->id.us++; wrld->id.us--; |