no functional changes. use sizeof() and MAXFRAME
authorCampbell Barton <ideasman42@gmail.com>
Sun, 4 Apr 2010 14:33:41 +0000 (14:33 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 4 Apr 2010 14:33:41 +0000 (14:33 +0000)
source/blender/makesrna/intern/rna_armature.c
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_key.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_object_force.c
source/blender/makesrna/intern/rna_pose.c
source/blender/makesrna/intern/rna_sequencer.c

index 137e9ce..1ad63d6 100644 (file)
@@ -210,11 +210,11 @@ static void rna_EditBone_name_set(PointerRNA *ptr, const char *value)
 {
        bArmature *arm= (bArmature*)ptr->id.data;
        EditBone *ebone= (EditBone*)ptr->data;
-       char oldname[32], newname[32];
+       char oldname[sizeof(ebone->name)], newname[sizeof(ebone->name)];
        
        /* need to be on the stack */
-       BLI_strncpy(newname, value, 32);
-       BLI_strncpy(oldname, ebone->name, 32);
+       BLI_strncpy(newname, value, sizeof(ebone->name));
+       BLI_strncpy(oldname, ebone->name, sizeof(ebone->name));
        
        ED_armature_bone_rename(arm, oldname, newname);
 }
@@ -223,12 +223,12 @@ static void rna_Bone_name_set(PointerRNA *ptr, const char *value)
 {
        bArmature *arm= (bArmature*)ptr->id.data;
        Bone *bone= (Bone*)ptr->data;
-       char oldname[32], newname[32];
+       char oldname[sizeof(bone->name)], newname[sizeof(bone->name)];
        
        /* need to be on the stack */
-       BLI_strncpy(newname, value, 32);
-       BLI_strncpy(oldname, bone->name, 32);
-       
+       BLI_strncpy(newname, value, sizeof(bone->name));
+       BLI_strncpy(oldname, bone->name, sizeof(bone->name));
+
        ED_armature_bone_rename(arm, oldname, newname);
 }
 
index 6947c94..c61ebf5 100644 (file)
@@ -165,10 +165,10 @@ static StructRNA *rna_ConstraintType_refine(struct PointerRNA *ptr)
 static void rna_Constraint_name_set(PointerRNA *ptr, const char *value)
 {
        bConstraint *con= ptr->data;
-       char oldname[32];
+       char oldname[sizeof(con->name)];
        
        /* make a copy of the old name first */
-       BLI_strncpy(oldname, con->name, sizeof(oldname));
+       BLI_strncpy(oldname, con->name, sizeof(con->name));
        
        /* copy the new name into the name slot */
        BLI_strncpy(con->name, value, sizeof(con->name));
index 47accb8..7e9aebe 100644 (file)
@@ -64,10 +64,10 @@ static Key *rna_ShapeKey_find_key(ID *id)
 void rna_ShapeKey_name_set(PointerRNA *ptr, const char *value)
 {
        KeyBlock *kb= ptr->data;
-       char oldname[32];
+       char oldname[sizeof(kb->name)];
        
        /* make a copy of the old name first */
-       BLI_strncpy(oldname, kb->name, sizeof(oldname));
+       BLI_strncpy(oldname, kb->name, sizeof(kb->name));
        
        /* copy the new name into the name slot */
        BLI_strncpy(kb->name, value, sizeof(kb->name));
@@ -75,7 +75,7 @@ void rna_ShapeKey_name_set(PointerRNA *ptr, const char *value)
        /* make sure the name is truly unique */
        if (ptr->id.data) {
                Key *key= rna_ShapeKey_find_key(ptr->id.data);
-               BLI_uniquename(&key->block, kb, "Key", '.', offsetof(KeyBlock, name), 32);
+               BLI_uniquename(&key->block, kb, "Key", '.', offsetof(KeyBlock, name), sizeof(kb->name));
        }
        
        /* fix all the animation data which may link to this */
index e789d2d..d4bc2d6 100644 (file)
@@ -176,10 +176,10 @@ static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr)
 void rna_Modifier_name_set(PointerRNA *ptr, const char *value)
 {
        ModifierData *md= ptr->data;
-       char oldname[32];
+       char oldname[sizeof(md->name)];
        
        /* make a copy of the old name first */
-       BLI_strncpy(oldname, md->name, sizeof(oldname));
+       BLI_strncpy(oldname, md->name, sizeof(md->name));
        
        /* copy the new name into the name slot */
        BLI_strncpy(md->name, value, sizeof(md->name));
index 2227304..82d0f0b 100644 (file)
@@ -166,10 +166,10 @@ static void rna_Node_update_name(Main *bmain, Scene *scene, PointerRNA *ptr)
 {
        bNodeTree *ntree= (bNodeTree*)ptr->id.data;
        bNode *node= (bNode*)ptr->data;
-       char oldname[32];
+       char oldname[sizeof(node->name)];
        
        /* make a copy of the old name first */
-       BLI_strncpy(oldname, node->name, sizeof(oldname));
+       BLI_strncpy(oldname, node->name, sizeof(node->name));
        
        nodeUniqueName(ntree, node);
        node->flag |= NODE_CUSTOM_NAME;
index 56f6792..238098e 100644 (file)
@@ -679,12 +679,12 @@ static void rna_def_pointcache(BlenderRNA *brna)
        
        prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
        RNA_def_property_int_sdna(prop, NULL, "startframe");
-       RNA_def_property_range(prop, 1, 300000);
+       RNA_def_property_range(prop, 1, MAXFRAME);
        RNA_def_property_ui_text(prop, "Start", "Frame on which the simulation starts");
        
        prop= RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
        RNA_def_property_int_sdna(prop, NULL, "endframe");
-       RNA_def_property_range(prop, 1, 300000);
+       RNA_def_property_range(prop, 1, MAXFRAME);
        RNA_def_property_ui_text(prop, "End", "Frame on which the simulation stops");
 
        prop= RNA_def_property(srna, "step", PROP_INT, PROP_NONE);
index 39694b5..0d31ec4 100644 (file)
@@ -197,12 +197,12 @@ static void rna_PoseChannel_name_set(PointerRNA *ptr, const char *value)
 {
        Object *ob= (Object*)ptr->id.data;
        bPoseChannel *pchan= (bPoseChannel*)ptr->data;
-       char oldname[32], newname[32];
-       
+       char oldname[sizeof(pchan->name)], newname[sizeof(pchan->name)];
+
        /* need to be on the stack */
-       BLI_strncpy(newname, value, 32);
-       BLI_strncpy(oldname, pchan->name, 32);
-       
+       BLI_strncpy(newname, value, sizeof(pchan->name));
+       BLI_strncpy(oldname, pchan->name, sizeof(pchan->name));
+
        ED_armature_bone_rename(ob->data, oldname, newname);
 }
 
index 950d9bc..be6bb1f 100644 (file)
@@ -236,7 +236,7 @@ static void rna_Sequence_name_set(PointerRNA *ptr, const char *value)
 {
        Scene *scene= (Scene*)ptr->id.data;
        Sequence *seq= (Sequence*)ptr->data;
-       char oldname[32];
+       char oldname[sizeof(seq->name)];
        
        /* make a copy of the old name first */
        BLI_strncpy(oldname, seq->name+2, sizeof(seq->name)-2);