From 0955c664aa7c5fc5f0bd345c58219c40f04ab9c1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 13 Feb 2011 10:52:18 +0000 Subject: 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. --- .../editors/animation/anim_channels_defines.c | 14 ++++----- .../blender/editors/animation/anim_channels_edit.c | 34 +++++++++++----------- source/blender/editors/animation/anim_draw.c | 4 +-- source/blender/editors/animation/anim_filter.c | 2 +- source/blender/editors/animation/anim_ipo_utils.c | 4 +-- source/blender/editors/animation/anim_markers.c | 4 +-- source/blender/editors/animation/anim_ops.c | 9 +++--- source/blender/editors/animation/drivers.c | 13 ++++++--- source/blender/editors/animation/keyframing.c | 4 +-- source/blender/editors/animation/keyingsets.c | 4 +-- source/blender/editors/armature/editarmature.c | 4 +-- .../editors/armature/editarmature_retarget.c | 10 +++---- source/blender/editors/curve/editcurve.c | 1 - source/blender/editors/include/ED_types.h | 4 +-- source/blender/editors/object/object_edit.c | 10 +++---- source/blender/editors/sculpt_paint/sculpt.c | 6 ++-- .../blender/editors/space_console/console_draw.c | 4 +-- .../blender/editors/space_script/script_header.c | 6 ++-- source/blender/editors/space_view3d/drawobject.c | 8 ++--- source/blender/editors/transform/transform.c | 16 +++++----- .../editors/transform/transform_conversions.c | 6 ++-- 21 files changed, 87 insertions(+), 80 deletions(-) (limited to 'source/blender/editors') 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! -- cgit v1.2.3