Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_access.c
| Show First 20 Lines • Show All 4,074 Lines • ▼ Show 20 Lines | int RNA_property_collection_lookup_index(PointerRNA *ptr, | ||||
| /* did we find it? */ | /* did we find it? */ | ||||
| if (iter.valid) { | if (iter.valid) { | ||||
| return index; | return index; | ||||
| } | } | ||||
| return -1; | return -1; | ||||
| } | } | ||||
| bool RNA_property_collection_lookup_int_has_fn(PropertyRNA *prop) | |||||
| { | |||||
| CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)rna_ensure_property(prop); | |||||
sergey: How about adding an `BLI_assert(RNA_property_type(prop) == PROP_COLLECTION);` which is seen in… | |||||
| return cprop->lookupint != NULL; | |||||
| } | |||||
| bool RNA_property_collection_lookup_string_has_fn(PropertyRNA *prop) | |||||
| { | |||||
| CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)rna_ensure_property(prop); | |||||
| return cprop->lookupstring != NULL; | |||||
| } | |||||
| int RNA_property_collection_lookup_int(PointerRNA *ptr, | int RNA_property_collection_lookup_int(PointerRNA *ptr, | ||||
| PropertyRNA *prop, | PropertyRNA *prop, | ||||
| int key, | int key, | ||||
| PointerRNA *r_ptr) | PointerRNA *r_ptr) | ||||
| { | { | ||||
| CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)rna_ensure_property(prop); | CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)rna_ensure_property(prop); | ||||
| BLI_assert(RNA_property_type(prop) == PROP_COLLECTION); | BLI_assert(RNA_property_type(prop) == PROP_COLLECTION); | ||||
| ▲ Show 20 Lines • Show All 2,696 Lines • Show Last 20 Lines | |||||
How about adding an BLI_assert(RNA_property_type(prop) == PROP_COLLECTION); which is seen in some other functions around?
Same applies to the RNA_property_collection_lookup_string_has_fn.