From a9197c3aa21a5b5368e03feffd5b8d27c156b8fb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 Oct 2010 01:22:14 +0000 Subject: remove unused args in draw*.c and some in view*.c, tag some as UNUSED(). --- source/blender/editors/space_outliner/outliner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/space_outliner/outliner.c') diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 20b5ad7a34f..dc6b9f342b3 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -5659,7 +5659,7 @@ void draw_outliner(const bContext *C) UI_view2d_totRect_set(v2d, sizex, sizey); /* set matrix for 2d-view controls */ - UI_view2d_view_ortho(C, v2d); + UI_view2d_view_ortho(v2d); /* draw outliner stuff (background, hierachy lines and names) */ outliner_back(ar, soops); -- cgit v1.2.3 From f81248265d0792029000bb53d23130f88c27a20a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 15 Oct 2010 01:36:14 +0000 Subject: tag UNUSED() for operator exec() and invoke() functions. --- source/blender/editors/space_outliner/outliner.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'source/blender/editors/space_outliner/outliner.c') diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index dc6b9f342b3..c7e3340ba87 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -1590,7 +1590,7 @@ void object_toggle_visibility_cb(bContext *C, Scene *scene, TreeElement *te, Tre } } -static int outliner_toggle_visibility_exec(bContext *C, wmOperator *op) +static int outliner_toggle_visibility_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOops *soops= CTX_wm_space_outliner(C); Scene *scene= CTX_data_scene(C); @@ -1630,7 +1630,7 @@ static void object_toggle_selectability_cb(bContext *C, Scene *scene, TreeElemen } } -static int outliner_toggle_selectability_exec(bContext *C, wmOperator *op) +static int outliner_toggle_selectability_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOops *soops= CTX_wm_space_outliner(C); Scene *scene= CTX_data_scene(C); @@ -1668,7 +1668,7 @@ void object_toggle_renderability_cb(bContext *C, Scene *scene, TreeElement *te, } } -static int outliner_toggle_renderability_exec(bContext *C, wmOperator *op) +static int outliner_toggle_renderability_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOops *soops= CTX_wm_space_outliner(C); Scene *scene= CTX_data_scene(C); @@ -1697,7 +1697,7 @@ void OUTLINER_OT_renderability_toggle(wmOperatorType *ot) /* --- */ -static int outliner_toggle_expanded_exec(bContext *C, wmOperator *op) +static int outliner_toggle_expanded_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOops *soops= CTX_wm_space_outliner(C); ARegion *ar= CTX_wm_region(C); @@ -1728,7 +1728,7 @@ void OUTLINER_OT_expanded_toggle(wmOperatorType *ot) /* --- */ -static int outliner_toggle_selected_exec(bContext *C, wmOperator *op) +static int outliner_toggle_selected_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOops *soops= CTX_wm_space_outliner(C); ARegion *ar= CTX_wm_region(C); @@ -2660,7 +2660,7 @@ static int do_outliner_item_rename(bContext *C, ARegion *ar, SpaceOops *soops, T return 0; } -static int outliner_item_rename(bContext *C, wmOperator *op, wmEvent *event) +static int outliner_item_rename(bContext *C, wmOperator *UNUSED(op), wmEvent *event) { ARegion *ar= CTX_wm_region(C); SpaceOops *soops= CTX_wm_space_outliner(C); @@ -2739,7 +2739,7 @@ static TreeElement *outliner_find_id(SpaceOops *soops, ListBase *lb, ID *id) return NULL; } -static int outliner_show_active_exec(bContext *C, wmOperator *op) +static int outliner_show_active_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOops *so= CTX_wm_space_outliner(C); Scene *scene= CTX_data_scene(C); @@ -2959,7 +2959,7 @@ static void tree_element_show_hierarchy(Scene *scene, SpaceOops *soops, ListBase } /* show entire object level hierarchy */ -static int outliner_show_hierarchy_exec(bContext *C, wmOperator *op) +static int outliner_show_hierarchy_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOops *soops= CTX_wm_space_outliner(C); ARegion *ar= CTX_wm_region(C); @@ -3714,7 +3714,7 @@ static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, S } -static int outliner_operation(bContext *C, wmOperator *op, wmEvent *event) +static int outliner_operation(bContext *C, wmOperator *UNUSED(op), wmEvent *event) { Scene *scene= CTX_data_scene(C); ARegion *ar= CTX_wm_region(C); @@ -3980,7 +3980,7 @@ static void do_outliner_drivers_editop(SpaceOops *soops, ListBase *tree, short m /* Add Operator ---------------------------------- */ -static int outliner_drivers_addsel_exec(bContext *C, wmOperator *op) +static int outliner_drivers_addsel_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOops *soutliner= CTX_wm_space_outliner(C); @@ -4015,7 +4015,7 @@ void OUTLINER_OT_drivers_add_selected(wmOperatorType *ot) /* Remove Operator ---------------------------------- */ -static int outliner_drivers_deletesel_exec(bContext *C, wmOperator *op) +static int outliner_drivers_deletesel_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOops *soutliner= CTX_wm_space_outliner(C); @@ -4190,7 +4190,7 @@ void OUTLINER_OT_keyingset_add_selected(wmOperatorType *ot) /* Remove Operator ---------------------------------- */ -static int outliner_keyingset_removeitems_exec(bContext *C, wmOperator *op) +static int outliner_keyingset_removeitems_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceOops *soutliner= CTX_wm_space_outliner(C); Scene *scene= CTX_data_scene(C); -- cgit v1.2.3 From e5fbd93cecc8527467cfe33a4c74a252c3d39828 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 16 Oct 2010 08:03:28 +0000 Subject: editors/space_* build without unused args warnings --- source/blender/editors/space_outliner/outliner.c | 233 ++++++++++++----------- 1 file changed, 117 insertions(+), 116 deletions(-) (limited to 'source/blender/editors/space_outliner/outliner.c') diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index c7e3340ba87..6040b755e30 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -120,7 +120,7 @@ /* ************* XXX **************** */ -static void error(const char *dummy, ...) {} +static void error(const char *UNUSED(arg), ...) {} /* ********************************** */ @@ -1556,7 +1556,7 @@ static void outliner_set_flag(SpaceOops *soops, ListBase *lb, short flag, short /* same check needed for both object operation and restrict column button func * return 0 when in edit mode (cannot restrict view or select) * otherwise return 1 */ -static int common_restrict_check(bContext *C, Scene *scene, Object *ob) +static int common_restrict_check(bContext *C, Object *ob) { /* Don't allow hide an object in edit mode, * check the bug #22153 and #21609, #23977 @@ -1575,13 +1575,13 @@ static int common_restrict_check(bContext *C, Scene *scene, Object *ob) return 1; } -void object_toggle_visibility_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +void object_toggle_visibility_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem) { Base *base= (Base *)te->directdata; Object *ob = (Object *)tselem->id; /* add check for edit mode */ - if(!common_restrict_check(C, scene, ob)) return; + if(!common_restrict_check(C, ob)) return; if(base || (base= object_in_scene(ob, scene))) { if((base->object->restrictflag ^= OB_RESTRICT_VIEW)) { @@ -1620,7 +1620,7 @@ void OUTLINER_OT_visibility_toggle(wmOperatorType *ot) /* --- */ -static void object_toggle_selectability_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +static void object_toggle_selectability_cb(bContext *UNUSED(C), Scene *scene, TreeElement *te, TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem) { Base *base= (Base *)te->directdata; @@ -1658,7 +1658,7 @@ void OUTLINER_OT_selectability_toggle(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -void object_toggle_renderability_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +void object_toggle_renderability_cb(bContext *UNUSED(C), Scene *scene, TreeElement *te, TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem) { Base *base= (Base *)te->directdata; @@ -1820,6 +1820,8 @@ void OUTLINER_OT_show_one_level(wmOperatorType *ot) RNA_def_boolean(ot->srna, "open", 1, "Open", "Expand all entries one level deep."); } +/* This is not used anywhere at the moment */ +#if 0 /* return 1 when levels were opened */ static int outliner_open_back(SpaceOops *soops, TreeElement *te) { @@ -1836,8 +1838,6 @@ static int outliner_open_back(SpaceOops *soops, TreeElement *te) return retval; } -/* This is not used anywhere at the moment */ -#if 0 static void outliner_open_reveal(SpaceOops *soops, ListBase *lb, TreeElement *teFind, int *found) { TreeElement *te; @@ -1863,7 +1863,7 @@ static void outliner_open_reveal(SpaceOops *soops, ListBase *lb, TreeElement *te #endif // XXX just use View2D ops for this? -void outliner_page_up_down(Scene *scene, ARegion *ar, SpaceOops *soops, int up) +void outliner_page_up_down(Scene *UNUSED(scene), ARegion *ar, SpaceOops *soops, int up) { int dy= ar->v2d.mask.ymax-ar->v2d.mask.ymin; @@ -2056,7 +2056,7 @@ static int tree_element_active_texture(bContext *C, Scene *scene, SpaceOops *soo } -static int tree_element_active_lamp(bContext *C, Scene *scene, SpaceOops *soops, TreeElement *te, int set) +static int tree_element_active_lamp(bContext *UNUSED(C), Scene *scene, SpaceOops *soops, TreeElement *te, int set) { Object *ob; @@ -2204,7 +2204,7 @@ static int tree_element_active_bone(bContext *C, Scene *scene, TreeElement *te, /* ebones only draw in editmode armature */ -static int tree_element_active_ebone(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tselem, int set) +static int tree_element_active_ebone(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *UNUSED(tselem), int set) { EditBone *ebone= te->directdata; @@ -2229,7 +2229,7 @@ static int tree_element_active_ebone(bContext *C, Scene *scene, TreeElement *te, return 0; } -static int tree_element_active_modifier(bContext *C, TreeElement *te, TreeStoreElem *tselem, int set) +static int tree_element_active_modifier(bContext *C, TreeElement *UNUSED(te), TreeStoreElem *tselem, int set) { if(set) { Object *ob= (Object *)tselem->id; @@ -2242,7 +2242,7 @@ static int tree_element_active_modifier(bContext *C, TreeElement *te, TreeStoreE return 0; } -static int tree_element_active_psys(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tselem, int set) +static int tree_element_active_psys(bContext *C, Scene *UNUSED(scene), TreeElement *UNUSED(te), TreeStoreElem *tselem, int set) { if(set) { Object *ob= (Object *)tselem->id; @@ -2255,7 +2255,7 @@ static int tree_element_active_psys(bContext *C, Scene *scene, TreeElement *te, return 0; } -static int tree_element_active_constraint(bContext *C, TreeElement *te, TreeStoreElem *tselem, int set) +static int tree_element_active_constraint(bContext *C, TreeElement *UNUSED(te), TreeStoreElem *tselem, int set) { if(set) { Object *ob= (Object *)tselem->id; @@ -2267,7 +2267,7 @@ static int tree_element_active_constraint(bContext *C, TreeElement *te, TreeStor return 0; } -static int tree_element_active_text(bContext *C, Scene *scene, SpaceOops *soops, TreeElement *te, int set) +static int tree_element_active_text(bContext *UNUSED(C), Scene *UNUSED(scene), SpaceOops *UNUSED(soops), TreeElement *UNUSED(te), int UNUSED(set)) { // XXX removed return 0; @@ -2292,7 +2292,7 @@ static int tree_element_active(bContext *C, Scene *scene, SpaceOops *soops, Tree return 0; } -static int tree_element_active_pose(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tselem, int set) +static int tree_element_active_pose(bContext *C, Scene *scene, TreeElement *UNUSED(te), TreeStoreElem *tselem, int set) { Object *ob= (Object *)tselem->id; Base *base= object_in_scene(ob, scene); @@ -2312,7 +2312,7 @@ static int tree_element_active_pose(bContext *C, Scene *scene, TreeElement *te, return 0; } -static int tree_element_active_sequence(bContext *C, TreeElement *te, TreeStoreElem *tselem, int set) +static int tree_element_active_sequence(TreeElement *te, TreeStoreElem *UNUSED(tselem), int set) { Sequence *seq= (Sequence*) te->directdata; @@ -2326,7 +2326,7 @@ static int tree_element_active_sequence(bContext *C, TreeElement *te, TreeStoreE return(0); } -static int tree_element_active_sequence_dup(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tselem, int set) +static int tree_element_active_sequence_dup(Scene *scene, TreeElement *te, TreeStoreElem *UNUSED(tselem), int set) { Sequence *seq, *p; Editing *ed= seq_give_editing(scene, FALSE); @@ -2353,7 +2353,7 @@ static int tree_element_active_sequence_dup(bContext *C, Scene *scene, TreeEleme return(0); } -static int tree_element_active_keymap_item(bContext *C, TreeElement *te, TreeStoreElem *tselem, int set) +static int tree_element_active_keymap_item(bContext *UNUSED(C), TreeElement *te, TreeStoreElem *UNUSED(tselem), int set) { wmKeyMapItem *kmi= te->directdata; @@ -2398,9 +2398,9 @@ static int tree_element_type_active(bContext *C, Scene *scene, SpaceOops *soops, case TSE_POSEGRP: return tree_element_active_posegroup(C, scene, te, tselem, set); case TSE_SEQUENCE: - return tree_element_active_sequence(C, te, tselem, set); + return tree_element_active_sequence(te, tselem, set); case TSE_SEQUENCE_DUP: - return tree_element_active_sequence_dup(C, scene, te, tselem, set); + return tree_element_active_sequence_dup(scene, te, tselem, set); case TSE_KEYMAP_ITEM: return tree_element_active_keymap_item(C, te, tselem, set); @@ -2687,39 +2687,6 @@ void OUTLINER_OT_item_rename(wmOperatorType *ot) ot->poll= ED_operator_outliner_active; } - - -/* recursive helper for function below */ -static void outliner_set_coordinates_element(SpaceOops *soops, TreeElement *te, int startx, int *starty) -{ - TreeStoreElem *tselem= TREESTORE(te); - - /* store coord and continue, we need coordinates for elements outside view too */ - te->xs= (float)startx; - te->ys= (float)(*starty); - *starty-= OL_H; - - if((tselem->flag & TSE_CLOSED)==0) { - TreeElement *ten; - for(ten= te->subtree.first; ten; ten= ten->next) { - outliner_set_coordinates_element(soops, ten, startx+OL_X, starty); - } - } - -} - -/* to retrieve coordinates with redrawing the entire tree */ -static void outliner_set_coordinates(ARegion *ar, SpaceOops *soops) -{ - TreeElement *te; - int starty= (int)(ar->v2d.tot.ymax)-OL_H; - int startx= 0; - - for(te= soops->tree.first; te; te= te->next) { - outliner_set_coordinates_element(soops, te, startx, &starty); - } -} - static TreeElement *outliner_find_id(SpaceOops *soops, ListBase *lb, ID *id) { TreeElement *te, *tes; @@ -2789,6 +2756,66 @@ void OUTLINER_OT_show_active(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } +/* tse is not in the treestore, we use its contents to find a match */ +static TreeElement *outliner_find_tse(SpaceOops *soops, TreeStoreElem *tse) +{ + TreeStore *ts= soops->treestore; + TreeStoreElem *tselem; + int a; + + if(tse->id==NULL) return NULL; + + /* check if 'tse' is in treestore */ + tselem= ts->data; + for(a=0; ausedelem; a++, tselem++) { + if((tse->type==0 && tselem->type==0) || (tselem->type==tse->type && tselem->nr==tse->nr)) { + if(tselem->id==tse->id) { + break; + } + } + } + if(tselem) + return outliner_find_tree_element(&soops->tree, a); + + return NULL; +} + + +/* Called to find an item based on name. + */ +#if 0 + +/* recursive helper for function below */ +static void outliner_set_coordinates_element(SpaceOops *soops, TreeElement *te, int startx, int *starty) +{ + TreeStoreElem *tselem= TREESTORE(te); + + /* store coord and continue, we need coordinates for elements outside view too */ + te->xs= (float)startx; + te->ys= (float)(*starty); + *starty-= OL_H; + + if((tselem->flag & TSE_CLOSED)==0) { + TreeElement *ten; + for(ten= te->subtree.first; ten; ten= ten->next) { + outliner_set_coordinates_element(soops, ten, startx+OL_X, starty); + } + } + +} + +/* to retrieve coordinates with redrawing the entire tree */ +static void outliner_set_coordinates(ARegion *ar, SpaceOops *soops) +{ + TreeElement *te; + int starty= (int)(ar->v2d.tot.ymax)-OL_H; + int startx= 0; + + for(te= soops->tree.first; te; te= te->next) { + outliner_set_coordinates_element(soops, te, startx, &starty); + } +} + /* find next element that has this name */ static TreeElement *outliner_find_named(SpaceOops *soops, ListBase *lb, char *name, int flags, TreeElement *prev, int *prevFound) { @@ -2818,34 +2845,7 @@ static TreeElement *outliner_find_named(SpaceOops *soops, ListBase *lb, char *na return NULL; } -/* tse is not in the treestore, we use its contents to find a match */ -static TreeElement *outliner_find_tse(SpaceOops *soops, TreeStoreElem *tse) -{ - TreeStore *ts= soops->treestore; - TreeStoreElem *tselem; - int a; - - if(tse->id==NULL) return NULL; - - /* check if 'tse' is in treestore */ - tselem= ts->data; - for(a=0; ausedelem; a++, tselem++) { - if((tse->type==0 && tselem->type==0) || (tselem->type==tse->type && tselem->nr==tse->nr)) { - if(tselem->id==tse->id) { - break; - } - } - } - if(tselem) - return outliner_find_tree_element(&soops->tree, a); - - return NULL; -} - - -/* Called to find an item based on name. - */ -void outliner_find_panel(Scene *scene, ARegion *ar, SpaceOops *soops, int again, int flags) +static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOops *soops, int again, int flags) { TreeElement *te= NULL; TreeElement *last_find; @@ -2917,6 +2917,7 @@ void outliner_find_panel(Scene *scene, ARegion *ar, SpaceOops *soops, int again, error("Not found: %s", name); } } +#endif /* helper function for tree_element_shwo_hierarchy() - recursively checks whether subtrees have any objects*/ static int subtree_has_objects(SpaceOops *soops, ListBase *lb) @@ -3077,7 +3078,7 @@ static void set_operation_types(SpaceOops *soops, ListBase *lb, } } -static void unlink_material_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +static void unlink_material_cb(bContext *UNUSED(C), Scene *UNUSED(scene), TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *UNUSED(tselem)) { Material **matar=NULL; int a, totcol=0; @@ -3111,7 +3112,7 @@ static void unlink_material_cb(bContext *C, Scene *scene, TreeElement *te, TreeS } } -static void unlink_texture_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +static void unlink_texture_cb(bContext *UNUSED(C), Scene *UNUSED(scene), TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *UNUSED(tselem)) { MTex **mtex= NULL; int a; @@ -3140,7 +3141,7 @@ static void unlink_texture_cb(bContext *C, Scene *scene, TreeElement *te, TreeSt } } -static void unlink_group_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +static void unlink_group_cb(bContext *UNUSED(C), Scene *UNUSED(scene), TreeElement *UNUSED(te), TreeStoreElem *tsep, TreeStoreElem *tselem) { Group *group= (Group *)tselem->id; @@ -3177,7 +3178,7 @@ static void outliner_do_libdata_operation(bContext *C, Scene *scene, SpaceOops * /* */ -static void object_select_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +static void object_select_cb(bContext *UNUSED(C), Scene *scene, TreeElement *te, TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem) { Base *base= (Base *)te->directdata; @@ -3188,7 +3189,7 @@ static void object_select_cb(bContext *C, Scene *scene, TreeElement *te, TreeSto } } -static void object_deselect_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +static void object_deselect_cb(bContext *UNUSED(C), Scene *scene, TreeElement *te, TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem) { Base *base= (Base *)te->directdata; @@ -3199,7 +3200,7 @@ static void object_deselect_cb(bContext *C, Scene *scene, TreeElement *te, TreeS } } -static void object_delete_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +static void object_delete_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem) { Base *base= (Base *)te->directdata; @@ -3217,7 +3218,7 @@ static void object_delete_cb(bContext *C, Scene *scene, TreeElement *te, TreeSto } -static void id_local_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +static void id_local_cb(bContext *UNUSED(C), Scene *UNUSED(scene), TreeElement *UNUSED(te), TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem) { if(tselem->id->lib && (tselem->id->flag & LIB_EXTERN)) { tselem->id->lib= NULL; @@ -3226,7 +3227,7 @@ static void id_local_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreEle } } -static void group_linkobs2scene_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem) +static void group_linkobs2scene_cb(bContext *UNUSED(C), Scene *scene, TreeElement *UNUSED(te), TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem) { Group *group= (Group *)tselem->id; GroupObject *gob; @@ -3279,7 +3280,7 @@ static void outliner_do_object_operation(bContext *C, Scene *scene_act, SpaceOop /* ******************************************** */ -static void pchan_cb(int event, TreeElement *te, TreeStoreElem *tselem) +static void pchan_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem)) { bPoseChannel *pchan= (bPoseChannel *)te->directdata; @@ -3295,7 +3296,7 @@ static void pchan_cb(int event, TreeElement *te, TreeStoreElem *tselem) pchan->bone->flag &= ~BONE_HIDDEN_P; } -static void bone_cb(int event, TreeElement *te, TreeStoreElem *tselem) +static void bone_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem)) { Bone *bone= (Bone *)te->directdata; @@ -3311,7 +3312,7 @@ static void bone_cb(int event, TreeElement *te, TreeStoreElem *tselem) bone->flag &= ~BONE_HIDDEN_P; } -static void ebone_cb(int event, TreeElement *te, TreeStoreElem *tselem) +static void ebone_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem)) { EditBone *ebone= (EditBone *)te->directdata; @@ -3327,7 +3328,7 @@ static void ebone_cb(int event, TreeElement *te, TreeStoreElem *tselem) ebone->flag &= ~BONE_HIDDEN_A; } -static void sequence_cb(int event, TreeElement *te, TreeStoreElem *tselem) +static void sequence_cb(int event, TreeElement *UNUSED(te), TreeStoreElem *UNUSED(tselem)) { // Sequence *seq= (Sequence*) te->directdata; if(event==1) { @@ -3354,7 +3355,7 @@ static void outliner_do_data_operation(SpaceOops *soops, int type, int event, Li } } -void outliner_del(bContext *C, Scene *scene, ARegion *ar, SpaceOops *soops) +void outliner_del(bContext *C, Scene *scene, ARegion *UNUSED(ar), SpaceOops *soops) { if(soops->outlinevis==SO_SEQUENCE) @@ -3764,7 +3765,7 @@ static int ed_operator_outliner_datablocks_active(bContext *C) * this function does not do that yet */ static void tree_element_to_path(SpaceOops *soops, TreeElement *te, TreeStoreElem *tselem, - ID **id, char **path, int *array_index, short *flag, short *groupmode) + ID **id, char **path, int *array_index, short *flag, short *UNUSED(groupmode)) { ListBase hierarchy = {NULL, NULL}; LinkData *ld; @@ -4816,7 +4817,7 @@ static void outliner_draw_tree(bContext *C, uiBlock *block, Scene *scene, ARegio } -static void outliner_back(ARegion *ar, SpaceOops *soops) +static void outliner_back(ARegion *ar) { int ystart; @@ -4830,7 +4831,7 @@ static void outliner_back(ARegion *ar, SpaceOops *soops) } } -static void outliner_draw_restrictcols(ARegion *ar, SpaceOops *soops) +static void outliner_draw_restrictcols(ARegion *ar) { int ystart; @@ -4873,7 +4874,7 @@ static void restrictbutton_view_cb(bContext *C, void *poin, void *poin2) Scene *scene = (Scene *)poin; Object *ob = (Object *)poin2; - if(!common_restrict_check(C, scene, ob)) return; + if(!common_restrict_check(C, ob)) return; /* deselect objects that are invisible */ if (ob->restrictflag & OB_RESTRICT_VIEW) { @@ -4890,7 +4891,7 @@ static void restrictbutton_sel_cb(bContext *C, void *poin, void *poin2) Scene *scene = (Scene *)poin; Object *ob = (Object *)poin2; - if(!common_restrict_check(C, scene, ob)) return; + if(!common_restrict_check(C, ob)) return; /* if select restriction has just been turned on */ if (ob->restrictflag & OB_RESTRICT_SELECT) { @@ -4902,17 +4903,17 @@ static void restrictbutton_sel_cb(bContext *C, void *poin, void *poin2) } -static void restrictbutton_rend_cb(bContext *C, void *poin, void *poin2) +static void restrictbutton_rend_cb(bContext *C, void *poin, void *UNUSED(poin2)) { WM_event_add_notifier(C, NC_SCENE|ND_OB_RENDER, poin); } -static void restrictbutton_r_lay_cb(bContext *C, void *poin, void *poin2) +static void restrictbutton_r_lay_cb(bContext *C, void *poin, void *UNUSED(poin2)) { WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, poin); } -static void restrictbutton_modifier_cb(bContext *C, void *poin, void *poin2) +static void restrictbutton_modifier_cb(bContext *C, void *UNUSED(poin), void *poin2) { Object *ob = (Object *)poin2; @@ -4921,7 +4922,7 @@ static void restrictbutton_modifier_cb(bContext *C, void *poin, void *poin2) WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); } -static void restrictbutton_bone_cb(bContext *C, void *poin, void *poin2) +static void restrictbutton_bone_cb(bContext *C, void *UNUSED(poin), void *poin2) { Bone *bone= (Bone *)poin2; if(bone && (bone->flag & BONE_HIDDEN_P)) @@ -4929,7 +4930,7 @@ static void restrictbutton_bone_cb(bContext *C, void *poin, void *poin2) WM_event_add_notifier(C, NC_OBJECT|ND_POSE, NULL); } -static void restrictbutton_ebone_cb(bContext *C, void *poin, void *poin2) +static void restrictbutton_ebone_cb(bContext *C, void *UNUSED(poin), void *poin2) { EditBone *ebone= (EditBone *)poin2; if(ebone && (ebone->flag & BONE_HIDDEN_A)) @@ -4961,7 +4962,7 @@ static int group_select_flag(Group *gr) return 0; } -static void restrictbutton_gr_restrict_flag(bContext *C, void *poin, void *poin2, int flag) +static void restrictbutton_gr_restrict_flag(void *poin, void *poin2, int flag) { Scene *scene = (Scene *)poin; GroupObject *gob; @@ -4989,17 +4990,17 @@ static void restrictbutton_gr_restrict_flag(bContext *C, void *poin, void *poin2 static void restrictbutton_gr_restrict_view(bContext *C, void *poin, void *poin2) { - restrictbutton_gr_restrict_flag(C, poin, poin2, OB_RESTRICT_VIEW); + restrictbutton_gr_restrict_flag(poin, poin2, OB_RESTRICT_VIEW); WM_event_add_notifier(C, NC_GROUP, NULL); } static void restrictbutton_gr_restrict_select(bContext *C, void *poin, void *poin2) { - restrictbutton_gr_restrict_flag(C, poin, poin2, OB_RESTRICT_SELECT); + restrictbutton_gr_restrict_flag(poin, poin2, OB_RESTRICT_SELECT); WM_event_add_notifier(C, NC_GROUP, NULL); } static void restrictbutton_gr_restrict_render(bContext *C, void *poin, void *poin2) { - restrictbutton_gr_restrict_flag(C, poin, poin2, OB_RESTRICT_RENDER); + restrictbutton_gr_restrict_flag(poin, poin2, OB_RESTRICT_RENDER); WM_event_add_notifier(C, NC_GROUP, NULL); } @@ -5245,7 +5246,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar } } -static void outliner_draw_rnacols(ARegion *ar, SpaceOops *soops, int sizex) +static void outliner_draw_rnacols(ARegion *ar, int sizex) { View2D *v2d= &ar->v2d; @@ -5297,7 +5298,7 @@ static void outliner_draw_rnabuts(uiBlock *block, Scene *scene, ARegion *ar, Spa } } -static void operator_call_cb(struct bContext *C, void *arg_kmi, void *arg2) +static void operator_call_cb(struct bContext *UNUSED(C), void *arg_kmi, void *arg2) { wmOperatorType *ot= arg2; wmKeyMapItem *kmi= arg_kmi; @@ -5306,7 +5307,7 @@ static void operator_call_cb(struct bContext *C, void *arg_kmi, void *arg2) BLI_strncpy(kmi->idname, ot->idname, OP_MAX_TYPENAME); } -static void operator_search_cb(const struct bContext *C, void *arg_kmi, char *str, uiSearchItems *items) +static void operator_search_cb(const struct bContext *UNUSED(C), void *UNUSED(arg_kmi), char *str, uiSearchItems *items) { wmOperatorType *ot = WM_operatortype_first(); @@ -5457,7 +5458,7 @@ static char *keymap_tweak_dir_menu(void) } -static void keymap_type_cb(bContext *C, void *kmi_v, void *unused_v) +static void keymap_type_cb(bContext *C, void *kmi_v, void *UNUSED(arg_v)) { wmKeyMapItem *kmi= kmi_v; short maptype= keymap_menu_type(kmi->type); @@ -5662,13 +5663,13 @@ void draw_outliner(const bContext *C) UI_view2d_view_ortho(v2d); /* draw outliner stuff (background, hierachy lines and names) */ - outliner_back(ar, soops); + outliner_back(ar); block= uiBeginBlock(C, ar, "outliner buttons", UI_EMBOSS); outliner_draw_tree((bContext *)C, block, scene, ar, soops); if(ELEM(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF)) { /* draw rna buttons */ - outliner_draw_rnacols(ar, soops, sizex_rna); + outliner_draw_rnacols(ar, sizex_rna); outliner_draw_rnabuts(block, scene, ar, soops, sizex_rna, &soops->tree); } else if(soops->outlinevis == SO_KEYMAP) { @@ -5676,7 +5677,7 @@ void draw_outliner(const bContext *C) } else if (!(soops->flag & SO_HIDE_RESTRICTCOLS)) { /* draw restriction columns */ - outliner_draw_restrictcols(ar, soops); + outliner_draw_restrictcols(ar); outliner_draw_restrictbuts(block, scene, ar, soops, &soops->tree); } -- cgit v1.2.3 From 4d37cf90b9d9d8ed2f0339c8ccd72481e29a4514 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 18 Oct 2010 06:41:16 +0000 Subject: remove G.sce, use G.main->name instead. Both stored the filename of the blend file, but G.sce stored the last opened file. This will make blender act differently in some cases since a relative path to the last opened file will no longer resolve (which is correct IMHO since that file isnt open and the path might not even be valid anymore). Tested linking with durian files and rendering to relative paths when no files is loaded however we may need to have some operators give an error if they are used on the default startup.blend. --- source/blender/editors/space_outliner/outliner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/space_outliner/outliner.c') diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 6040b755e30..1f0725c5458 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -5035,7 +5035,7 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname) if (te->idcode == ID_LI) { char expanded[FILE_MAXDIR + FILE_MAXFILE]; BLI_strncpy(expanded, ((Library *)tselem->id)->name, FILE_MAXDIR + FILE_MAXFILE); - BLI_path_abs(expanded, G.sce); + BLI_path_abs(expanded, G.main->name); if (!BLI_exists(expanded)) { error("This path does not exist, correct this before saving"); } -- cgit v1.2.3