diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-07 04:07:44 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-07 04:07:44 +0300 |
commit | b8d986451805f324b0ba98f4b57b4cf89cee04ed (patch) | |
tree | 9c06546d6b75ab2ed36cf567ce343dfa56e1854c /source/blender/makesrna/intern | |
parent | 9c4c9a889de6d25147efac33b9de8086f9c56951 (diff) |
Cleanup: remove unused Main argument to RNA_path functions
Note that lib_override functions have kept the unused argument,
but this may be removed too. It impacts many lib_override functions
so this can be handled separately.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_access_compare_override.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_path.cc | 26 |
3 files changed, 20 insertions, 18 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index c0104b1472c..835265b1986 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -5346,15 +5346,15 @@ char *RNA_pointer_as_string_id(bContext *C, PointerRNA *ptr) return cstring; } -static char *rna_pointer_as_string__bldata(Main *bmain, PointerRNA *ptr) +static char *rna_pointer_as_string__bldata(PointerRNA *ptr) { if (ptr->type == NULL || ptr->owner_id == NULL) { return BLI_strdup("None"); } if (RNA_struct_is_ID(ptr->type)) { - return RNA_path_full_ID_py(bmain, ptr->owner_id); + return RNA_path_full_ID_py(ptr->owner_id); } - return RNA_path_full_struct_py(bmain, ptr); + return RNA_path_full_struct_py(ptr); } char *RNA_pointer_as_string(bContext *C, @@ -5369,7 +5369,7 @@ char *RNA_pointer_as_string(bContext *C, if ((prop = rna_idproperty_check(&prop_ptr, ptr)) && prop->type != IDP_ID) { return RNA_pointer_as_string_id(C, ptr_prop); } - return rna_pointer_as_string__bldata(CTX_data_main(C), ptr_prop); + return rna_pointer_as_string__bldata(ptr_prop); } char *RNA_pointer_as_string_keywords_ex(bContext *C, diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c b/source/blender/makesrna/intern/rna_access_compare_override.c index d1df54df3cd..69043dbad7b 100644 --- a/source/blender/makesrna/intern/rna_access_compare_override.c +++ b/source/blender/makesrna/intern/rna_access_compare_override.c @@ -54,7 +54,7 @@ static CLG_LogRef LOG = {"rna.access_compare_override"}; * #RNA_find_real_ID_and_path, since in overrides we also consider shape keys as embedded data, not * only root node trees and master collections. */ -static ID *rna_property_override_property_real_id_owner(Main *bmain, +static ID *rna_property_override_property_real_id_owner(Main * /*bmain*/, PointerRNA *ptr, PropertyRNA *prop, char **r_rna_path) @@ -86,7 +86,7 @@ static ID *rna_property_override_property_real_id_owner(Main *bmain, case ID_GR: case ID_NT: /* Master collections, Root node trees. */ - owner_id = RNA_find_real_ID_and_path(bmain, id, &rna_path_prefix); + owner_id = RNA_find_real_ID_and_path(id, &rna_path_prefix); break; default: BLI_assert_unreachable(); diff --git a/source/blender/makesrna/intern/rna_path.cc b/source/blender/makesrna/intern/rna_path.cc index 4f5e852a12c..bc77ca3f7d3 100644 --- a/source/blender/makesrna/intern/rna_path.cc +++ b/source/blender/makesrna/intern/rna_path.cc @@ -916,7 +916,7 @@ static char *rna_path_from_ID_to_idpgroup(const PointerRNA *ptr) return RNA_path_from_struct_to_idproperty(&id_ptr, static_cast<IDProperty *>(ptr->data)); } -ID *RNA_find_real_ID_and_path(Main *bmain, ID *id, const char **r_path) +ID *RNA_find_real_ID_and_path(ID *id, const char **r_path) { if (r_path) { *r_path = ""; @@ -947,14 +947,14 @@ ID *RNA_find_real_ID_and_path(Main *bmain, ID *id, const char **r_path) return id_type->owner_get(id); } -static char *rna_prepend_real_ID_path(Main *bmain, ID *id, char *path, ID **r_real_id) +static char *rna_prepend_real_ID_path(Main * /*bmain*/, ID *id, char *path, ID **r_real_id) { if (r_real_id != nullptr) { *r_real_id = nullptr; } const char *prefix; - ID *real_id = RNA_find_real_ID_and_path(bmain, id, &prefix); + ID *real_id = RNA_find_real_ID_and_path(id, &prefix); if (r_real_id != nullptr) { *r_real_id = real_id; @@ -1180,10 +1180,10 @@ char *RNA_path_resolve_from_type_to_property(const PointerRNA *ptr, return path; } -char *RNA_path_full_ID_py(Main *bmain, ID *id) +char *RNA_path_full_ID_py(ID *id) { const char *path; - ID *id_real = RNA_find_real_ID_and_path(bmain, id, &path); + ID *id_real = RNA_find_real_ID_and_path(id, &path); if (id_real) { id = id_real; @@ -1215,7 +1215,7 @@ char *RNA_path_full_ID_py(Main *bmain, ID *id) path); } -char *RNA_path_full_struct_py(Main *bmain, const PointerRNA *ptr) +char *RNA_path_full_struct_py(const PointerRNA *ptr) { char *id_path; char *data_path; @@ -1227,7 +1227,7 @@ char *RNA_path_full_struct_py(Main *bmain, const PointerRNA *ptr) } /* never fails */ - id_path = RNA_path_full_ID_py(bmain, ptr->owner_id); + id_path = RNA_path_full_ID_py(ptr->owner_id); data_path = RNA_path_from_ID_to_struct(ptr); @@ -1243,8 +1243,10 @@ char *RNA_path_full_struct_py(Main *bmain, const PointerRNA *ptr) return ret; } -char *RNA_path_full_property_py_ex( - Main *bmain, const PointerRNA *ptr, PropertyRNA *prop, int index, bool use_fallback) +char *RNA_path_full_property_py_ex(const PointerRNA *ptr, + PropertyRNA *prop, + int index, + bool use_fallback) { char *id_path; const char *data_delim; @@ -1258,7 +1260,7 @@ char *RNA_path_full_property_py_ex( } /* never fails */ - id_path = RNA_path_full_ID_py(bmain, ptr->owner_id); + id_path = RNA_path_full_ID_py(ptr->owner_id); data_path = RNA_path_from_ID_to_property(ptr, prop); if (data_path) { @@ -1291,9 +1293,9 @@ char *RNA_path_full_property_py_ex( return ret; } -char *RNA_path_full_property_py(Main *bmain, const PointerRNA *ptr, PropertyRNA *prop, int index) +char *RNA_path_full_property_py(const PointerRNA *ptr, PropertyRNA *prop, int index) { - return RNA_path_full_property_py_ex(bmain, ptr, prop, index, false); + return RNA_path_full_property_py_ex(ptr, prop, index, false); } char *RNA_path_struct_property_py(PointerRNA *ptr, PropertyRNA *prop, int index) |