Cleanup: use the term "value" for RNA get/set functions
This is already used in most functions.
This commit is contained in:
parent
b0caddc32b
commit
2100ebca7a
@ -196,8 +196,8 @@ static int path_normalize_impl(char *path, bool check_blend_relative_prefix)
|
||||
/* NOTE(@ideasman42):
|
||||
* `memmove(start, eind, strlen(eind) + 1);`
|
||||
* is the same as
|
||||
* `strcpy(start, eind);`
|
||||
* except `strcpy` should not be used because there is overlap,
|
||||
* `BLI_strncpy(start, eind, ...);`
|
||||
* except string-copy should not be used because there is overlap,
|
||||
* so use `memmove` 's slightly more obscure syntax. */
|
||||
|
||||
/* Inline replacement:
|
||||
|
@ -1357,7 +1357,7 @@ static int rna_MaterialSlot_name_length(PointerRNA *ptr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rna_MaterialSlot_name_get(PointerRNA *ptr, char *str)
|
||||
static void rna_MaterialSlot_name_get(PointerRNA *ptr, char *value)
|
||||
{
|
||||
Object *ob = reinterpret_cast<Object *>(ptr->owner_id);
|
||||
Material *ma;
|
||||
@ -1366,10 +1366,10 @@ static void rna_MaterialSlot_name_get(PointerRNA *ptr, char *str)
|
||||
ma = BKE_object_material_get(ob, index + 1);
|
||||
|
||||
if (ma) {
|
||||
strcpy(str, ma->id.name + 2);
|
||||
strcpy(value, ma->id.name + 2);
|
||||
}
|
||||
else {
|
||||
str[0] = '\0';
|
||||
value[0] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1168,7 +1168,7 @@ static void rna_ParticleSystem_active_particle_target_index_set(struct PointerRN
|
||||
}
|
||||
}
|
||||
|
||||
static void rna_ParticleTarget_name_get(PointerRNA *ptr, char *str)
|
||||
static void rna_ParticleTarget_name_get(PointerRNA *ptr, char *value)
|
||||
{
|
||||
ParticleTarget *pt = ptr->data;
|
||||
|
||||
@ -1185,28 +1185,28 @@ static void rna_ParticleTarget_name_get(PointerRNA *ptr, char *str)
|
||||
|
||||
if (psys) {
|
||||
if (pt->ob) {
|
||||
BLI_sprintf(str, "%s: %s", pt->ob->id.name + 2, psys->name);
|
||||
BLI_sprintf(value, "%s: %s", pt->ob->id.name + 2, psys->name);
|
||||
}
|
||||
else {
|
||||
strcpy(str, psys->name);
|
||||
strcpy(value, psys->name);
|
||||
}
|
||||
}
|
||||
else {
|
||||
strcpy(str, TIP_("Invalid target!"));
|
||||
strcpy(value, TIP_("Invalid target!"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
strcpy(str, TIP_("Invalid target!"));
|
||||
strcpy(value, TIP_("Invalid target!"));
|
||||
}
|
||||
}
|
||||
|
||||
static int rna_ParticleTarget_name_length(PointerRNA *ptr)
|
||||
{
|
||||
char tstr[MAX_ID_NAME + MAX_ID_NAME + 64];
|
||||
char tvalue[MAX_ID_NAME + MAX_ID_NAME + 64];
|
||||
|
||||
rna_ParticleTarget_name_get(ptr, tstr);
|
||||
rna_ParticleTarget_name_get(ptr, tvalue);
|
||||
|
||||
return strlen(tstr);
|
||||
return strlen(tvalue);
|
||||
}
|
||||
|
||||
static int particle_id_check(const PointerRNA *ptr)
|
||||
@ -1304,7 +1304,7 @@ static void rna_ParticleDupliWeight_active_index_set(struct PointerRNA *ptr, int
|
||||
}
|
||||
}
|
||||
|
||||
static void rna_ParticleDupliWeight_name_get(PointerRNA *ptr, char *str)
|
||||
static void rna_ParticleDupliWeight_name_get(PointerRNA *ptr, char *value)
|
||||
{
|
||||
ParticleSettings *part = (ParticleSettings *)ptr->owner_id;
|
||||
psys_find_group_weights(part);
|
||||
@ -1312,20 +1312,20 @@ static void rna_ParticleDupliWeight_name_get(PointerRNA *ptr, char *str)
|
||||
ParticleDupliWeight *dw = ptr->data;
|
||||
|
||||
if (dw->ob) {
|
||||
BLI_sprintf(str, "%s: %i", dw->ob->id.name + 2, dw->count);
|
||||
BLI_sprintf(value, "%s: %i", dw->ob->id.name + 2, dw->count);
|
||||
}
|
||||
else {
|
||||
strcpy(str, "No object");
|
||||
strcpy(value, "No object");
|
||||
}
|
||||
}
|
||||
|
||||
static int rna_ParticleDupliWeight_name_length(PointerRNA *ptr)
|
||||
{
|
||||
char tstr[MAX_ID_NAME + 64];
|
||||
char tvalue[MAX_ID_NAME + 64];
|
||||
|
||||
rna_ParticleDupliWeight_name_get(ptr, tstr);
|
||||
rna_ParticleDupliWeight_name_get(ptr, tvalue);
|
||||
|
||||
return strlen(tstr);
|
||||
return strlen(tvalue);
|
||||
}
|
||||
|
||||
static const EnumPropertyItem *rna_Particle_type_itemf(bContext *UNUSED(C),
|
||||
|
@ -349,15 +349,15 @@ static int rna_TextureSlot_name_length(PointerRNA *ptr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rna_TextureSlot_name_get(PointerRNA *ptr, char *str)
|
||||
static void rna_TextureSlot_name_get(PointerRNA *ptr, char *value)
|
||||
{
|
||||
MTex *mtex = ptr->data;
|
||||
|
||||
if (mtex->tex) {
|
||||
strcpy(str, mtex->tex->id.name + 2);
|
||||
strcpy(value, mtex->tex->id.name + 2);
|
||||
}
|
||||
else {
|
||||
str[0] = '\0';
|
||||
value[0] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user