RNA: Cleanup PointerRNA struct
The old layout of `PointerRNA` was confusing for historic reasons:
```
typedef struct PointerRNA {
struct {
void *data;
} id;
struct StructRNA *type;
void *data;
} PointerRNA;
```
This patch updates it to:
```
typedef struct PointerRNA {
struct ID *owner_id;
struct StructRNA *type;
void *data;
} PointerRNA;
```
Throughout the code base `id.data` was replaced with `owner_id`.
Furthermore, many explicit pointer type casts were added which
were implicit before. Some type casts to `ID *` were removed.
Reviewers: brecht, campbellbarton
Differential Revision: https://developer.blender.org/D5558
This commit is contained in:
@@ -405,7 +405,7 @@ void ui_rna_collection_search_cb(const struct bContext *C,
|
||||
RNA_PROP_BEGIN (&data->search_ptr, itemptr, data->search_prop) {
|
||||
|
||||
if (flag & PROP_ID_SELF_CHECK) {
|
||||
if (itemptr.data == data->target_ptr.id.data) {
|
||||
if (itemptr.data == data->target_ptr.owner_id) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -566,7 +566,7 @@ int UI_calc_float_precision(int prec, double value)
|
||||
|
||||
bool UI_but_online_manual_id(const uiBut *but, char *r_str, size_t maxlength)
|
||||
{
|
||||
if (but->rnapoin.id.data && but->rnapoin.data && but->rnaprop) {
|
||||
if (but->rnapoin.owner_id && but->rnapoin.data && but->rnaprop) {
|
||||
BLI_snprintf(r_str,
|
||||
maxlength,
|
||||
"%s.%s",
|
||||
|
||||
Reference in New Issue
Block a user