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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-02-13 13:52:18 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-13 13:52:18 +0300
commit0955c664aa7c5fc5f0bd345c58219c40f04ab9c1 (patch)
tree20b6a2ab2e1130d75d119eba09f3b195a33a9434 /source/blender
parentf3bd89b1b7a86778ff4c633a6b4115309a1b3c7e (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')
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c8
-rw-r--r--source/blender/blenfont/intern/blf_internal.h47
-rw-r--r--source/blender/blenfont/intern/blf_lang.c12
-rw-r--r--source/blender/blenfont/intern/blf_util.c1
-rw-r--r--source/blender/blenkernel/BKE_key.h6
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf.c4
-rw-r--r--source/blender/blenkernel/intern/action.c12
-rw-r--r--source/blender/blenkernel/intern/anim.c21
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c6
-rw-r--r--source/blender/blenkernel/intern/armature.c12
-rw-r--r--source/blender/blenkernel/intern/blender.c6
-rw-r--r--source/blender/blenkernel/intern/bmfont.c1
-rw-r--r--source/blender/blenkernel/intern/brush.c18
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c22
-rw-r--r--source/blender/blenkernel/intern/collision.c8
-rw-r--r--source/blender/blenkernel/intern/constraint.c2
-rw-r--r--source/blender/blenkernel/intern/context.c4
-rw-r--r--source/blender/blenkernel/intern/curve.c53
-rw-r--r--source/blender/blenkernel/intern/customdata.c14
-rw-r--r--source/blender/blenkernel/intern/deform.c2
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c2
-rw-r--r--source/blender/blenkernel/intern/displist.c20
-rw-r--r--source/blender/blenkernel/intern/effect.c8
-rw-r--r--source/blender/blenkernel/intern/exotic.c9
-rw-r--r--source/blender/blenkernel/intern/fcurve.c4
-rw-r--r--source/blender/blenkernel/intern/font.c28
-rw-r--r--source/blender/blenkernel/intern/icons.c22
-rw-r--r--source/blender/blenkernel/intern/idcode.c2
-rw-r--r--source/blender/blenkernel/intern/idprop.c6
-rw-r--r--source/blender/blenkernel/intern/image.c10
-rw-r--r--source/blender/blenkernel/intern/image_gen.c2
-rw-r--r--source/blender/blenkernel/intern/ipo.c2
-rw-r--r--source/blender/blenkernel/intern/key.c24
-rw-r--r--source/blender/blenkernel/intern/lattice.c12
-rw-r--r--source/blender/blenkernel/intern/library.c18
-rw-r--r--source/blender/blenkernel/intern/material.c36
-rw-r--r--source/blender/blenkernel/intern/mball.c52
-rw-r--r--source/blender/blenkernel/intern/mesh.c38
-rw-r--r--source/blender/blenkernel/intern/modifier.c2
-rw-r--r--source/blender/blenkernel/intern/multires.c8
-rw-r--r--source/blender/blenkernel/intern/nla.c4
-rw-r--r--source/blender/blenkernel/intern/node.c8
-rw-r--r--source/blender/blenkernel/intern/object.c38
-rw-r--r--source/blender/blenkernel/intern/packedFile.c4
-rw-r--r--source/blender/blenkernel/intern/particle.c20
-rw-r--r--source/blender/blenkernel/intern/particle_system.c11
-rw-r--r--source/blender/blenkernel/intern/property.c4
-rw-r--r--source/blender/blenkernel/intern/sca.c14
-rw-r--r--source/blender/blenkernel/intern/screen.c2
-rw-r--r--source/blender/blenkernel/intern/seqcache.c28
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c60
-rw-r--r--source/blender/blenkernel/intern/sequencer.c65
-rw-r--r--source/blender/blenkernel/intern/shrinkwrap.c2
-rw-r--r--source/blender/blenkernel/intern/sketch.c4
-rw-r--r--source/blender/blenkernel/intern/softbody.c12
-rw-r--r--source/blender/blenkernel/intern/sound.c6
-rw-r--r--source/blender/blenkernel/intern/suggestions.c16
-rw-r--r--source/blender/blenkernel/intern/texture.c62
-rw-r--r--source/blender/blenkernel/intern/unit.c8
-rw-r--r--source/blender/blenkernel/intern/world.c11
-rw-r--r--source/blender/blenlib/BLI_ghash.h2
-rw-r--r--source/blender/blenlib/intern/BLI_args.c2
-rw-r--r--source/blender/blenlib/intern/BLI_ghash.c2
-rw-r--r--source/blender/blenlib/intern/BLI_heap.c2
-rw-r--r--source/blender/blenlib/intern/BLI_kdopbvh.c6
-rw-r--r--source/blender/blenlib/intern/BLI_kdtree.c4
-rw-r--r--source/blender/blenlib/intern/bpath.c4
-rw-r--r--source/blender/blenlib/intern/freetypefont.c4
-rw-r--r--source/blender/blenlib/intern/graph.c4
-rw-r--r--source/blender/blenlib/intern/listbase.c14
-rw-r--r--source/blender/blenlib/intern/math_geom.c2
-rw-r--r--source/blender/blenlib/intern/math_matrix.c6
-rw-r--r--source/blender/blenlib/intern/math_rotation.c2
-rw-r--r--source/blender/blenloader/intern/readfile.c62
-rw-r--r--source/blender/blenloader/intern/writefile.c4
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c14
-rw-r--r--source/blender/editors/animation/anim_channels_edit.c34
-rw-r--r--source/blender/editors/animation/anim_draw.c4
-rw-r--r--source/blender/editors/animation/anim_filter.c2
-rw-r--r--source/blender/editors/animation/anim_ipo_utils.c4
-rw-r--r--source/blender/editors/animation/anim_markers.c4
-rw-r--r--source/blender/editors/animation/anim_ops.c9
-rw-r--r--source/blender/editors/animation/drivers.c13
-rw-r--r--source/blender/editors/animation/keyframing.c4
-rw-r--r--source/blender/editors/animation/keyingsets.c4
-rw-r--r--source/blender/editors/armature/editarmature.c4
-rw-r--r--source/blender/editors/armature/editarmature_retarget.c10
-rw-r--r--source/blender/editors/curve/editcurve.c1
-rw-r--r--source/blender/editors/include/ED_types.h4
-rw-r--r--source/blender/editors/object/object_edit.c10
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c6
-rw-r--r--source/blender/editors/space_console/console_draw.c4
-rw-r--r--source/blender/editors/space_script/script_header.c6
-rw-r--r--source/blender/editors/space_view3d/drawobject.c8
-rw-r--r--source/blender/editors/transform/transform.c16
-rw-r--r--source/blender/editors/transform/transform_conversions.c6
-rw-r--r--source/blender/makesdna/DNA_scene_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_object.c2
-rw-r--r--source/blender/modifiers/intern/MOD_shapekey.c24
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_image.c2
-rw-r--r--source/blender/python/generic/IDProp.c48
-rw-r--r--source/blender/python/generic/bgl.c14
-rw-r--r--source/blender/python/generic/blf_py_api.c10
-rw-r--r--source/blender/python/generic/bpy_internal_import.c2
-rw-r--r--source/blender/python/generic/mathutils.c12
-rw-r--r--source/blender/python/generic/mathutils_color.c62
-rw-r--r--source/blender/python/generic/mathutils_euler.c62
-rw-r--r--source/blender/python/generic/mathutils_geometry.c10
-rw-r--r--source/blender/python/generic/mathutils_matrix.c140
-rw-r--r--source/blender/python/generic/mathutils_quat.c108
-rw-r--r--source/blender/python/generic/mathutils_vector.c72
-rw-r--r--source/blender/python/generic/noise.c14
-rw-r--r--source/blender/python/intern/bpy.c3
-rw-r--r--source/blender/python/intern/bpy_app.c4
-rw-r--r--source/blender/python/intern/bpy_interface.c4
-rw-r--r--source/blender/python/intern/bpy_props.c10
-rw-r--r--source/blender/python/intern/bpy_rna.c16
-rw-r--r--source/blender/python/intern/bpy_rna_callback.c3
-rw-r--r--source/blender/python/intern/bpy_rna_callback.h4
-rw-r--r--source/blender/python/intern/bpy_util.c2
-rw-r--r--source/blender/python/intern/bpy_util.h2
-rw-r--r--source/blender/render/intern/source/convertblender.c2
-rw-r--r--source/blender/render/intern/source/render_texture.c8
-rw-r--r--source/blender/render/intern/source/strand.c2
124 files changed, 947 insertions, 927 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index c36496fb542..8d13975b83a 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -205,7 +205,7 @@ GlyphBLF *blf_glyph_search(GlyphCacheBLF *gc, unsigned int c)
return(NULL);
}
-GlyphBLF *blf_glyph_add(FontBLF *font, FT_UInt index, unsigned int c)
+GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
{
FT_GlyphSlot slot;
GlyphBLF *g;
@@ -220,9 +220,9 @@ GlyphBLF *blf_glyph_add(FontBLF *font, FT_UInt index, unsigned int c)
return(g);
if (sharp)
- err = FT_Load_Glyph(font->face, index, FT_LOAD_TARGET_MONO);
+ err = FT_Load_Glyph(font->face, (FT_UInt)index, FT_LOAD_TARGET_MONO);
else
- err = FT_Load_Glyph(font->face, index, FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); /* Sure about NO_* flags? */
+ err = FT_Load_Glyph(font->face, (FT_UInt)index, FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); /* Sure about NO_* flags? */
if (err)
return(NULL);
@@ -249,7 +249,7 @@ GlyphBLF *blf_glyph_add(FontBLF *font, FT_UInt index, unsigned int c)
g->next= NULL;
g->prev= NULL;
g->c= c;
- g->idx= index;
+ g->idx= (FT_UInt)index;
g->tex= 0;
g->build_tex= 0;
g->bitmap= NULL;
diff --git a/source/blender/blenfont/intern/blf_internal.h b/source/blender/blenfont/intern/blf_internal.h
index afe40973269..72d4fc4d54a 100644
--- a/source/blender/blenfont/intern/blf_internal.h
+++ b/source/blender/blenfont/intern/blf_internal.h
@@ -28,6 +28,11 @@
#ifndef BLF_INTERNAL_H
#define BLF_INTERNAL_H
+struct FontBLF;
+struct GlyphBLF;
+struct GlyphCacheBLF;
+struct rctf;
+
unsigned int blf_next_p2(unsigned int x);
unsigned int blf_hash(unsigned int val);
int blf_utf8_next(unsigned char *buf, int *iindex);
@@ -39,30 +44,30 @@ int blf_dir_split(const char *str, char *file, int *size);
int blf_font_init(void);
void blf_font_exit(void);
-FontBLF *blf_font_new(const char *name, const char *filename);
-FontBLF *blf_font_new_from_mem(const char *name, unsigned char *mem, int mem_size);
-void blf_font_attach_from_mem(FontBLF *font, const unsigned char *mem, int mem_size);
+struct FontBLF *blf_font_new(const char *name, const char *filename);
+struct FontBLF *blf_font_new_from_mem(const char *name, unsigned char *mem, int mem_size);
+void blf_font_attach_from_mem(struct FontBLF *font, const unsigned char *mem, int mem_size);
-void blf_font_size(FontBLF *font, int size, int dpi);
-void blf_font_draw(FontBLF *font, const char *str, unsigned int len);
-void blf_font_draw_ascii(FontBLF *font, const char *str, unsigned int len);
-void blf_font_buffer(FontBLF *font, const char *str);
-void blf_font_boundbox(FontBLF *font, const char *str, rctf *box);
-void blf_font_width_and_height(FontBLF *font, const char *str, float *width, float *height);
-float blf_font_width(FontBLF *font, const char *str);
-float blf_font_height(FontBLF *font, const char *str);
-float blf_font_fixed_width(FontBLF *font);
-void blf_font_free(FontBLF *font);
+void blf_font_size(struct FontBLF *font, int size, int dpi);
+void blf_font_draw(struct FontBLF *font, const char *str, unsigned int len);
+void blf_font_draw_ascii(struct FontBLF *font, const char *str, unsigned int len);
+void blf_font_buffer(struct FontBLF *font, const char *str);
+void blf_font_boundbox(struct FontBLF *font, const char *str, struct rctf *box);
+void blf_font_width_and_height(struct FontBLF *font, const char *str, float *width, float *height);
+float blf_font_width(struct FontBLF *font, const char *str);
+float blf_font_height(struct FontBLF *font, const char *str);
+float blf_font_fixed_width(struct FontBLF *font);
+void blf_font_free(struct FontBLF *font);
-GlyphCacheBLF *blf_glyph_cache_find(FontBLF *font, int size, int dpi);
-GlyphCacheBLF *blf_glyph_cache_new(FontBLF *font);
-void blf_glyph_cache_clear(FontBLF *font);
-void blf_glyph_cache_free(GlyphCacheBLF *gc);
+struct GlyphCacheBLF *blf_glyph_cache_find(struct FontBLF *font, int size, int dpi);
+struct GlyphCacheBLF *blf_glyph_cache_new(struct FontBLF *font);
+void blf_glyph_cache_clear(struct FontBLF *font);
+void blf_glyph_cache_free(struct GlyphCacheBLF *gc);
-GlyphBLF *blf_glyph_search(GlyphCacheBLF *gc, unsigned int c);
-GlyphBLF *blf_glyph_add(FontBLF *font, FT_UInt index, unsigned int c);
+struct GlyphBLF *blf_glyph_search(struct GlyphCacheBLF *gc, unsigned int c);
+struct GlyphBLF *blf_glyph_add(struct FontBLF *font, unsigned int index, unsigned int c);
-void blf_glyph_free(GlyphBLF *g);
-int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y);
+void blf_glyph_free(struct GlyphBLF *g);
+int blf_glyph_render(struct FontBLF *font, struct GlyphBLF *g, float x, float y);
#endif /* BLF_INTERNAL_H */
diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c
index ebfb7f4eb65..a0d12359f12 100644
--- a/source/blender/blenfont/intern/blf_lang.c
+++ b/source/blender/blenfont/intern/blf_lang.c
@@ -29,6 +29,8 @@
#include <stdlib.h>
#include <string.h>
+#include "BLF_api.h"
+
#ifdef INTERNATIONAL
#include <locale.h>
@@ -54,9 +56,9 @@
#define FONT_SIZE_DEFAULT 12
/* locale options. */
-char global_messagepath[1024];
-char global_language[32];
-char global_encoding_name[32];
+static char global_messagepath[1024];
+static char global_language[32];
+static char global_encoding_name[32];
void BLF_lang_init(void)
@@ -97,7 +99,7 @@ void BLF_lang_set(const char *str)
BLI_strncpy(global_language, str, sizeof(global_language));
}
-void BLF_lang_encoding(const char *str)
+static void BLF_lang_encoding(const char *str)
{
BLI_strncpy(global_encoding_name, str, sizeof(global_encoding_name));
/* bind_textdomain_codeset(DOMAIN_NAME, encoding_name); */
@@ -110,7 +112,7 @@ void BLF_lang_init(void)
return;
}
-void BLF_lang_encoding(const char *str)
+static void BLF_lang_encoding(const char *str)
{
(void)str;
return;
diff --git a/source/blender/blenfont/intern/blf_util.c b/source/blender/blenfont/intern/blf_util.c
index 30e6e3fd3f5..9316d47cabe 100644
--- a/source/blender/blenfont/intern/blf_util.c
+++ b/source/blender/blenfont/intern/blf_util.c
@@ -30,6 +30,7 @@
#include <stdlib.h>
#include <string.h>
+#include "blf_internal.h"
unsigned int blf_next_p2(unsigned int x)
{
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--;
diff --git a/source/blender/blenlib/BLI_ghash.h b/source/blender/blenlib/BLI_ghash.h
index 46c0f767b5f..a9fc5662657 100644
--- a/source/blender/blenlib/BLI_ghash.h
+++ b/source/blender/blenlib/BLI_ghash.h
@@ -228,7 +228,7 @@ BM_INLINE int BLI_ghash_remove (GHash *gh, void *key, GHashKeyFreeFP keyfreefp,
{
unsigned int hash= gh->hashfp(key)%gh->nbuckets;
Entry *e;
- Entry *p = 0;
+ Entry *p = NULL;
for (e= gh->buckets[hash]; e; e= e->next) {
if (gh->cmpfp(key, e->key)==0) {
diff --git a/source/blender/blenlib/intern/BLI_args.c b/source/blender/blenlib/intern/BLI_args.c
index ff41f76a1f9..4a62e9d26fd 100644
--- a/source/blender/blenlib/intern/BLI_args.c
+++ b/source/blender/blenlib/intern/BLI_args.c
@@ -39,7 +39,7 @@
#include "BLI_args.h"
#include "BLI_ghash.h"
-char NO_DOCS[] = "NO DOCUMENTATION SPECIFIED";
+static char NO_DOCS[] = "NO DOCUMENTATION SPECIFIED";
struct bArgDoc;
typedef struct bArgDoc {
diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c
index a8ca828aa66..541b9ea0ae8 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -90,7 +90,7 @@ void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreef
MEM_freeN(gh->buckets);
BLI_mempool_destroy(gh->entrypool);
- gh->buckets = 0;
+ gh->buckets = NULL;
gh->nentries = 0;
gh->nbuckets = 0;
MEM_freeN(gh);
diff --git a/source/blender/blenlib/intern/BLI_heap.c b/source/blender/blenlib/intern/BLI_heap.c
index f6616ecb06b..7d77e85bfe1 100644
--- a/source/blender/blenlib/intern/BLI_heap.c
+++ b/source/blender/blenlib/intern/BLI_heap.c
@@ -64,7 +64,7 @@ struct Heap {
/***/
-Heap *BLI_heap_new()
+Heap *BLI_heap_new(void)
{
Heap *heap = (Heap*)MEM_callocN(sizeof(Heap), "BLIHeap");
heap->bufsize = 1;
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c
index 4673462f58b..d85950ce22d 100644
--- a/source/blender/blenlib/intern/BLI_kdopbvh.c
+++ b/source/blender/blenlib/intern/BLI_kdopbvh.c
@@ -161,7 +161,7 @@ static float KDOP_AXES[13][3] =
heap[parent] = element; \
}
-int ADJUST_MEMORY(void *local_memblock, void **memblock, int new_size, int *max_size, int size_per_item)
+static int ADJUST_MEMORY(void *local_memblock, void **memblock, int new_size, int *max_size, int size_per_item)
{
int new_max_size = *max_size * 2;
void *new_memblock = NULL;
@@ -1137,11 +1137,11 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, unsigned int
// check for compatibility of both trees (can't compare 14-DOP with 18-DOP)
if((tree1->axis != tree2->axis) && (tree1->axis == 14 || tree2->axis == 14) && (tree1->axis == 18 || tree2->axis == 18))
- return 0;
+ return NULL;
// fast check root nodes for collision before doing big splitting + traversal
if(!tree_overlap(tree1->nodes[tree1->totleaf], tree2->nodes[tree2->totleaf], MIN2(tree1->start_axis, tree2->start_axis), MIN2(tree1->stop_axis, tree2->stop_axis)))
- return 0;
+ return NULL;
data = MEM_callocN(sizeof(BVHOverlapData *)* tree1->tree_type, "BVHOverlapData_star");
diff --git a/source/blender/blenlib/intern/BLI_kdtree.c b/source/blender/blenlib/intern/BLI_kdtree.c
index 0d541c1fe37..8902c580493 100644
--- a/source/blender/blenlib/intern/BLI_kdtree.c
+++ b/source/blender/blenlib/intern/BLI_kdtree.c
@@ -255,7 +255,7 @@ static void add_nearest(KDTreeNearest *ptn, int *found, int n, int index, float
/* finds the nearest n entries in tree to specified coordinates */
int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTreeNearest *nearest)
{
- KDTreeNode *root, *node=0;
+ KDTreeNode *root, *node= NULL;
KDTreeNode **stack, *defaultstack[100];
float cur_dist;
int i, totstack, cur=0, found=0;
@@ -370,7 +370,7 @@ static void add_in_range(KDTreeNearest **ptn, int found, int *totfoundstack, int
}
int BLI_kdtree_range_search(KDTree *tree, float range, float *co, float *nor, KDTreeNearest **nearest)
{
- KDTreeNode *root, *node=0;
+ KDTreeNode *root, *node= NULL;
KDTreeNode **stack, *defaultstack[100];
KDTreeNearest *foundstack=NULL;
float range2 = range*range, dist2;
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c
index b1e5561b0cd..10ee18d5142 100644
--- a/source/blender/blenlib/intern/bpath.c
+++ b/source/blender/blenlib/intern/bpath.c
@@ -141,7 +141,7 @@ void BLI_bpathIterator_init(struct BPathIterator **bpi_pt, Main *bmain, const ch
BLI_bpathIterator_step(bpi);
}
-void BLI_bpathIterator_alloc(struct BPathIterator **bpi) {
+static void BLI_bpathIterator_alloc(struct BPathIterator **bpi) {
*bpi= MEM_mallocN(sizeof(BPathIterator), "BLI_bpathIterator_alloc");
}
@@ -797,7 +797,7 @@ static int findFileRecursive(char *filename_new, const char *dirname, const char
dir= opendir(dirname);
- if (dir==0)
+ if (dir==NULL)
return 0;
if (*filesize == -1)
diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c
index 482ca1c01e5..b34dbb2d5fd 100644
--- a/source/blender/blenlib/intern/freetypefont.c
+++ b/source/blender/blenlib/intern/freetypefont.c
@@ -367,7 +367,7 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf)
// No charmap found from the ttf so we need to figure it out
if(glyph_index == 0)
{
- FT_CharMap found = 0;
+ FT_CharMap found = NULL;
FT_CharMap charmap;
int n;
@@ -477,7 +477,7 @@ VFontData *BLI_vfontdata_from_freetypefont(PackedFile *pf)
err = FT_Init_FreeType( &library);
if(err) {
//XXX error("Failed to load the Freetype font library");
- return 0;
+ return NULL;
}
success = check_freetypefont(pf);
diff --git a/source/blender/blenlib/intern/graph.c b/source/blender/blenlib/intern/graph.c
index e187595aa11..0137826df64 100644
--- a/source/blender/blenlib/intern/graph.c
+++ b/source/blender/blenlib/intern/graph.c
@@ -296,7 +296,7 @@ BNode * BLI_FindNodeByPosition(BGraph *graph, float *p, float limit)
}
/************************************* SUBGRAPH DETECTION **********************************************/
-void flagSubgraph(BNode *node, int subgraph)
+static void flagSubgraph(BNode *node, int subgraph)
{
if (node->subgraph_index == 0)
{
@@ -425,7 +425,7 @@ BArc * BLI_findConnectedArc(BGraph *graph, BArc *arc, BNode *v)
/*********************************** GRAPH AS TREE FUNCTIONS *******************************************/
-int subtreeShape(BNode *node, BArc *rootArc, int include_root)
+static int subtreeShape(BNode *node, BArc *rootArc, int include_root)
{
int depth = 0;
diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c
index b8b0b5b6eda..975479a3875 100644
--- a/source/blender/blenlib/intern/listbase.c
+++ b/source/blender/blenlib/intern/listbase.c
@@ -48,9 +48,9 @@
/* Ripped this from blender.c */
void BLI_movelisttolist(ListBase *dst, ListBase *src)
{
- if (src->first==0) return;
+ if (src->first==NULL) return;
- if (dst->first==0) {
+ if (dst->first==NULL) {
dst->first= src->first;
dst->last= src->last;
}
@@ -59,7 +59,7 @@ void BLI_movelisttolist(ListBase *dst, ListBase *src)
((Link *)src->first)->prev= dst->last;
dst->last= src->last;
}
- src->first= src->last= 0;
+ src->first= src->last= NULL;
}
void BLI_addhead(ListBase *listbase, void *vlink)
@@ -89,7 +89,7 @@ void BLI_addtail(ListBase *listbase, void *vlink)
link->prev = listbase->last;
if (listbase->last) ((Link *)listbase->last)->next = link;
- if (listbase->first == 0) listbase->first = link;
+ if (listbase->first == NULL) listbase->first = link;
listbase->last = link;
}
@@ -152,7 +152,7 @@ void BLI_insertlink(ListBase *listbase, void *vprevlink, void *vnewlink)
/* insert before first element */
if (prevlink == NULL) {
newlink->next= listbase->first;
- newlink->prev= 0;
+ newlink->prev= NULL;
newlink->next->prev= newlink;
listbase->first= newlink;
return;
@@ -251,7 +251,7 @@ void BLI_insertlinkbefore(ListBase *listbase, void *vnextlink, void *vnewlink)
/* insert at end of list */
if (nextlink == NULL) {
newlink->prev= listbase->last;
- newlink->next= 0;
+ newlink->next= NULL;
((Link *)listbase->last)->next= newlink;
listbase->last= newlink;
return;
@@ -422,7 +422,7 @@ void BLI_duplicatelist(ListBase *dst, const ListBase *src)
/* in this order, to ensure it works if dst == src */
src_link= src->first;
- dst->first= dst->last= 0;
+ dst->first= dst->last= NULL;
while(src_link) {
dst_link= MEM_dupallocN(src_link);
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index d7a71f8567c..bb5b3a21770 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -2080,7 +2080,7 @@ pointers may be NULL if not needed
*/
/* can't believe there is none in math utils */
-float _det_m3(float m2[3][3])
+static float _det_m3(float m2[3][3])
{
float det = 0.f;
if (m2){
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index 75134358c31..413ac57dea5 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -242,7 +242,7 @@ void mul_serie_m3(float answ[][3],
{
float temp[3][3];
- if(m1==0 || m2==0) return;
+ if(m1==NULL || m2==NULL) return;
mul_m3_m3m3(answ, m2, m1);
if(m3) {
@@ -275,7 +275,7 @@ void mul_serie_m4(float answ[][4], float m1[][4],
{
float temp[4][4];
- if(m1==0 || m2==0) return;
+ if(m1==NULL || m2==NULL) return;
mul_m4_m4m4(answ, m2, m1);
if(m3) {
@@ -1708,5 +1708,5 @@ void pseudoinverse_m4_m4(float Ainv[4][4], float A[4][4], float epsilon)
transpose_m4(V);
- mul_serie_m4(Ainv, U, Wm, V, 0, 0, 0, 0, 0);
+ mul_serie_m4(Ainv, U, Wm, V, NULL, NULL, NULL, NULL, NULL);
}
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c
index 2038121e3f2..291e7babdbb 100644
--- a/source/blender/blenlib/intern/math_rotation.c
+++ b/source/blender/blenlib/intern/math_rotation.c
@@ -1431,7 +1431,7 @@ void mat4_to_dquat(DualQuat *dq,float basemat[][4], float mat[][4])
mul_m4_m4m4(S, baseRS, baseRinv);
/* set scaling part */
- mul_serie_m4(dq->scale, basemat, S, baseinv, 0, 0, 0, 0, 0);
+ mul_serie_m4(dq->scale, basemat, S, baseinv, NULL, NULL, NULL, NULL, NULL);
dq->scale_weight= 1.0f;
}
else {
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index f6159abd4aa..0958f121fcc 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -422,7 +422,7 @@ static void split_libdata(ListBase *lb, Main *first)
}
mainvar= mainvar->next;
}
- if(mainvar==0) printf("error split_libdata\n");
+ if(mainvar==NULL) printf("error split_libdata\n");
}
id= idnext;
}
@@ -589,7 +589,7 @@ static void bh8_from_bh4(BHead *bhead, BHead4 *bhead4)
static BHeadN *get_bhead(FileData *fd)
{
- BHeadN *new_bhead = 0;
+ BHeadN *new_bhead = NULL;
int readsize;
if (fd) {
@@ -654,7 +654,7 @@ static BHeadN *get_bhead(FileData *fd)
if ( ! fd->eof) {
new_bhead = MEM_mallocN(sizeof(BHeadN) + bhead.len, "new_bhead");
if (new_bhead) {
- new_bhead->next = new_bhead->prev = 0;
+ new_bhead->next = new_bhead->prev = NULL;
new_bhead->bhead = bhead;
readsize = fd->read(fd, new_bhead + 1, bhead.len);
@@ -662,7 +662,7 @@ static BHeadN *get_bhead(FileData *fd)
if (readsize != bhead.len) {
fd->eof = 1;
MEM_freeN(new_bhead);
- new_bhead = 0;
+ new_bhead = NULL;
}
} else {
fd->eof = 1;
@@ -684,13 +684,13 @@ static BHeadN *get_bhead(FileData *fd)
BHead *blo_firstbhead(FileData *fd)
{
BHeadN *new_bhead;
- BHead *bhead = 0;
+ BHead *bhead = NULL;
// Rewind the file
// Read in a new block if necessary
new_bhead = fd->listbase.first;
- if (new_bhead == 0) {
+ if (new_bhead == NULL) {
new_bhead = get_bhead(fd);
}
@@ -721,7 +721,7 @@ BHead *blo_nextbhead(FileData *fd, BHead *thisblock)
// get the next BHeadN. If it doesn't exist we read in the next one
new_bhead = new_bhead->next;
- if (new_bhead == 0) {
+ if (new_bhead == NULL) {
new_bhead = get_bhead(fd);
}
}
@@ -944,7 +944,7 @@ FileData *blo_openblenderfile(const char *name, ReportList *reports)
errno= 0;
gzfile= gzopen(name, "rb");
- if (gzfile == Z_NULL) {
+ if (gzfile == (gzFile)Z_NULL) {
BKE_reportf(reports, RPT_ERROR, "Unable to open \"%s\": %s.", name, errno ? strerror(errno) : "Unknown erro reading file");
return NULL;
} else {
@@ -1007,7 +1007,7 @@ void blo_freefiledata(FileData *fd)
if (fd->buffer && !(fd->flags & FD_FLAGS_NOT_MY_BUFFER)) {
MEM_freeN(fd->buffer);
- fd->buffer = 0;
+ fd->buffer = NULL;
}
// Free all BHeadN data blocks
@@ -1061,7 +1061,7 @@ int BLO_is_a_library(const char *path, char *dir, char *group)
/* Find the last slash */
fd= BLI_last_slash(dir);
- if(fd==0) return 0;
+ if(fd==NULL) return 0;
*fd= 0;
if(BLO_has_bfile_extension(fd+1)) {
/* the last part of the dir is a .blend file, no group follows */
@@ -1310,7 +1310,7 @@ static void link_glob_list(FileData *fd, ListBase *lb) /* for glob data */
Link *ln, *prev;
void *poin;
- if(lb->first==0) return;
+ if(lb->first==NULL) return;
poin= newdataadr(fd, lb->first);
if(lb->first) {
oldnewmap_insert(fd->globmap, lb->first, poin, 0);
@@ -1318,7 +1318,7 @@ static void link_glob_list(FileData *fd, ListBase *lb) /* for glob data */
lb->first= poin;
ln= lb->first;
- prev= 0;
+ prev= NULL;
while(ln) {
poin= newdataadr(fd, ln->next);
if(ln->next) {
@@ -1459,7 +1459,7 @@ static void IDP_DirectLinkGroup(IDProperty *prop, int switch_endian, FileData *f
}
}
-void IDP_DirectLinkProperty(IDProperty *prop, int switch_endian, FileData *fd)
+static void IDP_DirectLinkProperty(IDProperty *prop, int switch_endian, FileData *fd)
{
switch (prop->type) {
case IDP_GROUP:
@@ -1496,7 +1496,7 @@ void IDP_DirectLinkProperty(IDProperty *prop, int switch_endian, FileData *fd)
}
/*stub function*/
-void IDP_LibLinkProperty(IDProperty *UNUSED(prop), int UNUSED(switch_endian), FileData *UNUSED(fd))
+static void IDP_LibLinkProperty(IDProperty *UNUSED(prop), int UNUSED(switch_endian), FileData *UNUSED(fd))
{
}
@@ -2755,7 +2755,7 @@ static void direct_link_curve(FileData *fd, Curve *cu)
if(cu->vfont == NULL) link_list(fd, &(cu->nurb));
else {
- cu->nurb.first=cu->nurb.last= 0;
+ cu->nurb.first=cu->nurb.last= NULL;
tb= MEM_callocN(MAXTEXTBOX*sizeof(TextBox), "TextBoxread");
if (cu->tb) {
@@ -2829,7 +2829,7 @@ static void direct_link_texture(FileData *fd, Tex *tex)
tex->plugin= newdataadr(fd, tex->plugin);
if(tex->plugin) {
- tex->plugin->handle= 0;
+ tex->plugin->handle= NULL;
open_plugin_tex(tex->plugin);
/* initialize data for this instance, if an initialization
* function exists.
@@ -3007,7 +3007,7 @@ static void direct_link_pointcache_list(FileData *fd, ListBase *ptcaches, PointC
}
}
-void lib_link_partdeflect(FileData *fd, ID *id, PartDeflect *pd)
+static void lib_link_partdeflect(FileData *fd, ID *id, PartDeflect *pd)
{
if(pd && pd->tex)
pd->tex=newlibadr_us(fd, id->lib, pd->tex);
@@ -3813,7 +3813,7 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
if (md->type==eModifierType_Subsurf) {
SubsurfModifierData *smd = (SubsurfModifierData*) md;
- smd->emCache = smd->mCache = 0;
+ smd->emCache = smd->mCache = NULL;
}
else if (md->type==eModifierType_Armature) {
ArmatureModifierData *amd = (ArmatureModifierData*) md;
@@ -3848,7 +3848,7 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
fluidmd->fss= newdataadr(fd, fluidmd->fss);
fluidmd->fss->fmd= fluidmd;
- fluidmd->fss->meshSurfNormals = 0;
+ fluidmd->fss->meshSurfNormals = NULL;
}
else if (md->type==eModifierType_Smoke) {
SmokeModifierData *smd = (SmokeModifierData*) md;
@@ -3959,7 +3959,7 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
} else if (md->type==eModifierType_Explode) {
ExplodeModifierData *psmd = (ExplodeModifierData*) md;
- psmd->facepa=0;
+ psmd->facepa=NULL;
}
else if (md->type==eModifierType_MeshDeform) {
MeshDeformModifierData *mmd = (MeshDeformModifierData*) md;
@@ -4126,7 +4126,7 @@ static void direct_link_object(FileData *fd, Object *ob)
prop= ob->prop.first;
while(prop) {
prop->poin= newdataadr(fd, prop->poin);
- if(prop->poin==0) prop->poin= &prop->data;
+ if(prop->poin==NULL) prop->poin= &prop->data;
prop= prop->next;
}
@@ -4273,7 +4273,7 @@ static void lib_link_scene(FileData *fd, Main *main)
BKE_reportf(fd->reports, RPT_ERROR, "LIB ERROR: Object lost from scene:'%s\'\n", sce->id.name+2);
if(G.background==0) printf("LIB ERROR: base removed from scene:'%s\'\n", sce->id.name+2);
BLI_remlink(&sce->base, base);
- if(base==sce->basact) sce->basact= 0;
+ if(base==sce->basact) sce->basact= NULL;
MEM_freeN(base);
}
}
@@ -4296,7 +4296,7 @@ static void lib_link_scene(FileData *fd, Main *main)
seq->scene_sound = sound_add_scene_sound(sce, seq, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs);
}
}
- seq->anim= 0;
+ seq->anim= NULL;
}
SEQ_END
@@ -4356,7 +4356,7 @@ static void direct_link_scene(FileData *fd, Scene *sce)
sce->theDag = NULL;
sce->dagisvalid = 0;
sce->obedit= NULL;
- sce->stats= 0;
+ sce->stats= NULL;
sce->fps_info= NULL;
sound_create_scene(sce);
@@ -4399,7 +4399,7 @@ static void direct_link_scene(FileData *fd, Scene *sce)
seq->seq2= newdataadr(fd, seq->seq2);
seq->seq3= newdataadr(fd, seq->seq3);
/* a patch: after introduction of effects with 3 input strips */
- if(seq->seq3==0) seq->seq3= seq->seq2;
+ if(seq->seq3==NULL) seq->seq3= seq->seq2;
seq->plugin= newdataadr(fd, seq->plugin);
seq->effectdata= newdataadr(fd, seq->effectdata);
@@ -4423,32 +4423,32 @@ static void direct_link_scene(FileData *fd, Scene *sce)
seq->strip->stripdata = newdataadr(
fd, seq->strip->stripdata);
} else {
- seq->strip->stripdata = 0;
+ seq->strip->stripdata = NULL;
}
if (seq->flag & SEQ_USE_CROP) {
seq->strip->crop = newdataadr(
fd, seq->strip->crop);
} else {
- seq->strip->crop = 0;
+ seq->strip->crop = NULL;
}
if (seq->flag & SEQ_USE_TRANSFORM) {
seq->strip->transform = newdataadr(
fd, seq->strip->transform);
} else {
- seq->strip->transform = 0;
+ seq->strip->transform = NULL;
}
if (seq->flag & SEQ_USE_PROXY) {
seq->strip->proxy = newdataadr(
fd, seq->strip->proxy);
- seq->strip->proxy->anim = 0;
+ seq->strip->proxy->anim = NULL;
} else {
- seq->strip->proxy = 0;
+ seq->strip->proxy = NULL;
}
if (seq->flag & SEQ_USE_COLOR_BALANCE) {
seq->strip->color_balance = newdataadr(
fd, seq->strip->color_balance);
} else {
- seq->strip->color_balance = 0;
+ seq->strip->color_balance = NULL;
}
if (seq->strip->color_balance) {
// seq->strip->color_balance->gui = 0; // XXX - peter, is this relevant in 2.5?
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 61b446451e3..e8275dde2af 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -214,8 +214,6 @@ static void writedata_free(WriteData *wd)
/***/
-int mywfile;
-
/**
* Low level WRITE(2) wrapper that buffers data
* @param adr Pointer to new chunk of data
@@ -343,7 +341,7 @@ static void writedata(WriteData *wd, int filecode, int len, void *adr) /* do not
{
BHead bh;
- if(adr==0) return;
+ if(adr==NULL) return;
if(len==0) return;
len+= 3;
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index b2ee2f008f5..583f2f151ac 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -464,7 +464,7 @@ static void *acf_summary_setting_ptr(bAnimListElem *ale, int setting, short *typ
else {
/* can't return anything useful - unsupported */
*type= 0;
- return 0;
+ return NULL;
}
}
@@ -565,7 +565,7 @@ static void *acf_scene_setting_ptr(bAnimListElem *ale, int setting, short *type)
return NULL;
default: /* unsupported */
- return 0;
+ return NULL;
}
}
@@ -709,7 +709,7 @@ static void *acf_object_setting_ptr(bAnimListElem *ale, int setting, short *type
return NULL;
default: /* unsupported */
- return 0;
+ return NULL;
}
}
@@ -990,13 +990,13 @@ static void *acf_fillactd_setting_ptr(bAnimListElem *ale, int setting, short *ty
GET_ACF_FLAG_PTR(adt->flag);
}
else
- return 0;
+ return NULL;
case ACHANNEL_SETTING_EXPAND: /* expanded */
GET_ACF_FLAG_PTR(act->flag);
default: /* unsupported */
- return 0;
+ return NULL;
}
}
@@ -1074,7 +1074,7 @@ static void *acf_filldrivers_setting_ptr(bAnimListElem *ale, int setting, short
GET_ACF_FLAG_PTR(adt->flag);
default: /* unsupported */
- return 0;
+ return NULL;
}
}
@@ -2564,7 +2564,7 @@ static bAnimChannelType *animchannelTypeInfo[ANIMTYPE_NUM_TYPES];
static short ACF_INIT= 1; /* when non-zero, the list needs to be updated */
/* Initialise type info definitions */
-void ANIM_init_channel_typeinfo_data (void)
+static void ANIM_init_channel_typeinfo_data (void)
{
int type= 0;
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index 31209459bde..f08aa4c53e9 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -527,7 +527,7 @@ void ANIM_fcurve_delete_from_animdata (bAnimContext *ac, AnimData *adt, FCurve *
/* ****************** Operator Utilities ********************************** */
/* poll callback for being in an Animation Editor channels list region */
-int animedit_poll_channels_active (bContext *C)
+static int animedit_poll_channels_active (bContext *C)
{
ScrArea *sa= CTX_wm_area(C);
@@ -543,7 +543,7 @@ int animedit_poll_channels_active (bContext *C)
}
/* poll callback for Animation Editor channels list region + not in NLA-tweakmode for NLA */
-int animedit_poll_channels_nla_tweakmode_off (bContext *C)
+static int animedit_poll_channels_nla_tweakmode_off (bContext *C)
{
ScrArea *sa= CTX_wm_area(C);
Scene *scene = CTX_data_scene(C);
@@ -1067,7 +1067,7 @@ static int animchannels_rearrange_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-void ANIM_OT_channels_move (wmOperatorType *ot)
+static void ANIM_OT_channels_move (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Move Channels";
@@ -1170,7 +1170,7 @@ static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
-void ANIM_OT_channels_delete (wmOperatorType *ot)
+static void ANIM_OT_channels_delete (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Delete Channels";
@@ -1247,7 +1247,7 @@ static int animchannels_visibility_set_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
-void ANIM_OT_channels_visibility_set (wmOperatorType *ot)
+static void ANIM_OT_channels_visibility_set (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Set Visibility";
@@ -1320,7 +1320,7 @@ static int animchannels_visibility_toggle_exec(bContext *C, wmOperator *UNUSED(o
return OPERATOR_FINISHED;
}
-void ANIM_OT_channels_visibility_toggle (wmOperatorType *ot)
+static void ANIM_OT_channels_visibility_toggle (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Toggle Visibility";
@@ -1452,7 +1452,7 @@ static int animchannels_setflag_exec(bContext *C, wmOperator *op)
}
-void ANIM_OT_channels_setting_enable (wmOperatorType *ot)
+static void ANIM_OT_channels_setting_enable (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Enable Channel Setting";
@@ -1474,7 +1474,7 @@ void ANIM_OT_channels_setting_enable (wmOperatorType *ot)
ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
}
-void ANIM_OT_channels_setting_disable (wmOperatorType *ot)
+static void ANIM_OT_channels_setting_disable (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Disable Channel Setting";
@@ -1496,7 +1496,7 @@ void ANIM_OT_channels_setting_disable (wmOperatorType *ot)
ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
}
-void ANIM_OT_channels_setting_invert (wmOperatorType *ot)
+static void ANIM_OT_channels_setting_invert (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Invert Channel Setting";
@@ -1518,7 +1518,7 @@ void ANIM_OT_channels_setting_invert (wmOperatorType *ot)
ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
}
-void ANIM_OT_channels_setting_toggle (wmOperatorType *ot)
+static void ANIM_OT_channels_setting_toggle (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Toggle Channel Setting";
@@ -1540,7 +1540,7 @@ void ANIM_OT_channels_setting_toggle (wmOperatorType *ot)
ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
}
-void ANIM_OT_channels_editable_toggle (wmOperatorType *ot)
+static void ANIM_OT_channels_editable_toggle (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Toggle Channel Editability";
@@ -1585,7 +1585,7 @@ static int animchannels_expand_exec (bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-void ANIM_OT_channels_expand (wmOperatorType *ot)
+static void ANIM_OT_channels_expand (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Expand Channels";
@@ -1627,7 +1627,7 @@ static int animchannels_collapse_exec (bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-void ANIM_OT_channels_collapse (wmOperatorType *ot)
+static void ANIM_OT_channels_collapse (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Collapse Channels";
@@ -1694,7 +1694,7 @@ static int animchannels_enable_exec (bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
-void ANIM_OT_channels_fcurves_enable (wmOperatorType *ot)
+static void ANIM_OT_channels_fcurves_enable (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Revive Disabled F-Curves";
@@ -1731,7 +1731,7 @@ static int animchannels_deselectall_exec (bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-void ANIM_OT_channels_select_all_toggle (wmOperatorType *ot)
+static void ANIM_OT_channels_select_all_toggle (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select All";
@@ -1856,7 +1856,7 @@ static int animchannels_borderselect_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-void ANIM_OT_channels_select_border(wmOperatorType *ot)
+static void ANIM_OT_channels_select_border(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Border Select";
@@ -2177,7 +2177,7 @@ static int animchannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent *
return OPERATOR_FINISHED;
}
-void ANIM_OT_channels_click (wmOperatorType *ot)
+static void ANIM_OT_channels_click (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Mouse Click on Channels";
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index dd27de883b3..8a165b9c71b 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -232,7 +232,7 @@ void ANIM_draw_cfra (const bContext *C, View2D *v2d, short flag)
/* Draw dark green line if slow-parenting/time-offset is enabled */
if (flag & DRAWCFRA_SHOW_TIMEOFS) {
- Object *ob= (scene->basact) ? (scene->basact->object) : 0;
+ Object *ob= OBACT;
if(ob) {
float timeoffset= give_timeoffset(ob);
// XXX ob->ipoflag is depreceated!
@@ -352,7 +352,7 @@ static short bezt_nlamapping_apply(KeyframeEditData *ked, BezTriple *bezt)
*/
void ANIM_nla_mapping_apply_fcurve (AnimData *adt, FCurve *fcu, short restore, short only_keys)
{
- KeyframeEditData ked= {{0}};
+ KeyframeEditData ked= {{NULL}};
KeyframeEditFunc map_cb;
/* init edit data
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 6d36daa854c..af168955e32 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -427,7 +427,7 @@ short ANIM_animdata_get_context (const bContext *C, bAnimContext *ac)
/* this function allocates memory for a new bAnimListElem struct for the
* provided animation channel-data.
*/
-bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, short ownertype, ID *owner_id)
+static bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, short ownertype, ID *owner_id)
{
bAnimListElem *ale= NULL;
diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c
index 3e2212c15bb..023fd7e4efe 100644
--- a/source/blender/editors/animation/anim_ipo_utils.c
+++ b/source/blender/editors/animation/anim_ipo_utils.c
@@ -41,10 +41,10 @@
#include "DNA_anim_types.h"
-
-
#include "RNA_access.h"
+#include "ED_anim_api.h"
+
/* ----------------------- Getter functions ----------------------- */
/* Write into "name" buffer, the name of the property (retrieved using RNA from the curve's settings),
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 7e9b52cd4e0..5708c584964 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -205,7 +205,7 @@ void ED_markers_get_minmax (ListBase *markers, short sel, float *first, float *l
/* --------------------------------- */
/* Adds a marker to list of cfra elems */
-void add_marker_to_cfra_elem(ListBase *lb, TimeMarker *marker, short only_sel)
+static void add_marker_to_cfra_elem(ListBase *lb, TimeMarker *marker, short only_sel)
{
CfraElem *ce, *cen;
@@ -269,7 +269,7 @@ TimeMarker *ED_markers_get_first_selected(ListBase *markers)
/* Print debugging prints of list of markers
* BSI's: do NOT make static or put in if-defs as "unused code". That's too much trouble when we need to use for quick debuggging!
*/
-void debug_markers_print_list(ListBase *markers)
+static void debug_markers_print_list(ListBase *markers)
{
TimeMarker *marker;
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c
index 6b0fa30b096..a641b3d1db4 100644
--- a/source/blender/editors/animation/anim_ops.c
+++ b/source/blender/editors/animation/anim_ops.c
@@ -47,6 +47,7 @@
#include "WM_api.h"
#include "WM_types.h"
+#include "ED_anim_api.h"
#include "ED_screen.h"
#include "anim_intern.h"
@@ -153,7 +154,7 @@ static int change_frame_modal(bContext *C, wmOperator *op, wmEvent *event)
return OPERATOR_RUNNING_MODAL;
}
-void ANIM_OT_change_frame(wmOperatorType *ot)
+static void ANIM_OT_change_frame(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Change frame";
@@ -208,7 +209,7 @@ static int previewrange_define_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-void ANIM_OT_previewrange_set(wmOperatorType *ot)
+static void ANIM_OT_previewrange_set(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Set Preview Range";
@@ -255,7 +256,7 @@ static int previewrange_clear_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
-void ANIM_OT_previewrange_clear(wmOperatorType *ot)
+static void ANIM_OT_previewrange_clear(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Clear Preview Range";
@@ -323,7 +324,7 @@ static int toggle_time_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
-void ANIM_OT_time_toggle(wmOperatorType *ot)
+static void ANIM_OT_time_toggle(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Toggle Frames/Seconds";
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index 8d74e7b1b59..e5edce4414a 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -60,6 +60,11 @@
#include "RNA_access.h"
#include "RNA_define.h"
+#include "anim_intern.h"
+
+/* called by WM */
+void free_anim_drivers_copybuf (void);
+
/* ************************************************** */
/* Animation Data Validation */
@@ -475,7 +480,7 @@ static char *get_driver_path_hack (bContext *C, PointerRNA *ptr, PropertyRNA *pr
static int add_driver_button_exec (bContext *C, wmOperator *op)
{
- PointerRNA ptr= {{0}};
+ PointerRNA ptr= {{NULL}};
PropertyRNA *prop= NULL;
short success= 0;
int index, all= RNA_boolean_get(op->ptr, "all");
@@ -531,7 +536,7 @@ void ANIM_OT_driver_button_add (wmOperatorType *ot)
static int remove_driver_button_exec (bContext *C, wmOperator *op)
{
- PointerRNA ptr= {{0}};
+ PointerRNA ptr= {{NULL}};
PropertyRNA *prop= NULL;
short success= 0;
int index, all= RNA_boolean_get(op->ptr, "all");
@@ -583,7 +588,7 @@ void ANIM_OT_driver_button_remove (wmOperatorType *ot)
static int copy_driver_button_exec (bContext *C, wmOperator *op)
{
- PointerRNA ptr= {{0}};
+ PointerRNA ptr= {{NULL}};
PropertyRNA *prop= NULL;
short success= 0;
int index;
@@ -627,7 +632,7 @@ void ANIM_OT_copy_driver_button (wmOperatorType *ot)
static int paste_driver_button_exec (bContext *C, wmOperator *op)
{
- PointerRNA ptr= {{0}};
+ PointerRNA ptr= {{NULL}};
PropertyRNA *prop= NULL;
short success= 0;
int index;
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 39deb417b26..67be382e600 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -1367,7 +1367,7 @@ static int insert_key_button_exec (bContext *C, wmOperator *op)
{
Main *bmain= CTX_data_main(C);
Scene *scene= CTX_data_scene(C);
- PointerRNA ptr= {{0}};
+ PointerRNA ptr= {{NULL}};
PropertyRNA *prop= NULL;
char *path;
float cfra= (float)CFRA; // XXX for now, don't bother about all the yucky offset crap
@@ -1456,7 +1456,7 @@ static int delete_key_button_exec (bContext *C, wmOperator *op)
{
Main *bmain= CTX_data_main(C);
Scene *scene= CTX_data_scene(C);
- PointerRNA ptr= {{0}};
+ PointerRNA ptr= {{NULL}};
PropertyRNA *prop= NULL;
char *path;
float cfra= (float)CFRA; // XXX for now, don't bother about all the yucky offset crap
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c
index 2df7d21e907..40c2f3c3797 100644
--- a/source/blender/editors/animation/keyingsets.c
+++ b/source/blender/editors/animation/keyingsets.c
@@ -288,7 +288,7 @@ static int add_keyingset_button_exec (bContext *C, wmOperator *op)
Scene *scene= CTX_data_scene(C);
KeyingSet *ks = NULL;
PropertyRNA *prop= NULL;
- PointerRNA ptr= {{0}};
+ PointerRNA ptr= {{NULL}};
char *path = NULL;
short success= 0;
int index=0, pflag=0;
@@ -388,7 +388,7 @@ static int remove_keyingset_button_exec (bContext *C, wmOperator *op)
Scene *scene= CTX_data_scene(C);
KeyingSet *ks = NULL;
PropertyRNA *prop= NULL;
- PointerRNA ptr= {{0}};
+ PointerRNA ptr= {{NULL}};
char *path = NULL;
short success= 0;
int index=0;
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index 5c5def9284e..689c792d859 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -4714,7 +4714,7 @@ static void envelope_bone_weighting(Object *ob, Mesh *mesh, float (*verts)[3], i
}
}
-void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob, Object *par, int heat, int mirror)
+static void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob, Object *par, int heat, int mirror)
{
/* This functions implements the automatic computation of vertex group
* weights, either through envelopes or using a heat equilibrium.
@@ -5434,7 +5434,7 @@ static int bone_unique_check(void *arg, const char *name)
return get_named_bone((bArmature *)arg, name) != NULL;
}
-void unique_bone_name(bArmature *arm, char *name)
+static void unique_bone_name(bArmature *arm, char *name)
{
BLI_uniquename_cb(bone_unique_check, (void *)arm, "Bone", '.', name, sizeof(((Bone *)NULL)->name));
}
diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c
index cabf81ea85e..ee0ed8252c3 100644
--- a/source/blender/editors/armature/editarmature_retarget.c
+++ b/source/blender/editors/armature/editarmature_retarget.c
@@ -112,7 +112,7 @@ float rollBoneByQuat(EditBone *bone, float old_up_axis[3], float qrot[4]);
/*********************************** EDITBONE UTILS ****************************************************/
-int countEditBoneChildren(ListBase *list, EditBone *parent)
+static int countEditBoneChildren(ListBase *list, EditBone *parent)
{
EditBone *ebone;
int count = 0;
@@ -128,7 +128,7 @@ int countEditBoneChildren(ListBase *list, EditBone *parent)
return count;
}
-EditBone* nextEditBoneChild(ListBase *list, EditBone *parent, int n)
+static EditBone* nextEditBoneChild(ListBase *list, EditBone *parent, int n)
{
EditBone *ebone;
@@ -147,7 +147,7 @@ EditBone* nextEditBoneChild(ListBase *list, EditBone *parent, int n)
return NULL;
}
-void getEditBoneRollUpAxis(EditBone *bone, float roll, float up_axis[3])
+static void getEditBoneRollUpAxis(EditBone *bone, float roll, float up_axis[3])
{
float mat[3][3], nor[3];
@@ -195,7 +195,7 @@ float rollBoneByQuatAligned(EditBone *bone, float old_up_axis[3], float qrot[4],
}
}
-float rollBoneByQuatJoint(RigEdge *edge, RigEdge *previous, float qrot[4], float qroll[4], float up_axis[3])
+static float rollBoneByQuatJoint(RigEdge *edge, RigEdge *previous, float qrot[4], float qroll[4], float up_axis[3])
{
if (previous == NULL)
{
@@ -257,7 +257,7 @@ float rollBoneByQuat(EditBone *bone, float old_up_axis[3], float qrot[4])
/************************************ DESTRUCTORS ******************************************************/
-void RIG_freeRigArc(BArc *arc)
+static void RIG_freeRigArc(BArc *arc)
{
BLI_freelistN(&((RigArc*)arc)->edges);
}
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index a024bf087c1..84c6bfaf55b 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -1122,7 +1122,6 @@ static void curve_rename_fcurves(Object *obedit, ListBase *orig_curves)
/* remove pathes for removed control points
need this to make further step with copying non-cv related curves copying
not touching cv's f-cruves */
- fcu= orig_curves->first;
for(fcu= orig_curves->first; fcu; fcu= next) {
next= fcu->next;
diff --git a/source/blender/editors/include/ED_types.h b/source/blender/editors/include/ED_types.h
index 1887a97e635..a0d1e0d65ec 100644
--- a/source/blender/editors/include/ED_types.h
+++ b/source/blender/editors/include/ED_types.h
@@ -40,8 +40,8 @@
#define YIC 20
/* proposal = put scene pointers on function calls? */
-#define BASACT (scene->basact)
-#define OBACT (BASACT? BASACT->object: 0)
+// #define BASACT (scene->basact)
+// #define OBACT (BASACT? BASACT->object: NULL)
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 93da3592275..bb83827b2cb 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -744,9 +744,9 @@ void special_editmenu(Scene *scene, View3D *v3d)
MTFace *tface;
MFace *mface;
int a;
-
- if(me==0 || me->mtface==0) return;
-
+
+ if(me==NULL || me->mtface==NULL) return;
+
nr= pupmenu("Specials%t|Set Tex%x1| Shared%x2| Light%x3| Invisible%x4| Collision%x5| TwoSide%x6|Clr Tex%x7| Shared%x8| Light%x9| Invisible%x10| Collision%x11| TwoSide%x12");
tface= me->mtface;
@@ -768,7 +768,7 @@ void special_editmenu(Scene *scene, View3D *v3d)
tface->mode |= TF_TWOSIDE; break;
case 7:
tface->mode &= ~TF_TEX;
- tface->tpage= 0;
+ tface->tpage= NULL;
break;
case 8:
tface->mode &= ~TF_SHAREDCOL; break;
@@ -788,7 +788,7 @@ void special_editmenu(Scene *scene, View3D *v3d)
else if(ob->mode & OB_MODE_VERTEX_PAINT) {
Mesh *me= get_mesh(ob);
- if(me==0 || (me->mcol==NULL && me->mtface==NULL) ) return;
+ if(me==NULL || (me->mcol==NULL && me->mtface==NULL) ) return;
nr= pupmenu("Specials%t|Shared VertexCol%x1");
if(nr==1) {
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 7e72aad8adb..69e42d87148 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -64,6 +64,8 @@
#include "WM_api.h"
#include "WM_types.h"
+
+#include "ED_sculpt.h"
#include "ED_screen.h"
#include "ED_view3d.h"
#include "ED_util.h" /* for crazyspace correction */
@@ -2377,13 +2379,13 @@ static void sculpt_combine_proxies(Sculpt *sd, SculptSession *ss)
{
Brush *brush= paint_brush(&sd->paint);
PBVHNode** nodes;
- int use_orco, totnode, n;
+ int totnode, n;
BLI_pbvh_gather_proxies(ss->pbvh, &nodes, &totnode);
if(!ELEM(brush->sculpt_tool, SCULPT_TOOL_SMOOTH, SCULPT_TOOL_LAYER)) {
/* these brushes start from original coordinates */
- use_orco = (ELEM3(brush->sculpt_tool, SCULPT_TOOL_GRAB,
+ const int use_orco = (ELEM3(brush->sculpt_tool, SCULPT_TOOL_GRAB,
SCULPT_TOOL_ROTATE, SCULPT_TOOL_THUMB));
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c
index 2d4501e6005..3a19074bbb7 100644
--- a/source/blender/editors/space_console/console_draw.c
+++ b/source/blender/editors/space_console/console_draw.c
@@ -188,12 +188,12 @@ static int console_textview_line_color(struct TextViewContext *tvc, unsigned cha
static int console_textview_main__internal(struct SpaceConsole *sc, struct ARegion *ar, int draw, int mval[2], void **mouse_pick, int *pos_pick)
{
- ConsoleLine cl_dummy= {0};
+ ConsoleLine cl_dummy= {NULL};
int ret= 0;
View2D *v2d= &ar->v2d;
- TextViewContext tvc= {0};
+ TextViewContext tvc= {NULL};
tvc.begin= console_textview_begin;
tvc.end= console_textview_end;
diff --git a/source/blender/editors/space_script/script_header.c b/source/blender/editors/space_script/script_header.c
index 545be69af54..35f3ad0596f 100644
--- a/source/blender/editors/space_script/script_header.c
+++ b/source/blender/editors/space_script/script_header.c
@@ -78,10 +78,10 @@ static uiBlock *dummy_viewmenu(bContext *C, ARegion *ar, void *UNUSED(arg))
return block;
}
-static void do_script_buttons(bContext *UNUSED(C), void *UNUSED(arg), int event)
+static void do_script_buttons(bContext *UNUSED(C), void *UNUSED(arg), int UNUSED(event))
{
- switch(event) {
- }
+ //switch(event) {
+ //}
}
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index aa35438a387..207e9f94b5a 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -573,7 +573,7 @@ typedef struct ViewCachedString {
/* str is allocated past the end */
} ViewCachedString;
-void view3d_cached_text_draw_begin()
+void view3d_cached_text_draw_begin(void)
{
ListBase *strings= &CachedText[CachedTextLevel];
strings->first= strings->last= NULL;
@@ -5368,7 +5368,7 @@ static void draw_bb_quadric(BoundBox *bb, short type)
static void draw_bounding_volume(Scene *scene, Object *ob)
{
- BoundBox *bb=0;
+ BoundBox *bb= NULL;
if(ob->type==OB_MESH) {
bb= mesh_get_bb(ob);
@@ -5379,7 +5379,7 @@ static void draw_bounding_volume(Scene *scene, Object *ob)
else if(ob->type==OB_MBALL) {
if(is_basis_mball(ob)) {
bb= ob->bb;
- if(bb==0) {
+ if(bb==NULL) {
makeDispListMBall(scene, ob);
bb= ob->bb;
}
@@ -5390,7 +5390,7 @@ static void draw_bounding_volume(Scene *scene, Object *ob)
return;
}
- if(bb==0) return;
+ if(bb==NULL) return;
if(ob->boundtype==OB_BOUND_BOX) draw_box(bb->vec);
else draw_bb_quadric(bb, ob->boundtype);
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 43321802fc7..d7c81fc624f 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -376,7 +376,7 @@ static void viewRedrawPost(bContext *C, TransInfo *t)
/* ************************** TRANSFORMATIONS **************************** */
-void BIF_selectOrientation() {
+void BIF_selectOrientation(void) {
#if 0 // TRANSFORM_FIX_ME
short val;
char *str_menu = BIF_menustringTransformOrientation("Orientation");
@@ -1373,7 +1373,7 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata)
}
}
-void drawTransformView(const struct bContext *C, struct ARegion *UNUSED(ar), void *arg)
+static void drawTransformView(const struct bContext *C, struct ARegion *UNUSED(ar), void *arg)
{
TransInfo *t = arg;
@@ -1382,7 +1382,7 @@ void drawTransformView(const struct bContext *C, struct ARegion *UNUSED(ar), voi
drawSnapping(C, t);
}
-void drawTransformPixel(const struct bContext *UNUSED(C), struct ARegion *UNUSED(ar), void *UNUSED(arg))
+static void drawTransformPixel(const struct bContext *UNUSED(C), struct ARegion *UNUSED(ar), void *UNUSED(arg))
{
// TransInfo *t = arg;
//
@@ -2925,7 +2925,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
if(td->flag & TD_USEQUAT) {
- mul_serie_m3(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0);
+ mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
mat3_to_quat( quat,fmat); // Actual transform
if(td->ext->quat){
@@ -2992,7 +2992,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't rotate objects itself
/* euler or quaternion/axis-angle? */
if (td->ext->rotOrder == ROT_MODE_QUAT) {
- mul_serie_m3(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0);
+ mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
mat3_to_quat( quat,fmat); // Actual transform
@@ -3007,7 +3007,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
axis_angle_to_quat(iquat, td->ext->irotAxis, td->ext->irotAngle);
- mul_serie_m3(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0);
+ mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
mat3_to_quat( quat,fmat); // Actual transform
mul_qt_qtqt(tquat, quat, iquat);
@@ -3062,7 +3062,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't rotate objects itself
/* euler or quaternion? */
if ((td->ext->rotOrder == ROT_MODE_QUAT) || (td->flag & TD_USEQUAT)) {
- mul_serie_m3(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0);
+ mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
mat3_to_quat( quat,fmat); // Actual transform
mul_qt_qtqt(td->ext->quat, quat, td->ext->iquat);
@@ -3075,7 +3075,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
axis_angle_to_quat(iquat, td->ext->irotAxis, td->ext->irotAngle);
- mul_serie_m3(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0);
+ mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
mat3_to_quat( quat,fmat); // Actual transform
mul_qt_qtqt(tquat, quat, iquat);
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 20374cb8dbe..bbadce5369d 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -574,16 +574,16 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
if (constraints_list_needinv(t, &pchan->constraints)) {
copy_m3_m4(tmat, pchan->constinv);
invert_m3_m3(cmat, tmat);
- mul_serie_m3(td->mtx, bmat, pmat, omat, cmat, 0,0,0,0); // dang mulserie swaps args
+ mul_serie_m3(td->mtx, bmat, pmat, omat, cmat, NULL,NULL,NULL,NULL); // dang mulserie swaps args
}
else
- mul_serie_m3(td->mtx, bmat, pmat, omat, 0,0,0,0,0); // dang mulserie swaps args
+ mul_serie_m3(td->mtx, bmat, pmat, omat, NULL,NULL,NULL,NULL,NULL); // dang mulserie swaps args
}
else {
if (constraints_list_needinv(t, &pchan->constraints)) {
copy_m3_m4(tmat, pchan->constinv);
invert_m3_m3(cmat, tmat);
- mul_serie_m3(td->mtx, bmat, omat, cmat, 0,0,0,0,0); // dang mulserie swaps args
+ mul_serie_m3(td->mtx, bmat, omat, cmat, NULL,NULL,NULL,NULL,NULL); // dang mulserie swaps args
}
else
mul_m3_m3m3(td->mtx, omat, bmat); // Mat3MulMat3 has swapped args!
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 45850d3f20f..8bf804bc9ab 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -1042,7 +1042,7 @@ typedef struct Scene {
#define FIRSTBASE scene->base.first
#define LASTBASE scene->base.last
#define BASACT (scene->basact)
-#define OBACT (BASACT? BASACT->object: 0)
+#define OBACT (BASACT? BASACT->object: NULL)
#define ID_NEW(a) if( (a) && (a)->id.newid ) (a)= (void *)(a)->id.newid
#define ID_NEW_US(a) if( (a)->id.newid) {(a)= (void *)(a)->id.newid; (a)->id.us++;}
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 2196da32aa3..ccaa6eb111a 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -1838,7 +1838,7 @@ static void rna_def_object(BlenderRNA *brna)
prop= RNA_def_property(srna, "material_slots", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
RNA_def_property_struct_type(prop, "MaterialSlot");
- RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_iterator_array_get", 0, 0, 0); /* don't dereference pointer! */
+ RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_iterator_array_get", NULL, NULL, NULL); /* don't dereference pointer! */
RNA_def_property_ui_text(prop, "Material Slots", "Material slots in the object");
prop= RNA_def_property(srna, "active_material", PROP_POINTER, PROP_NONE);
diff --git a/source/blender/modifiers/intern/MOD_shapekey.c b/source/blender/modifiers/intern/MOD_shapekey.c
index 874efd77c9e..a2fd83b8bcb 100644
--- a/source/blender/modifiers/intern/MOD_shapekey.c
+++ b/source/blender/modifiers/intern/MOD_shapekey.c
@@ -128,20 +128,20 @@ ModifierTypeInfo modifierType_ShapeKey = {
/* flags */ eModifierTypeFlag_AcceptsCVs
| eModifierTypeFlag_SupportsEditmode,
- /* copyData */ 0,
+ /* copyData */ NULL,
/* deformVerts */ deformVerts,
/* deformMatrices */ deformMatrices,
/* deformVertsEM */ deformVertsEM,
/* deformMatricesEM */ deformMatricesEM,
- /* applyModifier */ 0,
- /* applyModifierEM */ 0,
- /* initData */ 0,
- /* requiredDataMask */ 0,
- /* freeData */ 0,
- /* isDisabled */ 0,
- /* updateDepgraph */ 0,
- /* dependsOnTime */ 0,
- /* dependsOnNormals */ 0,
- /* foreachObjectLink */ 0,
- /* foreachIDLink */ 0,
+ /* applyModifier */ NULL,
+ /* applyModifierEM */ NULL,
+ /* initData */ NULL,
+ /* requiredDataMask */ NULL,
+ /* freeData */ NULL,
+ /* isDisabled */ NULL,
+ /* updateDepgraph */ NULL,
+ /* dependsOnTime */ NULL,
+ /* dependsOnNormals */ NULL,
+ /* foreachObjectLink */ NULL,
+ /* foreachIDLink */ NULL
};
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_image.c b/source/blender/nodes/intern/CMP_nodes/CMP_image.c
index a0ac8d90bfa..d5176bf6816 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_image.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_image.c
@@ -177,7 +177,7 @@ static CompBuf *compbuf_multilayer_get(RenderData *rd, RenderLayer *rl, Image *i
return NULL;
};
-void outputs_multilayer_get(RenderData *rd, RenderLayer *rl, bNodeStack **out, Image *ima, ImageUser *iuser)
+static void outputs_multilayer_get(RenderData *rd, RenderLayer *rl, bNodeStack **out, Image *ima, ImageUser *iuser)
{
if(out[RRES_OUT_Z]->hasoutput)
out[RRES_OUT_Z]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_Z);
diff --git a/source/blender/python/generic/IDProp.c b/source/blender/python/generic/IDProp.c
index cd014fc34a8..ad0c96afa17 100644
--- a/source/blender/python/generic/IDProp.c
+++ b/source/blender/python/generic/IDProp.c
@@ -49,7 +49,7 @@ extern PyTypeObject IDGroup_Iter_Type;
/*********************** ID Property Main Wrapper Stuff ***************/
-PyObject *IDGroup_repr( BPy_IDProperty *self )
+static PyObject *IDGroup_repr( BPy_IDProperty *self )
{
return PyUnicode_FromFormat( "<bpy ID property from \"%s\">", self->id->name);
}
@@ -113,7 +113,7 @@ PyObject *BPy_IDGroup_WrapData( ID *id, IDProperty *prop )
Py_RETURN_NONE;
}
-int BPy_IDGroup_SetData(BPy_IDProperty *self, IDProperty *prop, PyObject *value)
+static int BPy_IDGroup_SetData(BPy_IDProperty *self, IDProperty *prop, PyObject *value)
{
switch (prop->type) {
case IDP_STRING:
@@ -182,7 +182,7 @@ int BPy_IDGroup_SetData(BPy_IDProperty *self, IDProperty *prop, PyObject *value)
return 0;
}
-PyObject *BPy_IDGroup_GetName(BPy_IDProperty *self, void *UNUSED(closure))
+static PyObject *BPy_IDGroup_GetName(BPy_IDProperty *self, void *UNUSED(closure))
{
return PyUnicode_FromString(self->prop->name);
}
@@ -726,7 +726,7 @@ static PyObject *BPy_IDGroup_ConvertToPy(BPy_IDProperty *self)
/* Matches python dict.get(key, [default]) */
-PyObject* BPy_IDGroup_Get(BPy_IDProperty *self, PyObject *args)
+static PyObject* BPy_IDGroup_Get(BPy_IDProperty *self, PyObject *args)
{
IDProperty *idprop;
char *key;
@@ -763,23 +763,23 @@ static struct PyMethodDef BPy_IDGroup_methods[] = {
"idprop.get(k[,d]) -> idprop[k] if k in idprop, else d. d defaults to None"},
{"convert_to_pyobject", (PyCFunction)BPy_IDGroup_ConvertToPy, METH_NOARGS,
"return a purely python version of the group"},
- {0, NULL, 0, NULL}
+ {NULL, NULL, 0, NULL}
};
static PySequenceMethods BPy_IDGroup_Seq = {
- (lenfunc) BPy_IDGroup_Map_Len, /* lenfunc sq_length */
- 0, /* binaryfunc sq_concat */
- 0, /* ssizeargfunc sq_repeat */
- 0, /* ssizeargfunc sq_item */ /* TODO - setting this will allow PySequence_Check to return True */
- 0, /* intintargfunc ***was_sq_slice*** */
- 0, /* intobjargproc sq_ass_item */
- 0, /* ssizeobjargproc ***was_sq_ass_slice*** */
+ (lenfunc) BPy_IDGroup_Map_Len, /* lenfunc sq_length */
+ NULL, /* binaryfunc sq_concat */
+ NULL, /* ssizeargfunc sq_repeat */
+ NULL, /* ssizeargfunc sq_item */ /* TODO - setting this will allow PySequence_Check to return True */
+ NULL, /* intintargfunc ***was_sq_slice*** */
+ NULL, /* intobjargproc sq_ass_item */
+ NULL, /* ssizeobjargproc ***was_sq_ass_slice*** */
(objobjproc) BPy_IDGroup_Contains, /* objobjproc sq_contains */
- 0, /* binaryfunc sq_inplace_concat */
- 0, /* ssizeargfunc sq_inplace_repeat */
+ NULL, /* binaryfunc sq_inplace_concat */
+ NULL, /* ssizeargfunc sq_inplace_repeat */
};
-PyMappingMethods BPy_IDGroup_Mapping = {
+static PyMappingMethods BPy_IDGroup_Mapping = {
(lenfunc)BPy_IDGroup_Map_Len, /*inquiry mp_length */
(binaryfunc)BPy_IDGroup_Map_GetItem, /*binaryfunc mp_subscript */
(objobjargproc)BPy_IDGroup_Map_SetItem, /*objobjargproc mp_ass_subscript */
@@ -890,7 +890,7 @@ static PyObject *BPy_IDArray_ConvertToPy(BPy_IDArray *self)
static PyMethodDef BPy_IDArray_methods[] = {
{"convert_to_pyobject", (PyCFunction)BPy_IDArray_ConvertToPy, METH_NOARGS,
"return a purely python version of the group"},
- {0, NULL, 0, NULL}
+ {NULL, NULL, 0, NULL}
};
static int BPy_IDArray_Len(BPy_IDArray *self)
@@ -964,16 +964,16 @@ static int BPy_IDArray_SetItem(BPy_IDArray *self, int index, PyObject *value)
static PySequenceMethods BPy_IDArray_Seq = {
(lenfunc) BPy_IDArray_Len, /* inquiry sq_length */
- 0, /* binaryfunc sq_concat */
- 0, /* intargfunc sq_repeat */
+ NULL, /* binaryfunc sq_concat */
+ NULL, /* intargfunc sq_repeat */
(ssizeargfunc)BPy_IDArray_GetItem, /* intargfunc sq_item */
- 0, /* intintargfunc sq_slice */
- (ssizeobjargproc)BPy_IDArray_SetItem, /* intobjargproc sq_ass_item */
- 0, /* intintobjargproc sq_ass_slice */
- 0, /* objobjproc sq_contains */
+ NULL, /* intintargfunc sq_slice */
+ (ssizeobjargproc)BPy_IDArray_SetItem,/* intobjargproc sq_ass_item */
+ NULL, /* intintobjargproc sq_ass_slice */
+ NULL, /* objobjproc sq_contains */
/* Added in release 2.0 */
- 0, /* binaryfunc sq_inplace_concat */
- 0, /* intargfunc sq_inplace_repeat */
+ NULL, /* binaryfunc sq_inplace_concat */
+ NULL, /* intargfunc sq_inplace_repeat */
};
PyTypeObject IDArray_Type = {
diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c
index 474259fe0e3..2b15a6f4826 100644
--- a/source/blender/python/generic/bgl.c
+++ b/source/blender/python/generic/bgl.c
@@ -94,9 +94,9 @@ PyTypeObject BGL_bufferType = {
( printfunc ) 0, /*tp_print */
( getattrfunc ) Buffer_getattr, /*tp_getattr */
( setattrfunc ) 0, /*tp_setattr */
- 0, /*tp_compare */
+ NULL, /*tp_compare */
( reprfunc ) Buffer_repr, /*tp_repr */
- 0, /*tp_as_number */
+ NULL, /*tp_as_number */
&Buffer_SeqMethods, /*tp_as_sequence */
};
@@ -1124,13 +1124,13 @@ static struct PyMethodDef BGL_methods[] = {
static struct PyModuleDef BGL_module_def = {
PyModuleDef_HEAD_INIT,
"bgl", /* m_name */
- 0, /* m_doc */
+ NULL, /* m_doc */
0, /* m_size */
BGL_methods, /* m_methods */
- 0, /* m_reload */
- 0, /* m_traverse */
- 0, /* m_clear */
- 0, /* m_free */
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL, /* m_free */
};
diff --git a/source/blender/python/generic/blf_py_api.c b/source/blender/python/generic/blf_py_api.c
index 0c0bf1a680d..01fa402bd6f 100644
--- a/source/blender/python/generic/blf_py_api.c
+++ b/source/blender/python/generic/blf_py_api.c
@@ -362,7 +362,7 @@ static PyObject *py_blf_load(PyObject *UNUSED(self), PyObject *args)
}
/*----------------------------MODULE INIT-------------------------*/
-struct PyMethodDef BLF_methods[] = {
+static PyMethodDef BLF_methods[] = {
{"aspect", (PyCFunction) py_blf_aspect, METH_VARARGS, py_blf_aspect_doc},
{"blur", (PyCFunction) py_blf_blur, METH_VARARGS, py_blf_blur_doc},
{"clipping", (PyCFunction) py_blf_clipping, METH_VARARGS, py_blf_clipping_doc},
@@ -388,10 +388,10 @@ static struct PyModuleDef BLF_module_def = {
BLF_doc, /* m_doc */
0, /* m_size */
BLF_methods, /* m_methods */
- 0, /* m_reload */
- 0, /* m_traverse */
- 0, /* m_clear */
- 0, /* m_free */
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL, /* m_free */
};
PyObject *BPyInit_blf(void)
diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c
index a1b99e12e94..f68f499a28c 100644
--- a/source/blender/python/generic/bpy_internal_import.c
+++ b/source/blender/python/generic/bpy_internal_import.c
@@ -212,7 +212,7 @@ static PyObject *blender_import(PyObject *UNUSED(self), PyObject *args, PyObjec
PyObject *newmodule;
//PyObject_Print(args, stderr, 0);
- static const char *kwlist[] = {"name", "globals", "locals", "fromlist", "level", 0};
+ static const char *kwlist[] = {"name", "globals", "locals", "fromlist", "level", NULL};
if( !PyArg_ParseTupleAndKeywords(args, kw, "s|OOOi:bpy_import_meth", (char **)kwlist,
&name, &globals, &locals, &fromlist, &level) )
diff --git a/source/blender/python/generic/mathutils.c b/source/blender/python/generic/mathutils.c
index dc6fbac7eac..f56ac6c61bf 100644
--- a/source/blender/python/generic/mathutils.c
+++ b/source/blender/python/generic/mathutils.c
@@ -247,7 +247,7 @@ int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps)
/* Mathutils Callbacks */
/* for mathutils internal use only, eventually should re-alloc but to start with we only have a few users */
-Mathutils_Callback *mathutils_callbacks[8] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
+static Mathutils_Callback *mathutils_callbacks[8] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
int Mathutils_RegisterCallback(Mathutils_Callback *cb)
{
@@ -334,7 +334,7 @@ void BaseMathObject_dealloc(BaseMathObject * self)
}
/*----------------------------MODULE INIT-------------------------*/
-struct PyMethodDef M_Mathutils_methods[] = {
+static struct PyMethodDef M_Mathutils_methods[] = {
{NULL, NULL, 0, NULL}
};
@@ -344,10 +344,10 @@ static struct PyModuleDef M_Mathutils_module_def = {
M_Mathutils_doc, /* m_doc */
0, /* m_size */
M_Mathutils_methods, /* m_methods */
- 0, /* m_reload */
- 0, /* m_traverse */
- 0, /* m_clear */
- 0, /* m_free */
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL, /* m_free */
};
PyMODINIT_FUNC BPyInit_mathutils(void)
diff --git a/source/blender/python/generic/mathutils_color.c b/source/blender/python/generic/mathutils_color.c
index af4742e74c6..f7e62242703 100644
--- a/source/blender/python/generic/mathutils_color.c
+++ b/source/blender/python/generic/mathutils_color.c
@@ -457,51 +457,51 @@ static char color_doc[] =
;
PyTypeObject color_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
- "mathutils.Color", //tp_name
+ "mathutils.Color", //tp_name
sizeof(ColorObject), //tp_basicsize
0, //tp_itemsize
(destructor)BaseMathObject_dealloc, //tp_dealloc
- 0, //tp_print
- 0, //tp_getattr
- 0, //tp_setattr
- 0, //tp_compare
+ NULL, //tp_print
+ NULL, //tp_getattr
+ NULL, //tp_setattr
+ NULL, //tp_compare
(reprfunc) Color_repr, //tp_repr
- 0, //tp_as_number
+ NULL, //tp_as_number
&Color_SeqMethods, //tp_as_sequence
&Color_AsMapping, //tp_as_mapping
- 0, //tp_hash
- 0, //tp_call
- 0, //tp_str
- 0, //tp_getattro
- 0, //tp_setattro
- 0, //tp_as_buffer
+ NULL, //tp_hash
+ NULL, //tp_call
+ NULL, //tp_str
+ NULL, //tp_getattro
+ NULL, //tp_setattro
+ NULL, //tp_as_buffer
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, //tp_flags
color_doc, //tp_doc
- 0, //tp_traverse
- 0, //tp_clear
+ NULL, //tp_traverse
+ NULL, //tp_clear
(richcmpfunc)Color_richcmpr, //tp_richcompare
0, //tp_weaklistoffset
- 0, //tp_iter
- 0, //tp_iternext
+ NULL, //tp_iter
+ NULL, //tp_iternext
Color_methods, //tp_methods
- 0, //tp_members
+ NULL, //tp_members
Color_getseters, //tp_getset
- 0, //tp_base
- 0, //tp_dict
- 0, //tp_descr_get
- 0, //tp_descr_set
+ NULL, //tp_base
+ NULL, //tp_dict
+ NULL, //tp_descr_get
+ NULL, //tp_descr_set
0, //tp_dictoffset
- 0, //tp_init
- 0, //tp_alloc
+ NULL, //tp_init
+ NULL, //tp_alloc
Color_new, //tp_new
- 0, //tp_free
- 0, //tp_is_gc
- 0, //tp_bases
- 0, //tp_mro
- 0, //tp_cache
- 0, //tp_subclasses
- 0, //tp_weaklist
- 0 //tp_del
+ NULL, //tp_free
+ NULL, //tp_is_gc
+ NULL, //tp_bases
+ NULL, //tp_mro
+ NULL, //tp_cache
+ NULL, //tp_subclasses
+ NULL, //tp_weaklist
+ NULL //tp_del
};
//------------------------newColorObject (internal)-------------
//creates a new color object
diff --git a/source/blender/python/generic/mathutils_euler.c b/source/blender/python/generic/mathutils_euler.c
index 8792b154ca6..b6040274065 100644
--- a/source/blender/python/generic/mathutils_euler.c
+++ b/source/blender/python/generic/mathutils_euler.c
@@ -593,51 +593,51 @@ static char euler_doc[] =
;
PyTypeObject euler_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
- "mathutils.Euler", //tp_name
+ "mathutils.Euler", //tp_name
sizeof(EulerObject), //tp_basicsize
0, //tp_itemsize
(destructor)BaseMathObject_dealloc, //tp_dealloc
- 0, //tp_print
- 0, //tp_getattr
- 0, //tp_setattr
- 0, //tp_compare
+ NULL, //tp_print
+ NULL, //tp_getattr
+ NULL, //tp_setattr
+ NULL, //tp_compare
(reprfunc) Euler_repr, //tp_repr
- 0, //tp_as_number
+ NULL, //tp_as_number
&Euler_SeqMethods, //tp_as_sequence
&Euler_AsMapping, //tp_as_mapping
- 0, //tp_hash
- 0, //tp_call
- 0, //tp_str
- 0, //tp_getattro
- 0, //tp_setattro
- 0, //tp_as_buffer
+ NULL, //tp_hash
+ NULL, //tp_call
+ NULL, //tp_str
+ NULL, //tp_getattro
+ NULL, //tp_setattro
+ NULL, //tp_as_buffer
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, //tp_flags
euler_doc, //tp_doc
- 0, //tp_traverse
- 0, //tp_clear
+ NULL, //tp_traverse
+ NULL, //tp_clear
(richcmpfunc)Euler_richcmpr, //tp_richcompare
0, //tp_weaklistoffset
- 0, //tp_iter
- 0, //tp_iternext
+ NULL, //tp_iter
+ NULL, //tp_iternext
Euler_methods, //tp_methods
- 0, //tp_members
+ NULL, //tp_members
Euler_getseters, //tp_getset
- 0, //tp_base
- 0, //tp_dict
- 0, //tp_descr_get
- 0, //tp_descr_set
+ NULL, //tp_base
+ NULL, //tp_dict
+ NULL, //tp_descr_get
+ NULL, //tp_descr_set
0, //tp_dictoffset
- 0, //tp_init
- 0, //tp_alloc
+ NULL, //tp_init
+ NULL, //tp_alloc
Euler_new, //tp_new
- 0, //tp_free
- 0, //tp_is_gc
- 0, //tp_bases
- 0, //tp_mro
- 0, //tp_cache
- 0, //tp_subclasses
- 0, //tp_weaklist
- 0 //tp_del
+ NULL, //tp_free
+ NULL, //tp_is_gc
+ NULL, //tp_bases
+ NULL, //tp_mro
+ NULL, //tp_cache
+ NULL, //tp_subclasses
+ NULL, //tp_weaklist
+ NULL //tp_del
};
//------------------------newEulerObject (internal)-------------
//creates a new euler object
diff --git a/source/blender/python/generic/mathutils_geometry.c b/source/blender/python/generic/mathutils_geometry.c
index 4a1993b00ef..d1e9a2452f3 100644
--- a/source/blender/python/generic/mathutils_geometry.c
+++ b/source/blender/python/generic/mathutils_geometry.c
@@ -844,7 +844,7 @@ static PyObject *M_Geometry_barycentric_transform(PyObject *UNUSED(self), PyObje
return newVectorObject(vec, 3, Py_NEW, NULL);
}
-struct PyMethodDef M_Geometry_methods[]= {
+static PyMethodDef M_Geometry_methods[]= {
{"intersect_ray_tri", (PyCFunction) M_Geometry_intersect_ray_tri, METH_VARARGS, M_Geometry_intersect_ray_tri_doc},
{"intersect_point_line", (PyCFunction) M_Geometry_intersect_point_line, METH_VARARGS, M_Geometry_intersect_point_line_doc},
{"intersect_point_tri_2d", (PyCFunction) M_Geometry_intersect_point_tri_2d, METH_VARARGS, M_Geometry_intersect_point_tri_2d_doc},
@@ -866,10 +866,10 @@ static struct PyModuleDef M_Geometry_module_def= {
M_Geometry_doc, /* m_doc */
0, /* m_size */
M_Geometry_methods, /* m_methods */
- 0, /* m_reload */
- 0, /* m_traverse */
- 0, /* m_clear */
- 0, /* m_free */
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL, /* m_free */
};
/*----------------------------MODULE INIT-------------------------*/
diff --git a/source/blender/python/generic/mathutils_matrix.c b/source/blender/python/generic/mathutils_matrix.c
index 10b799ca944..1da8141eef1 100644
--- a/source/blender/python/generic/mathutils_matrix.c
+++ b/source/blender/python/generic/mathutils_matrix.c
@@ -1213,7 +1213,7 @@ static PyObject *Matrix_copy(MatrixObject *self)
static PyObject *Matrix_repr(MatrixObject *self)
{
int x, y;
- PyObject *rows[MATRIX_MAX_DIM]= {0};
+ PyObject *rows[MATRIX_MAX_DIM]= {NULL};
if(!BaseMath_ReadCallback(self))
return NULL;
@@ -1617,37 +1617,37 @@ static PyNumberMethods Matrix_NumMethods = {
(binaryfunc) Matrix_add, /*nb_add*/
(binaryfunc) Matrix_sub, /*nb_subtract*/
(binaryfunc) Matrix_mul, /*nb_multiply*/
- 0, /*nb_remainder*/
- 0, /*nb_divmod*/
- 0, /*nb_power*/
+ NULL, /*nb_remainder*/
+ NULL, /*nb_divmod*/
+ NULL, /*nb_power*/
(unaryfunc) 0, /*nb_negative*/
(unaryfunc) 0, /*tp_positive*/
(unaryfunc) 0, /*tp_absolute*/
(inquiry) 0, /*tp_bool*/
(unaryfunc) Matrix_inv, /*nb_invert*/
- 0, /*nb_lshift*/
+ NULL, /*nb_lshift*/
(binaryfunc)0, /*nb_rshift*/
- 0, /*nb_and*/
- 0, /*nb_xor*/
- 0, /*nb_or*/
- 0, /*nb_int*/
- 0, /*nb_reserved*/
- 0, /*nb_float*/
- 0, /* nb_inplace_add */
- 0, /* nb_inplace_subtract */
- 0, /* nb_inplace_multiply */
- 0, /* nb_inplace_remainder */
- 0, /* nb_inplace_power */
- 0, /* nb_inplace_lshift */
- 0, /* nb_inplace_rshift */
- 0, /* nb_inplace_and */
- 0, /* nb_inplace_xor */
- 0, /* nb_inplace_or */
- 0, /* nb_floor_divide */
- 0, /* nb_true_divide */
- 0, /* nb_inplace_floor_divide */
- 0, /* nb_inplace_true_divide */
- 0, /* nb_index */
+ NULL, /*nb_and*/
+ NULL, /*nb_xor*/
+ NULL, /*nb_or*/
+ NULL, /*nb_int*/
+ NULL, /*nb_reserved*/
+ NULL, /*nb_float*/
+ NULL, /* nb_inplace_add */
+ NULL, /* nb_inplace_subtract */
+ NULL, /* nb_inplace_multiply */
+ NULL, /* nb_inplace_remainder */
+ NULL, /* nb_inplace_power */
+ NULL, /* nb_inplace_lshift */
+ NULL, /* nb_inplace_rshift */
+ NULL, /* nb_inplace_and */
+ NULL, /* nb_inplace_xor */
+ NULL, /* nb_inplace_or */
+ NULL, /* nb_floor_divide */
+ NULL, /* nb_true_divide */
+ NULL, /* nb_inplace_floor_divide */
+ NULL, /* nb_inplace_true_divide */
+ NULL, /* nb_index */
};
static PyObject *Matrix_getRowSize(MatrixObject *self, void *UNUSED(closure))
@@ -1755,51 +1755,51 @@ static char matrix_doc[] =
;
PyTypeObject matrix_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
- "mathutils.Matrix", /*tp_name*/
- sizeof(MatrixObject), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- (destructor)BaseMathObject_dealloc, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- 0, /*tp_compare*/
- (reprfunc) Matrix_repr, /*tp_repr*/
- &Matrix_NumMethods, /*tp_as_number*/
- &Matrix_SeqMethods, /*tp_as_sequence*/
- &Matrix_AsMapping, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
+ "mathutils.Matrix", /*tp_name*/
+ sizeof(MatrixObject), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ (destructor)BaseMathObject_dealloc, /*tp_dealloc*/
+ NULL, /*tp_print*/
+ NULL, /*tp_getattr*/
+ NULL, /*tp_setattr*/
+ NULL, /*tp_compare*/
+ (reprfunc) Matrix_repr, /*tp_repr*/
+ &Matrix_NumMethods, /*tp_as_number*/
+ &Matrix_SeqMethods, /*tp_as_sequence*/
+ &Matrix_AsMapping, /*tp_as_mapping*/
+ NULL, /*tp_hash*/
+ NULL, /*tp_call*/
+ NULL, /*tp_str*/
+ NULL, /*tp_getattro*/
+ NULL, /*tp_setattro*/
+ NULL, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/
- matrix_doc, /*tp_doc*/
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
- (richcmpfunc)Matrix_richcmpr, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- Matrix_methods, /*tp_methods*/
- 0, /*tp_members*/
- Matrix_getseters, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- 0, /*tp_init*/
- 0, /*tp_alloc*/
- Matrix_new, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0 /*tp_del*/
+ matrix_doc, /*tp_doc*/
+ NULL, /*tp_traverse*/
+ NULL, /*tp_clear*/
+ (richcmpfunc)Matrix_richcmpr, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ NULL, /*tp_iter*/
+ NULL, /*tp_iternext*/
+ Matrix_methods, /*tp_methods*/
+ NULL, /*tp_members*/
+ Matrix_getseters, /*tp_getset*/
+ NULL, /*tp_base*/
+ NULL, /*tp_dict*/
+ NULL, /*tp_descr_get*/
+ NULL, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ NULL, /*tp_init*/
+ NULL, /*tp_alloc*/
+ Matrix_new, /*tp_new*/
+ NULL, /*tp_free*/
+ NULL, /*tp_is_gc*/
+ NULL, /*tp_bases*/
+ NULL, /*tp_mro*/
+ NULL, /*tp_cache*/
+ NULL, /*tp_subclasses*/
+ NULL, /*tp_weaklist*/
+ NULL /*tp_del*/
};
/*------------------------newMatrixObject (internal)-------------
diff --git a/source/blender/python/generic/mathutils_quat.c b/source/blender/python/generic/mathutils_quat.c
index 88cd7358ad5..e577d808091 100644
--- a/source/blender/python/generic/mathutils_quat.c
+++ b/source/blender/python/generic/mathutils_quat.c
@@ -771,37 +771,37 @@ static PyNumberMethods Quaternion_NumMethods = {
(binaryfunc) Quaternion_add, /*nb_add*/
(binaryfunc) Quaternion_sub, /*nb_subtract*/
(binaryfunc) Quaternion_mul, /*nb_multiply*/
- 0, /*nb_remainder*/
- 0, /*nb_divmod*/
- 0, /*nb_power*/
+ NULL, /*nb_remainder*/
+ NULL, /*nb_divmod*/
+ NULL, /*nb_power*/
(unaryfunc) Quaternion_neg, /*nb_negative*/
(unaryfunc) 0, /*tp_positive*/
(unaryfunc) 0, /*tp_absolute*/
(inquiry) 0, /*tp_bool*/
(unaryfunc) 0, /*nb_invert*/
- 0, /*nb_lshift*/
+ NULL, /*nb_lshift*/
(binaryfunc)0, /*nb_rshift*/
- 0, /*nb_and*/
- 0, /*nb_xor*/
- 0, /*nb_or*/
- 0, /*nb_int*/
- 0, /*nb_reserved*/
- 0, /*nb_float*/
- 0, /* nb_inplace_add */
- 0, /* nb_inplace_subtract */
- 0, /* nb_inplace_multiply */
- 0, /* nb_inplace_remainder */
- 0, /* nb_inplace_power */
- 0, /* nb_inplace_lshift */
- 0, /* nb_inplace_rshift */
- 0, /* nb_inplace_and */
- 0, /* nb_inplace_xor */
- 0, /* nb_inplace_or */
- 0, /* nb_floor_divide */
- 0, /* nb_true_divide */
- 0, /* nb_inplace_floor_divide */
- 0, /* nb_inplace_true_divide */
- 0, /* nb_index */
+ NULL, /*nb_and*/
+ NULL, /*nb_xor*/
+ NULL, /*nb_or*/
+ NULL, /*nb_int*/
+ NULL, /*nb_reserved*/
+ NULL, /*nb_float*/
+ NULL, /* nb_inplace_add */
+ NULL, /* nb_inplace_subtract */
+ NULL, /* nb_inplace_multiply */
+ NULL, /* nb_inplace_remainder */
+ NULL, /* nb_inplace_power */
+ NULL, /* nb_inplace_lshift */
+ NULL, /* nb_inplace_rshift */
+ NULL, /* nb_inplace_and */
+ NULL, /* nb_inplace_xor */
+ NULL, /* nb_inplace_or */
+ NULL, /* nb_floor_divide */
+ NULL, /* nb_true_divide */
+ NULL, /* nb_inplace_floor_divide */
+ NULL, /* nb_inplace_true_divide */
+ NULL, /* nb_index */
};
static PyObject *Quaternion_getAxis( QuaternionObject *self, void *type )
@@ -1028,47 +1028,47 @@ PyTypeObject quaternion_Type = {
sizeof(QuaternionObject), //tp_basicsize
0, //tp_itemsize
(destructor)BaseMathObject_dealloc, //tp_dealloc
- 0, //tp_print
- 0, //tp_getattr
- 0, //tp_setattr
- 0, //tp_compare
+ NULL, //tp_print
+ NULL, //tp_getattr
+ NULL, //tp_setattr
+ NULL, //tp_compare
(reprfunc) Quaternion_repr, //tp_repr
&Quaternion_NumMethods, //tp_as_number
&Quaternion_SeqMethods, //tp_as_sequence
&Quaternion_AsMapping, //tp_as_mapping
- 0, //tp_hash
- 0, //tp_call
- 0, //tp_str
- 0, //tp_getattro
- 0, //tp_setattro
- 0, //tp_as_buffer
+ NULL, //tp_hash
+ NULL, //tp_call
+ NULL, //tp_str
+ NULL, //tp_getattro
+ NULL, //tp_setattro
+ NULL, //tp_as_buffer
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, //tp_flags
quaternion_doc, //tp_doc
- 0, //tp_traverse
- 0, //tp_clear
+ NULL, //tp_traverse
+ NULL, //tp_clear
(richcmpfunc)Quaternion_richcmpr, //tp_richcompare
0, //tp_weaklistoffset
- 0, //tp_iter
- 0, //tp_iternext
+ NULL, //tp_iter
+ NULL, //tp_iternext
Quaternion_methods, //tp_methods
- 0, //tp_members
+ NULL, //tp_members
Quaternion_getseters, //tp_getset
- 0, //tp_base
- 0, //tp_dict
- 0, //tp_descr_get
- 0, //tp_descr_set
+ NULL, //tp_base
+ NULL, //tp_dict
+ NULL, //tp_descr_get
+ NULL, //tp_descr_set
0, //tp_dictoffset
- 0, //tp_init
- 0, //tp_alloc
+ NULL, //tp_init
+ NULL, //tp_alloc
Quaternion_new, //tp_new
- 0, //tp_free
- 0, //tp_is_gc
- 0, //tp_bases
- 0, //tp_mro
- 0, //tp_cache
- 0, //tp_subclasses
- 0, //tp_weaklist
- 0 //tp_del
+ NULL, //tp_free
+ NULL, //tp_is_gc
+ NULL, //tp_bases
+ NULL, //tp_mro
+ NULL, //tp_cache
+ NULL, //tp_subclasses
+ NULL, //tp_weaklist
+ NULL, //tp_del
};
//------------------------newQuaternionObject (internal)-------------
//creates a new quaternion object
diff --git a/source/blender/python/generic/mathutils_vector.c b/source/blender/python/generic/mathutils_vector.c
index 27eb531ff21..0da5fe983ad 100644
--- a/source/blender/python/generic/mathutils_vector.c
+++ b/source/blender/python/generic/mathutils_vector.c
@@ -1327,8 +1327,8 @@ static PyObject* Vector_richcmpr(PyObject *objectA, PyObject *objectB, int compa
/*-----------------PROTCOL DECLARATIONS--------------------------*/
static PySequenceMethods Vector_SeqMethods = {
(lenfunc) Vector_len, /* sq_length */
- (binaryfunc) 0, /* sq_concat */
- (ssizeargfunc) 0, /* sq_repeat */
+ (binaryfunc) NULL, /* sq_concat */
+ (ssizeargfunc) NULL, /* sq_repeat */
(ssizeargfunc) Vector_item, /* sq_item */
NULL, /* py3 deprecated slice func */
(ssizeobjargproc) Vector_ass_item, /* sq_ass_item */
@@ -1408,40 +1408,40 @@ static PyMappingMethods Vector_AsMapping = {
static PyNumberMethods Vector_NumMethods = {
- (binaryfunc) Vector_add, /*nb_add*/
- (binaryfunc) Vector_sub, /*nb_subtract*/
- (binaryfunc) Vector_mul, /*nb_multiply*/
- 0, /*nb_remainder*/
- 0, /*nb_divmod*/
- 0, /*nb_power*/
- (unaryfunc) Vector_neg, /*nb_negative*/
- (unaryfunc) 0, /*tp_positive*/
- (unaryfunc) 0, /*tp_absolute*/
- (inquiry) 0, /*tp_bool*/
- (unaryfunc) 0, /*nb_invert*/
- 0, /*nb_lshift*/
- (binaryfunc)0, /*nb_rshift*/
- 0, /*nb_and*/
- 0, /*nb_xor*/
- 0, /*nb_or*/
- 0, /*nb_int*/
- 0, /*nb_reserved*/
- 0, /*nb_float*/
- Vector_iadd, /* nb_inplace_add */
- Vector_isub, /* nb_inplace_subtract */
- Vector_imul, /* nb_inplace_multiply */
- 0, /* nb_inplace_remainder */
- 0, /* nb_inplace_power */
- 0, /* nb_inplace_lshift */
- 0, /* nb_inplace_rshift */
- 0, /* nb_inplace_and */
- 0, /* nb_inplace_xor */
- 0, /* nb_inplace_or */
- 0, /* nb_floor_divide */
- Vector_div, /* nb_true_divide */
- 0, /* nb_inplace_floor_divide */
- Vector_idiv, /* nb_inplace_true_divide */
- 0, /* nb_index */
+ (binaryfunc) Vector_add, /*nb_add*/
+ (binaryfunc) Vector_sub, /*nb_subtract*/
+ (binaryfunc) Vector_mul, /*nb_multiply*/
+ NULL, /*nb_remainder*/
+ NULL, /*nb_divmod*/
+ NULL, /*nb_power*/
+ (unaryfunc) Vector_neg, /*nb_negative*/
+ (unaryfunc) NULL, /*tp_positive*/
+ (unaryfunc) NULL, /*tp_absolute*/
+ (inquiry) NULL, /*tp_bool*/
+ (unaryfunc) NULL, /*nb_invert*/
+ NULL, /*nb_lshift*/
+ (binaryfunc)NULL, /*nb_rshift*/
+ NULL, /*nb_and*/
+ NULL, /*nb_xor*/
+ NULL, /*nb_or*/
+ NULL, /*nb_int*/
+ NULL, /*nb_reserved*/
+ NULL, /*nb_float*/
+ Vector_iadd, /* nb_inplace_add */
+ Vector_isub, /* nb_inplace_subtract */
+ Vector_imul, /* nb_inplace_multiply */
+ NULL, /* nb_inplace_remainder */
+ NULL, /* nb_inplace_power */
+ NULL, /* nb_inplace_lshift */
+ NULL, /* nb_inplace_rshift */
+ NULL, /* nb_inplace_and */
+ NULL, /* nb_inplace_xor */
+ NULL, /* nb_inplace_or */
+ NULL, /* nb_floor_divide */
+ Vector_div, /* nb_true_divide */
+ NULL, /* nb_inplace_floor_divide */
+ Vector_idiv, /* nb_inplace_true_divide */
+ NULL, /* nb_index */
};
/*------------------PY_OBECT DEFINITION--------------------------*/
diff --git a/source/blender/python/generic/noise.c b/source/blender/python/generic/noise.c
index f266a666274..36147493dc5 100644
--- a/source/blender/python/generic/noise.c
+++ b/source/blender/python/generic/noise.c
@@ -649,12 +649,12 @@ static struct PyModuleDef noise_module_def = {
PyModuleDef_HEAD_INIT,
"noise", /* m_name */
Noise__doc__, /* m_doc */
- 0, /* m_size */
+ 0, /* m_size */
NoiseMethods, /* m_methods */
- 0, /* m_reload */
- 0, /* m_traverse */
- 0, /* m_clear */
- 0, /* m_free */
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL, /* m_free */
};
PyObject *BPyInit_noise(void)
@@ -677,7 +677,7 @@ PyObject *BPyInit_noise(void)
{(char *)"VORONOI_F2F1", NULL},
{(char *)"VORONOI_CRACKLE", NULL},
{(char *)"CELLNOISE", NULL},
- {0}
+ {NULL}
};
static PyStructSequence_Desc noise_types_info_desc = {
@@ -723,7 +723,7 @@ PyObject *BPyInit_noise(void)
{(char *)"MINKOVSKY_HALF", NULL},
{(char *)"MINKOVSKY_FOUR", NULL},
{(char *)"MINKOVSKY", NULL},
- {0}
+ {NULL}
};
static PyStructSequence_Desc noise_types_info_desc = {
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c
index 28870298e40..15b705fd374 100644
--- a/source/blender/python/intern/bpy.c
+++ b/source/blender/python/intern/bpy.c
@@ -27,6 +27,7 @@
#define WITH_PYTHON /* for AUD_PyInit.h, possibly others */
+#include "bpy.h"
#include "bpy_util.h"
#include "bpy_rna.h"
#include "bpy_app.h"
@@ -58,7 +59,7 @@ static char bpy_script_paths_doc[] =
" :return: (system, user) strings will be empty when not found.\n"
" :rtype: tuple of strigs\n";
-PyObject *bpy_script_paths(PyObject *UNUSED(self))
+static PyObject *bpy_script_paths(PyObject *UNUSED(self))
{
PyObject *ret= PyTuple_New(2);
char *path;
diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c
index 0f6fd3f6415..422563776f4 100644
--- a/source/blender/python/intern/bpy_app.c
+++ b/source/blender/python/intern/bpy_app.c
@@ -64,7 +64,7 @@ static PyStructSequence_Field app_info_fields[] = {
{(char *)"build_cxxflags", (char *)"C++ compiler flags"},
{(char *)"build_linkflags", (char *)"Binary linking flags"},
{(char *)"build_system", (char *)"Build system used"},
- {0}
+ {NULL}
};
static PyStructSequence_Desc app_info_desc = {
@@ -192,7 +192,7 @@ static PyObject *bpy_app_driver_dict_get(PyObject *UNUSED(self), void *UNUSED(cl
}
-PyGetSetDef bpy_app_getsets[]= {
+static PyGetSetDef bpy_app_getsets[]= {
{(char *)"debug", bpy_app_debug_get, bpy_app_debug_set, (char *)"Boolean, set when blender is running in debug mode (started with -d)", NULL},
{(char *)"debug_value", bpy_app_debug_value_get, bpy_app_debug_value_set, (char *)"Int, number which can be set to non-zero values for testing purposes.", NULL},
{(char *)"tempdir", bpy_app_tempdir_get, NULL, (char *)"String, the temp directory used by blender (read-only)", NULL},
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 5c4add0e547..cf47e40c2ed 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -151,7 +151,7 @@ void BPY_modules_update(bContext *C)
}
/* must be called before Py_Initialize */
-void BPY_python_start_path(void)
+static void bpy_python_start_path(void)
{
char *py_path_bundle= BLI_get_folder(BLENDER_PYTHON, NULL);
@@ -228,7 +228,7 @@ void BPY_python_start( int argc, char **argv )
/* builtin modules */
PyImport_ExtendInittab(bpy_internal_modules);
- BPY_python_start_path(); /* allow to use our own included python */
+ bpy_python_start_path(); /* allow to use our own included python */
/* Python 3.2 now looks for '2.56/python/include/python3.2d/pyconfig.h' to parse
* from the 'sysconfig' module which is used by 'site', so for now disable site.
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index ada8736158c..7ed5db6e6dc 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -37,19 +37,19 @@
#include "../generic/py_capi_utils.h"
-EnumPropertyItem property_flag_items[] = {
+static EnumPropertyItem property_flag_items[] = {
{PROP_HIDDEN, "HIDDEN", 0, "Hidden", ""},
{PROP_ANIMATABLE, "ANIMATABLE", 0, "Animateable", ""},
{0, NULL, 0, NULL, NULL}};
-EnumPropertyItem property_flag_enum_items[] = {
+static EnumPropertyItem property_flag_enum_items[] = {
{PROP_HIDDEN, "HIDDEN", 0, "Hidden", ""},
{PROP_ANIMATABLE, "ANIMATABLE", 0, "Animateable", ""},
{PROP_ENUM_FLAG, "ENUM_FLAG", 0, "Enum Flag", ""},
{0, NULL, 0, NULL, NULL}};
/* subtypes */
-EnumPropertyItem property_subtype_string_items[] = {
+static EnumPropertyItem property_subtype_string_items[] = {
{PROP_FILEPATH, "FILE_PATH", 0, "File Path", ""},
{PROP_DIRPATH, "DIR_PATH", 0, "Directory Path", ""},
{PROP_FILENAME, "FILENAME", 0, "Filename", ""},
@@ -57,7 +57,7 @@ EnumPropertyItem property_subtype_string_items[] = {
{PROP_NONE, "NONE", 0, "None", ""},
{0, NULL, 0, NULL, NULL}};
-EnumPropertyItem property_subtype_number_items[] = {
+static EnumPropertyItem property_subtype_number_items[] = {
{PROP_UNSIGNED, "UNSIGNED", 0, "Unsigned", ""},
{PROP_PERCENTAGE, "PERCENTAGE", 0, "Percentage", ""},
{PROP_FACTOR, "FACTOR", 0, "Factor", ""},
@@ -68,7 +68,7 @@ EnumPropertyItem property_subtype_number_items[] = {
{PROP_NONE, "NONE", 0, "None", ""},
{0, NULL, 0, NULL, NULL}};
-EnumPropertyItem property_subtype_array_items[] = {
+static EnumPropertyItem property_subtype_array_items[] = {
{PROP_COLOR, "COLOR", 0, "Color", ""},
{PROP_TRANSLATION, "TRANSLATION", 0, "Translation", ""},
{PROP_DIRECTION, "DIRECTION", 0, "Direction", ""},
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index c21fbaae9c0..b5460edbd3a 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -228,7 +228,7 @@ static int mathutils_rna_vector_set_index(BaseMathObject *bmo, int UNUSED(subtyp
return 1;
}
-Mathutils_Callback mathutils_rna_array_cb = {
+static Mathutils_Callback mathutils_rna_array_cb = {
(BaseMathCheckFunc) mathutils_rna_generic_check,
(BaseMathGetFunc) mathutils_rna_vector_get,
(BaseMathSetFunc) mathutils_rna_vector_set,
@@ -278,7 +278,7 @@ static int mathutils_rna_matrix_set(BaseMathObject *bmo, int UNUSED(subtype))
return 1;
}
-Mathutils_Callback mathutils_rna_matrix_cb = {
+static Mathutils_Callback mathutils_rna_matrix_cb = {
mathutils_rna_generic_check,
mathutils_rna_matrix_get,
mathutils_rna_matrix_set,
@@ -1221,7 +1221,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
else {
/* data==NULL, assign to RNA */
if(value == Py_None) {
- PointerRNA valueptr= {{0}};
+ PointerRNA valueptr= {{NULL}};
RNA_property_pointer_set(ptr, prop, valueptr);
}
else if(RNA_struct_is_a(param->ptr.type, ptype)) {
@@ -3572,7 +3572,7 @@ static PyObject *pyrna_prop_collection_foreach_set(BPy_PropertyRNA *self, PyObj
/* A bit of a kludge, make a list out of a collection or array,
* then return the lists iter function, not especially fast but convenient for now */
-PyObject *pyrna_prop_array_iter(BPy_PropertyArrayRNA *self)
+static PyObject *pyrna_prop_array_iter(BPy_PropertyArrayRNA *self)
{
/* Try get values from a collection */
PyObject *ret;
@@ -3590,7 +3590,7 @@ PyObject *pyrna_prop_array_iter(BPy_PropertyArrayRNA *self)
return iter;
}
-PyObject *pyrna_prop_collection_iter(BPy_PropertyRNA *self)
+static PyObject *pyrna_prop_collection_iter(BPy_PropertyRNA *self)
{
/* Try get values from a collection */
PyObject *ret;
@@ -3719,7 +3719,7 @@ static PyObject * pyrna_prop_new(PyTypeObject *type, PyObject *args, PyObject *U
}
}
-PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data)
+static PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data)
{
PyObject *ret;
int type = RNA_property_type(prop);
@@ -4475,7 +4475,7 @@ PyTypeObject pyrna_prop_collection_Type = {
};
/* only for add/remove/move methods */
-PyTypeObject pyrna_prop_collection_idprop_Type = {
+static PyTypeObject pyrna_prop_collection_idprop_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
"bpy_prop_collection_idprop", /* tp_name */
sizeof( BPy_PropertyRNA ), /* tp_basicsize */
@@ -4941,7 +4941,7 @@ static PyObject *pyrna_basetype_dir(BPy_BaseTypeRNA *self)
return list;
}
-PyTypeObject pyrna_basetype_Type = BLANK_PYTHON_TYPE;
+static PyTypeObject pyrna_basetype_Type = BLANK_PYTHON_TYPE;
PyObject *BPY_rna_types(void)
{
diff --git a/source/blender/python/intern/bpy_rna_callback.c b/source/blender/python/intern/bpy_rna_callback.c
index 6d4cc035ece..28b540ba418 100644
--- a/source/blender/python/intern/bpy_rna_callback.c
+++ b/source/blender/python/intern/bpy_rna_callback.c
@@ -24,6 +24,7 @@
#include "bpy_rna.h"
+#include "bpy_rna_callback.h"
#include "bpy_util.h"
#include "BLI_utildefines.h"
@@ -37,7 +38,7 @@
#define RNA_CAPSULE_ID "RNA_HANDLE"
#define RNA_CAPSULE_ID_INVALID "RNA_HANDLE_REMOVED"
-void cb_region_draw(const bContext *C, ARegion *UNUSED(ar), void *customdata)
+static void cb_region_draw(const bContext *C, ARegion *UNUSED(ar), void *customdata)
{
PyObject *cb_func, *cb_args, *result;
PyGILState_STATE gilstate;
diff --git a/source/blender/python/intern/bpy_rna_callback.h b/source/blender/python/intern/bpy_rna_callback.h
index d846b388c25..955ea8305f0 100644
--- a/source/blender/python/intern/bpy_rna_callback.h
+++ b/source/blender/python/intern/bpy_rna_callback.h
@@ -25,5 +25,5 @@
struct BPy_StructRNA;
struct PyObject;
-struct PyObject *pyrna_callback_add(struct BPy_StructRNA *self, struct PyObject *args);
-struct PyObject *pyrna_callback_remove(struct BPy_StructRNA *self, struct PyObject *args);
+PyObject *pyrna_callback_add(BPy_StructRNA *self, PyObject *args);
+PyObject *pyrna_callback_remove(BPy_StructRNA *self, PyObject *args);
diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c
index fb5b2a0d399..8ea5e646482 100644
--- a/source/blender/python/intern/bpy_util.c
+++ b/source/blender/python/intern/bpy_util.c
@@ -30,7 +30,7 @@
#include "../generic/py_capi_utils.h"
-bContext* __py_context = NULL;
+static bContext* __py_context = NULL;
bContext* BPy_GetContext(void) { return __py_context; }
void BPy_SetContext(bContext *C) { __py_context= C; }
diff --git a/source/blender/python/intern/bpy_util.h b/source/blender/python/intern/bpy_util.h
index c958082903e..e89c8212e1b 100644
--- a/source/blender/python/intern/bpy_util.h
+++ b/source/blender/python/intern/bpy_util.h
@@ -54,7 +54,7 @@ int BPY_class_validate(const char *class_type, PyObject *class, PyObject *base_c
char *BPy_enum_as_string(struct EnumPropertyItem *item);
-#define BLANK_PYTHON_TYPE {PyVarObject_HEAD_INIT(NULL, 0) 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
+#define BLANK_PYTHON_TYPE {PyVarObject_HEAD_INIT(NULL, 0) NULL}
/* error reporting */
short BPy_reports_to_error(struct ReportList *reports, const short clear);
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index 1dc709d27df..72bec0cb596 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -4881,7 +4881,6 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp
/* used to be 'rotate scene' */
void RE_Database_FromScene(Render *re, Main *bmain, Scene *scene, unsigned int lay, int use_camera_view)
{
- extern int slurph_opt; /* key.c */
Scene *sce;
float mat[4][4];
float amb[3];
@@ -5044,7 +5043,6 @@ void RE_DataBase_GetView(Render *re, float mat[][4])
static void database_fromscene_vectors(Render *re, Scene *scene, unsigned int lay, int timeoffset)
{
- extern int slurph_opt; /* key.c */
float mat[4][4];
re->scene= scene;
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index 951c171608a..62e684e79e2 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -83,7 +83,7 @@ extern struct Render R;
-void init_render_texture(Render *re, Tex *tex)
+static void init_render_texture(Render *re, Tex *tex)
{
int cfra= re->scene->r.cfra;
@@ -137,7 +137,7 @@ void init_render_textures(Render *re)
}
}
-void end_render_texture(Tex *tex)
+static void end_render_texture(Tex *tex)
{
if(tex && tex->use_nodes && tex->nodetree)
ntreeEndExecTree(tex->nodetree);
@@ -759,12 +759,12 @@ static int plugintex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex
if(osatex) rgbnor= ((TexDoitold)pit->doit)(tex->stype,
pit->data, texvec, dxt, dyt);
else rgbnor= ((TexDoitold)pit->doit)(tex->stype,
- pit->data, texvec, 0, 0);
+ pit->data, texvec, NULL, NULL);
} else {
if(osatex) rgbnor= ((TexDoit)pit->doit)(tex->stype,
pit->data, texvec, dxt, dyt, result);
else rgbnor= ((TexDoit)pit->doit)(tex->stype,
- pit->data, texvec, 0, 0, result);
+ pit->data, texvec, NULL, NULL, result);
}
if (pit->version < 6) {
diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c
index 099bf76f40b..4e728c3e59e 100644
--- a/source/blender/render/intern/source/strand.c
+++ b/source/blender/render/intern/source/strand.c
@@ -314,7 +314,7 @@ struct StrandShadeCache {
MemArena *memarena;
};
-StrandShadeCache *strand_shade_cache_create()
+StrandShadeCache *strand_shade_cache_create(void)
{
StrandShadeCache *cache;