code cleanup: use `const char` for args and replace wm_keyconfig_list_find() -> BLI_f...
authorCampbell Barton <ideasman42@gmail.com>
Sat, 13 Apr 2013 04:28:04 +0000 (04:28 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 13 Apr 2013 04:28:04 +0000 (04:28 +0000)
source/blender/blenkernel/BKE_sequencer.h
source/blender/blenkernel/intern/seqmodifier.c
source/blender/editors/armature/armature_add.c
source/blender/editors/armature/armature_naming.c
source/blender/editors/curve/editcurve.c
source/blender/editors/object/object_vgroup.c
source/blender/windowmanager/intern/wm_keymap.c

index 9586df6d119245364688ddf31f8b8323cf7e723b..a161a0885899b3361d8e1ab2d0407ae69678e906 100644 (file)
@@ -409,7 +409,7 @@ int BKE_sequence_modifier_remove(struct Sequence *seq, struct SequenceModifierDa
 void BKE_sequence_modifier_clear(struct Sequence *seq);
 void BKE_sequence_modifier_free(struct SequenceModifierData *smd);
 void BKE_sequence_modifier_unique_name(struct Sequence *seq, struct SequenceModifierData *smd);
 void BKE_sequence_modifier_clear(struct Sequence *seq);
 void BKE_sequence_modifier_free(struct SequenceModifierData *smd);
 void BKE_sequence_modifier_unique_name(struct Sequence *seq, struct SequenceModifierData *smd);
-struct SequenceModifierData *BKE_sequence_modifier_find_by_name(struct Sequence *seq, char *name);
+struct SequenceModifierData *BKE_sequence_modifier_find_by_name(struct Sequence *seq, const char *name);
 struct ImBuf *BKE_sequence_modifier_apply_stack(SeqRenderData context, struct Sequence *seq, struct ImBuf *ibuf, int cfra);
 void BKE_sequence_modifier_list_copy(struct Sequence *seqn, struct Sequence *seq);
 
 struct ImBuf *BKE_sequence_modifier_apply_stack(SeqRenderData context, struct Sequence *seq, struct ImBuf *ibuf, int cfra);
 void BKE_sequence_modifier_list_copy(struct Sequence *seqn, struct Sequence *seq);
 
index 595907ffb275850ba3fd768019f3148f4c77a557..1787bd112988d16e15ccc6e05e4d83ee920f9802 100644 (file)
@@ -578,7 +578,7 @@ void BKE_sequence_modifier_unique_name(Sequence *seq, SequenceModifierData *smd)
                       offsetof(SequenceModifierData, name), sizeof(smd->name));
 }
 
                       offsetof(SequenceModifierData, name), sizeof(smd->name));
 }
 
-SequenceModifierData *BKE_sequence_modifier_find_by_name(Sequence *seq, char *name)
+SequenceModifierData *BKE_sequence_modifier_find_by_name(Sequence *seq, const char *name)
 {
        return BLI_findstring(&(seq->modifiers), name, offsetof(SequenceModifierData, name));
 }
 {
        return BLI_findstring(&(seq->modifiers), name, offsetof(SequenceModifierData, name));
 }
index 28fb74f0cdd8dc5d561ce72e86a79be92106fd3c..13c1f2d5b2b4eed3358a13c61e89476163a177c1 100644 (file)
@@ -279,7 +279,7 @@ EditBone *add_points_bone(Object *obedit, float head[3], float tail[3])
 }
 
 
 }
 
 
-static EditBone *get_named_editbone(ListBase *edbo, char *name)
+static EditBone *get_named_editbone(ListBase *edbo, const char *name)
 {
        EditBone  *eBone;
 
 {
        EditBone  *eBone;
 
index 196b8064967bf5f50debf150d8645545c42f42f9..1ee2dc80a975820e32f72e7ef2d39af9c6658ee8 100644 (file)
@@ -104,7 +104,7 @@ static void unique_bone_name(bArmature *arm, char *name)
 }
 
 /* helper call for armature_bone_rename */
 }
 
 /* helper call for armature_bone_rename */
