diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-16 12:20:21 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-16 12:20:21 +0400 |
commit | 2222f536f81210b557f62a5ea037aa9fa7f4e98b (patch) | |
tree | 3a8b96e2b8cb1cf93fa8422e98e0c577649f8674 /source/blender | |
parent | 0849eaebbfe6cf08a2a7f52ff79cc3e9cc4f0657 (diff) |
use replace 0 with NULL for pointers, set some functions static
also fixed own errors in recent static check commit.
Diffstat (limited to 'source/blender')
22 files changed, 51 insertions, 46 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index f75773d754a..73ddcbecf94 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -117,7 +117,7 @@ static void make_localact_apply_cb(ID *id, AnimData *adt, void *mlac_ptr) tMakeLocalActionContext *mlac = (tMakeLocalActionContext *)mlac_ptr; if (adt->action == mlac->act) { - if (id->lib==0) { + if (id->lib == NULL) { adt->action = mlac->actn; id_us_plus(&mlac->actn->id); diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index d40b030c470..89fd3ff9c13 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -1051,9 +1051,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; } @@ -1069,7 +1069,7 @@ void ntreeMakeLocal(bNodeTree *ntree) if(cd.local && cd.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(cd.local && cd.lib) { /* this is the mixed case, we copy the tree and assign it to local users */ @@ -1438,7 +1438,7 @@ static void ntree_update_link_pointers(bNodeTree *ntree) } } -void ntree_validate_links(bNodeTree *ntree) +static void ntree_validate_links(bNodeTree *ntree) { bNodeTreeType *ntreetype = ntreeGetType(ntree->type); bNodeLink *link; diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index 818666e7529..961a41690f7 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -32,6 +32,8 @@ #include <string.h> +#include "BLI_string.h" + /* from libswish3, originally called u8_isvalid(), * modified to return the index of the bad character (byte index not utf). * http://svn.swish-e.org/libswish3/trunk/src/libswish3/utf8.c r3044 - campbell */ diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index bb710a32794..bd5935c893c 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -893,7 +893,7 @@ static size_t skip_fcurve_selected_data (bDopeSheet *ads, FCurve *fcu, ID *owner */ static short skip_fcurve_with_name (bDopeSheet *ads, FCurve *fcu, ID *owner_id) { - bAnimListElem ale_dummy = {0}; + bAnimListElem ale_dummy = {NULL}; bAnimChannelType *acf; /* create a dummy wrapper for the F-Curve */ diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index 2305848e7b3..fa619e4cf44 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -204,8 +204,8 @@ static short ob_keyframes_loop(KeyframeEditData *ked, bDopeSheet *ads, Object *o int filter; int ret=0; - bAnimListElem dummychan = {0}; - Base dummybase = {0}; + bAnimListElem dummychan = {NULL}; + Base dummybase = {NULL}; if (ob == NULL) return 0; @@ -249,7 +249,7 @@ static short scene_keyframes_loop(KeyframeEditData *ked, bDopeSheet *ads, Scene int filter; int ret=0; - bAnimListElem dummychan = {0}; + bAnimListElem dummychan = {NULL}; if (sce == NULL) return 0; diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c index adf4f0fac2e..6b85523ac82 100644 --- a/source/blender/editors/curve/curve_ops.c +++ b/source/blender/editors/curve/curve_ops.c @@ -46,6 +46,7 @@ #include "WM_api.h" #include "WM_types.h" +#include "ED_curve.h" #include "ED_object.h" #include "ED_screen.h" #include "ED_transform.h" diff --git a/source/blender/editors/sound/sound_intern.h b/source/blender/editors/sound/sound_intern.h index b17ef99132f..cde0b3c4479 100644 --- a/source/blender/editors/sound/sound_intern.h +++ b/source/blender/editors/sound/sound_intern.h @@ -36,7 +36,5 @@ struct wmOperatorType; -void SOUND_OT_open(wmOperatorType *ot); - #endif /* ED_SOUND_INTERN_H */ diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 19cae6aa67d..60d665de94c 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -175,7 +175,7 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *event) return WM_operator_filesel(C, op, event); } -void SOUND_OT_open(wmOperatorType *ot) +static void SOUND_OT_open(wmOperatorType *ot) { /* identifiers */ ot->name= "Open Sound"; @@ -196,7 +196,7 @@ void SOUND_OT_open(wmOperatorType *ot) RNA_def_boolean(ot->srna, "mono", FALSE, "Mono", "Mixdown the sound to mono."); } -void SOUND_OT_open_mono(wmOperatorType *ot) +static void SOUND_OT_open_mono(wmOperatorType *ot) { /* identifiers */ ot->name= "Open Sound Mono"; @@ -659,7 +659,7 @@ static int update_animation_flags_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -void SOUND_OT_update_animation_flags(wmOperatorType *ot) +static void SOUND_OT_update_animation_flags(wmOperatorType *ot) { /* This operator is needed to set a correct state of the sound animation @@ -703,7 +703,7 @@ static int bake_animation_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -void SOUND_OT_bake_animation(wmOperatorType *ot) +static void SOUND_OT_bake_animation(wmOperatorType *ot) { /* identifiers */ ot->name= "Update animation cache"; diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 9ea1e8ee877..cd521f7e8c7 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -97,7 +97,7 @@ static void node_sync_cb(bContext *UNUSED(C), void *snode_v, void *node_v) } } -void node_socket_button_default(const bContext *C, uiBlock *block, +static void node_socket_button_default(const bContext *C, uiBlock *block, bNodeTree *ntree, bNode *node, bNodeSocket *sock, const char *name, int x, int y, int width) { @@ -135,7 +135,7 @@ static uiBlock *socket_component_menu(bContext *C, ARegion *ar, void *args_v) return block; } -void node_socket_button_components(const bContext *C, uiBlock *block, +static void node_socket_button_components(const bContext *C, uiBlock *block, bNodeTree *ntree, bNode *node, bNodeSocket *sock, const char *name, int x, int y, int width) { @@ -157,7 +157,7 @@ void node_socket_button_components(const bContext *C, uiBlock *block, uiDefBlockButN(block, socket_component_menu, args, name, x, y+1, width, NODE_DY-2, ""); } -void node_socket_button_color(const bContext *C, uiBlock *block, +static void node_socket_button_color(const bContext *C, uiBlock *block, bNodeTree *ntree, bNode *node, bNodeSocket *sock, const char *name, int x, int y, int width) { @@ -179,7 +179,7 @@ void node_socket_button_color(const bContext *C, uiBlock *block, /* ****************** BASE DRAW FUNCTIONS FOR NEW OPERATOR NODES ***************** */ -void node_draw_socket_new(bNodeSocket *sock, float size) +static void node_draw_socket_new(bNodeSocket *sock, float size) { float x=sock->locx, y=sock->locy; diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index ada4bc6f847..6172273f7e1 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -218,7 +218,7 @@ void OUTLINER_OT_item_openclose(wmOperatorType *ot) /* Rename --------------------------------------------------- */ -void do_item_rename(ARegion *ar, TreeElement *te, TreeStoreElem *tselem, ReportList *reports) +static void do_item_rename(ARegion *ar, TreeElement *te, TreeStoreElem *tselem, ReportList *reports) { /* can't rename rna datablocks entries */ if(ELEM3(tselem->type, TSE_RNA_STRUCT, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM)) diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index b2fdd34aab2..efbfbd51fb5 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -342,7 +342,7 @@ static void singleuser_action_cb(bContext *C, Scene *UNUSED(scene), TreeElement if (id) { IdAdtTemplate *iat = (IdAdtTemplate *)tsep->id; - PointerRNA ptr = {{0}}; + PointerRNA ptr = {{NULL}}; PropertyRNA *prop; RNA_pointer_create(&iat->id, &RNA_AnimData, iat->adt, &ptr); diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index e7673651546..c3165adaf49 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -188,7 +188,7 @@ static void proxy_endjob(void *UNUSED(customdata)) } -void seq_proxy_build_job(const bContext *C, Sequence * seq) +static void seq_proxy_build_job(const bContext *C, Sequence * seq) { wmJob * steve; ProxyJob *pj; diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 4d4561e66db..ce3a378ea00 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -240,7 +240,7 @@ GPUBuffer *GPU_buffer_alloc(int size) size */ glGenBuffersARB(1, &buf->id); glBindBufferARB(GL_ARRAY_BUFFER_ARB, buf->id); - glBufferDataARB(GL_ARRAY_BUFFER_ARB, size, 0, GL_STATIC_DRAW_ARB); + glBufferDataARB(GL_ARRAY_BUFFER_ARB, size, NULL, GL_STATIC_DRAW_ARB); glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); } else { @@ -493,7 +493,7 @@ static GPUBuffer *gpu_buffer_setup(DerivedMesh *dm, GPUDrawObject *object, /* nothing to do for legacy mode */ if(dm->drawObject->legacy) - return 0; + return NULL; cur_index_per_mat = MEM_mallocN(sizeof(int)*object->totmaterial, "GPU_buffer_setup.cur_index_per_mat"); @@ -513,7 +513,7 @@ static GPUBuffer *gpu_buffer_setup(DerivedMesh *dm, GPUDrawObject *object, /* bind the buffer and discard previous data, avoids stalling gpu */ glBindBufferARB(target, buffer->id); - glBufferDataARB(target, buffer->size, 0, GL_STATIC_DRAW_ARB); + glBufferDataARB(target, buffer->size, NULL, GL_STATIC_DRAW_ARB); /* attempt to map the buffer */ if(!(varray = glMapBufferARB(target, GL_WRITE_ONLY_ARB))) { diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index 3528318ba81..2e45c0eb07a 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -159,24 +159,24 @@ struct anim_index * IMB_indexer_open(const char * name) int i; if (!fp) { - return 0; + return NULL; } if (fread(header, 12, 1, fp) != 1) { fclose(fp); - return 0; + return NULL; } header[12] = 0; if (memcmp(header, magic, 8) != 0) { fclose(fp); - return 0; + return NULL; } if (atoi(header+9) != INDEX_FILE_VERSION) { fclose(fp); - return 0; + return NULL; } idx = MEM_callocN( sizeof(struct anim_index), "anim_index"); @@ -916,7 +916,7 @@ static AviMovie * alloc_proxy_output_avi( if (AVI_open_compress (filename, avi, 1, format) != AVI_ERROR_NONE) { MEM_freeN(avi); - return 0; + return NULL; } AVI_set_compress_option (avi, AVI_OPTION_TYPE_MAIN, 0, AVI_OPTION_WIDTH, &x); @@ -1000,7 +1000,7 @@ static void index_rebuild_fallback(struct anim * anim, s_ibuf->rect, x * y * 4); /* note that libavi free's the buffer... */ - s_ibuf->rect = 0; + s_ibuf->rect = NULL; IMB_freeImBuf(s_ibuf); } @@ -1056,14 +1056,14 @@ void IMB_free_indices(struct anim * anim) for (i = 0; i < IMB_PROXY_MAX_SLOT; i++) { if (anim->proxy_anim[i]) { IMB_close_anim(anim->proxy_anim[i]); - anim->proxy_anim[i] = 0; + anim->proxy_anim[i] = NULL; } } for (i = 0; i < IMB_TC_MAX_SLOT; i++) { if (anim->curr_idx[i]) { IMB_indexer_close(anim->curr_idx[i]); - anim->curr_idx[i] = 0; + anim->curr_idx[i] = NULL; } } @@ -1116,7 +1116,7 @@ struct anim_index * IMB_anim_open_index( } if (anim->indices_tried & tc) { - return 0; + return NULL; } get_tc_filename(anim, tc, fname); diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c index a4eae492a58..af7f098585e 100644 --- a/source/blender/imbuf/intern/jp2.c +++ b/source/blender/imbuf/intern/jp2.c @@ -97,7 +97,7 @@ static void info_callback(const char *msg, void *client_data) { struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags) { - struct ImBuf *ibuf = 0; + struct ImBuf *ibuf = NULL; int use_float = 0; /* for precision higher then 8 use float */ long signed_offsets[4]= {0, 0, 0, 0}; @@ -117,7 +117,7 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags) opj_dinfo_t* dinfo = NULL; /* handle to a decompressor */ opj_cio_t *cio = NULL; - if (check_jp2(mem) == 0) return(0); + if (check_jp2(mem) == 0) return(NULL); /* configure the event callbacks (not required) */ memset(&event_mgr, 0, sizeof(opj_event_mgr_t)); diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.c b/source/blender/modifiers/intern/MOD_weightvg_util.c index 7cdd7b289a4..128e888ca90 100644 --- a/source/blender/modifiers/intern/MOD_weightvg_util.c +++ b/source/blender/modifiers/intern/MOD_weightvg_util.c @@ -228,7 +228,7 @@ void weightvg_do_mask(int num, const int *indices, float *org_w, const float *ne } /* Adds the given vertex to the specified vertex group, with given weight. */ -void defvert_add_to_group(MDeformVert *dv, int defgrp_idx, const float weight) { +static void defvert_add_to_group(MDeformVert *dv, int defgrp_idx, const float weight) { /* TODO, move into deform.c as a generic function. This assumes the vertex * groups have already been checked, so this has to remain low level. */ MDeformWeight *newdw; @@ -247,7 +247,7 @@ void defvert_add_to_group(MDeformVert *dv, int defgrp_idx, const float weight) { /* Removes the given vertex from the vertex group, specified either by its defgrp_idx, * or directly by its MDeformWeight pointer, if dw is not NULL. * WARNING: This function frees the given MDeformWeight, do not use it afterward! */ -void defvert_remove_from_group(MDeformVert *dv, int defgrp_idx, MDeformWeight *dw) { +static void defvert_remove_from_group(MDeformVert *dv, int defgrp_idx, MDeformWeight *dw) { /* TODO, move this into deform.c as a generic function. */ MDeformWeight *newdw; int i; diff --git a/source/blender/nodes/composite/node_composite_tree.c b/source/blender/nodes/composite/node_composite_tree.c index 01e46ed3df9..5c58070be9d 100644 --- a/source/blender/nodes/composite/node_composite_tree.c +++ b/source/blender/nodes/composite/node_composite_tree.c @@ -337,7 +337,7 @@ static void *exec_composite_node(void *nodeexec_v) node->typeinfo->newexecfunc(thd->rd, 0, node, nodeexec->data, nsin, nsout); node->exec |= NODE_READY; - return 0; + return NULL; } /* return total of executable nodes, for timecursor */ diff --git a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c index 23bcf57e2bc..9f4af0e0d33 100644 --- a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c +++ b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c @@ -88,9 +88,9 @@ static void do_diff_matte(bNode *node, float *outColor, float *inColor1, float * static void node_composit_exec_diff_matte(void *data, bNode *node, bNodeStack **in, bNodeStack **out) { - CompBuf *outbuf=0; - CompBuf *imbuf1=0; - CompBuf *imbuf2=0; + CompBuf *outbuf= NULL; + CompBuf *imbuf1= NULL; + CompBuf *imbuf2= NULL; NodeChroma *c; /*is anything connected?*/ diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c index e7e46160199..b909a0d5f55 100644 --- a/source/blender/python/intern/bpy_app_handlers.c +++ b/source/blender/python/intern/bpy_app_handlers.c @@ -63,7 +63,7 @@ static PyStructSequence_Desc app_cb_info_desc= { #endif */ -static PyObject *py_cb_array[BLI_CB_EVT_TOT]= {0}; +static PyObject *py_cb_array[BLI_CB_EVT_TOT]= {NULL}; static PyObject *make_app_cb_info(void) { @@ -102,7 +102,7 @@ PyObject *BPY_app_handlers_struct(void) /* assign the C callbacks */ if(ret) { - static bCallbackFuncStore funcstore_array[BLI_CB_EVT_TOT]= {{0}}; + static bCallbackFuncStore funcstore_array[BLI_CB_EVT_TOT]= {{NULL}}; bCallbackFuncStore *funcstore; int pos= 0; diff --git a/source/blender/python/intern/gpu.c b/source/blender/python/intern/gpu.c index 334bb1f725a..8fa6a7b0629 100644 --- a/source/blender/python/intern/gpu.c +++ b/source/blender/python/intern/gpu.c @@ -55,6 +55,8 @@ #include "bpy_rna.h" +#include "gpu.h" + #define PY_MODULE_ADD_CONSTANT(module, name) PyModule_AddIntConstant(module, #name, name) PyDoc_STRVAR(M_gpu_doc, diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index 66a73b47790..e2b3b23b9c9 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -240,8 +240,8 @@ static void envmap_transmatrix(float mat[][4], int part) copy_m4_m4(tmat, mat); eul_to_mat4( rotmat,eul); mul_serie_m4(mat, tmat, rotmat, - 0, 0, 0, - 0, 0, 0); + NULL, NULL, NULL, + NULL, NULL, NULL); } /* ------------------------------------------------------------------------- */ diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 49e5e7b989d..05bcc32a90a 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1452,10 +1452,12 @@ void RE_test_break_cb(Render *re, void *handle, int (*f)(void *handle)) /* object is considered fully prepared on correct time etc */ /* includes lights */ +#if 0 void RE_AddObject(Render *UNUSED(re), Object *UNUSED(ob)) { } +#endif /* *************************************** */ |