no functional changes. use sizeof() and MAXFRAME

This commit is contained in:
Campbell Barton
2010-04-04 14:33:41 +00:00
parent cddd6a56dd
commit 97454d7b85
8 changed files with 24 additions and 24 deletions

View 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);
}

View 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));

View 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 */

View 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));

View 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;

View 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);

View 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);
}

View 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);