-static void constraint_bone_name_fix(Object *ob, ListBase *conlist, char *oldname, char *newname)
+static void constraint_bone_name_fix(Object *ob, ListBase *conlist, const char *oldname, const char *newname)
 {
        bConstraint *curcon;
        bConstraintTarget *ct;
 {
        bConstraint *curcon;
        bConstraintTarget *ct;
index 314967d4426e3d1ff5237038c6f885c1232fb4e1..953372bda424b247f685cb2ec0c5b6b87dd51495 100644 (file)
@@ -1028,7 +1028,8 @@ static int curve_is_animated(Curve *cu)
        return ad && (ad->action || ad->drivers.first);
 }
 
        return ad && (ad->action || ad->drivers.first);
 }
 
-static void fcurve_path_rename(AnimData *adt, char *orig_rna_path, char *rna_path, ListBase *orig_curves, ListBase *curves)
+static void fcurve_path_rename(AnimData *adt, const char *orig_rna_path, char *rna_path,
+                               ListBase *orig_curves, ListBase *curves)
 {
        FCurve *fcu, *nfcu, *nextfcu;
        int len = strlen(orig_rna_path);
 {
        FCurve *fcu, *nfcu, *nextfcu;
        int len = strlen(orig_rna_path);
index a9fac006486f11235eb0856d03f31a72f623f22b..623e23588f0f7d556a943fd36a006578c089e7cd 100644 (file)
@@ -3479,7 +3479,7 @@ static char *vgroup_init_remap(Object *ob)
        return name_array;
 }
 
        return name_array;
 }
 
-static int vgroup_do_remap(Object *ob, char *name_array, wmOperator *op)
+static int vgroup_do_remap(Object *ob, const char *name_array, wmOperator *op)
 {
        MDeformVert *dvert = NULL;
        bDeformGroup *def;
 {
        MDeformVert *dvert = NULL;
        bDeformGroup *def;
@@ -3489,7 +3489,7 @@ static int vgroup_do_remap(Object *ob, char *name_array, wmOperator *op)
        int *sort_map_update = MEM_mallocN(sizeof(int) * (defbase_tot + 1), "sort vgroups");
        int *sort_map = sort_map_update + 1;
 
        int *sort_map_update = MEM_mallocN(sizeof(int) * (defbase_tot + 1), "sort vgroups");
        int *sort_map = sort_map_update + 1;
 
-       char *name;
+       const char *name;
        int i;
 
        name = name_array;
        int i;
 
        name = name_array;
index f06bae1d084307915bee28ff2113ddd613609cca..d5b6d2cd0c8f7cb0c303613448627f97bb97ffa7 100644 (file)
@@ -220,23 +220,12 @@ void WM_keyconfig_free(wmKeyConfig *keyconf)
        MEM_freeN(keyconf);
 }
 
        MEM_freeN(keyconf);
 }
 
-static wmKeyConfig *wm_keyconfig_list_find(ListBase *lb, char *idname)
-{
-       wmKeyConfig *kc;
-
-       for (kc = lb->first; kc; kc = kc->next)
-               if (0 == strncmp(idname, kc->idname, KMAP_MAX_NAME))
-                       return kc;
-       
-       return NULL;
-}
-
 static wmKeyConfig *WM_keyconfig_active(wmWindowManager *wm)
 {
        wmKeyConfig *keyconf;
 
        /* first try from preset */
 static wmKeyConfig *WM_keyconfig_active(wmWindowManager *wm)
 {
        wmKeyConfig *keyconf;
 
        /* first try from preset */
-       keyconf = wm_keyconfig_list_find(&wm->keyconfigs, U.keyconfigstr);
+       keyconf = BLI_findstring(&wm->keyconfigs, U.keyconfigstr, offsetof(wmKeyConfig, idname));
        if (keyconf)
                return keyconf;
        
        if (keyconf)
                return keyconf;