diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-11-23 07:45:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-11-23 09:40:49 +0300 |
commit | 6e4cb463c44ab57331cda7ded645b4faa573bbb3 (patch) | |
tree | 8da615bcb135c1f52872a9a9b34a888a0ccf064f /source/blender/makesrna/intern | |
parent | daa90de3fdb5b9971b713c13a67b9c0a0990b3d7 (diff) |
Cleanup: shadowing (rna, modifiers, *misc*)
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 25 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_color.c | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object_force.c | 6 |
3 files changed, 17 insertions, 19 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 3ec649afcc9..5e4ea749b22 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -3396,7 +3396,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro void *inarray, RawPropertyType intype, int inlen, int set) { StructRNA *ptype; - PointerRNA itemptr; + PointerRNA itemptr_base; PropertyRNA *itemprop, *iprop; PropertyType itemtype = 0; RawArray in; @@ -3411,8 +3411,8 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro ptype = RNA_property_pointer_type(ptr, prop); /* try to get item property pointer */ - RNA_pointer_create(NULL, ptype, NULL, &itemptr); - itemprop = RNA_struct_find_property(&itemptr, propname); + RNA_pointer_create(NULL, ptype, NULL, &itemptr_base); + itemprop = RNA_struct_find_property(&itemptr_base, propname); if (itemprop) { /* we have item property pointer */ @@ -3427,7 +3427,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro } /* check item array */ - itemlen = RNA_property_array_length(&itemptr, itemprop); + itemlen = RNA_property_array_length(&itemptr_base, itemprop); /* dynamic array? need to get length per item */ if (itemprop->getlength) { @@ -4222,7 +4222,7 @@ static bool rna_path_parse(PointerRNA *ptr, const char *path, *r_index = index; if (prop_elem && (prop_elem->ptr.data != curptr.data || prop_elem->prop != prop || prop_elem->index != index)) { - PropertyElemRNA *prop_elem = MEM_mallocN(sizeof(PropertyElemRNA), __func__); + prop_elem = MEM_mallocN(sizeof(PropertyElemRNA), __func__); prop_elem->ptr = curptr; prop_elem->prop = prop; prop_elem->index = index; @@ -4505,12 +4505,12 @@ static char *rna_idp_path(PointerRNA *ptr, IDProperty *haystack, IDProperty *nee break; } else { - int i; + int j; link.name = iter->name; - for (i = 0; i < iter->len; i++, array++) { + for (j = 0; j < iter->len; j++, array++) { PointerRNA child_ptr; - if (RNA_property_collection_lookup_int(ptr, prop, i, &child_ptr)) { - link.index = i; + if (RNA_property_collection_lookup_int(ptr, prop, j, &child_ptr)) { + link.index = j; if ((path = rna_idp_path(&child_ptr, array, needle, &link))) { break; } @@ -5459,7 +5459,6 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop, in { int type = RNA_property_type(prop); int len = RNA_property_array_length(ptr, prop); - int i; DynStr *dynstr = BLI_dynstr_new(); char *cstring; @@ -5481,7 +5480,7 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop, in RNA_property_boolean_get_array(ptr, prop, buf); BLI_dynstr_append(dynstr, "("); - for (i = 0; i < len; i++) { + for (int i = 0; i < len; i++) { BLI_dynstr_appendf(dynstr, i ? ", %s" : "%s", bool_as_py_string(buf[i])); } if (len == 1) @@ -5507,7 +5506,7 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop, in RNA_property_int_get_array(ptr, prop, buf); BLI_dynstr_append(dynstr, "("); - for (i = 0; i < len; i++) { + for (int i = 0; i < len; i++) { BLI_dynstr_appendf(dynstr, i ? ", %d" : "%d", buf[i]); } if (len == 1) @@ -5533,7 +5532,7 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop, in RNA_property_float_get_array(ptr, prop, buf); BLI_dynstr_append(dynstr, "("); - for (i = 0; i < len; i++) { + for (int i = 0; i < len; i++) { BLI_dynstr_appendf(dynstr, i ? ", %g" : "%g", buf[i]); } if (len == 1) diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index bb18871afcd..c418ef3ceb6 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -195,9 +195,8 @@ static char *rna_ColorRamp_path(PointerRNA *ptr) case ID_LS: { - char *path = BKE_linestyle_path_to_color_ramp((FreestyleLineStyle *)id, (ColorBand *)ptr->data); - if (path) - return path; + /* may be NULL */ + path = BKE_linestyle_path_to_color_ramp((FreestyleLineStyle *)id, (ColorBand *)ptr->data); break; } diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 6ace0966b36..76785e1a852 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -164,7 +164,7 @@ static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), P PointCache *cache = (PointCache *)ptr->data; PTCacheID *pid = NULL, *pid2 = NULL; ListBase pidlist; - int new_name = 1; + bool use_new_name = true; if (!ob) return; @@ -194,11 +194,11 @@ static void rna_Cache_idname_change(Main *UNUSED(bmain), Scene *UNUSED(scene), P else if (cache->name[0] != '\0' && STREQ(cache->name, pid->cache->name)) { /*TODO: report "name exists" to user */ BLI_strncpy(cache->name, cache->prev_name, sizeof(cache->name)); - new_name = 0; + use_new_name = false; } } - if (new_name) { + if (use_new_name) { if (pid2 && cache->flag & PTCACHE_DISK_CACHE) { char old_name[80]; char new_name[80]; |