diff options
author | Jacques Lucke <mail@jlucke.com> | 2019-08-23 10:52:12 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-08-23 10:52:12 +0300 |
commit | a1aa4a259713f26c32a5fac4adbe0751e0479f5b (patch) | |
tree | 0737940d32513ad8e2458760c81ad7c1c61e1ce6 /source/blender/makesrna/intern/rna_lattice.c | |
parent | 232049dd9408e15d2082181e60ddd775b375ff19 (diff) |
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
Diffstat (limited to 'source/blender/makesrna/intern/rna_lattice.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_lattice.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index 5a8223af28a..34f5b6caee1 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -49,7 +49,7 @@ static void rna_LatticePoint_co_get(PointerRNA *ptr, float *values) { - Lattice *lt = (Lattice *)ptr->id.data; + Lattice *lt = (Lattice *)ptr->owner_id; BPoint *bp = (BPoint *)ptr->data; int index = bp - lt->def; int u, v, w; @@ -63,7 +63,7 @@ static void rna_LatticePoint_co_get(PointerRNA *ptr, float *values) static void rna_LatticePoint_groups_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Lattice *lt = (Lattice *)ptr->id.data; + Lattice *lt = (Lattice *)ptr->owner_id; if (lt->dvert) { BPoint *bp = (BPoint *)ptr->data; @@ -95,7 +95,7 @@ static void rna_Lattice_points_begin(CollectionPropertyIterator *iter, PointerRN static void rna_Lattice_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; + ID *id = ptr->owner_id; DEG_id_tag_update(id, 0); WM_main_add_notifier(NC_GEOM | ND_DATA, id); @@ -109,8 +109,8 @@ static void rna_Lattice_update_data_editlatt(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - ID *id = ptr->id.data; - Lattice *lt = (Lattice *)ptr->id.data; + ID *id = ptr->owner_id; + Lattice *lt = (Lattice *)ptr->owner_id; if (lt->editlatt) { Lattice *lt_em = lt->editlatt->latt; @@ -127,7 +127,7 @@ static void rna_Lattice_update_data_editlatt(Main *UNUSED(bmain), static void rna_Lattice_update_size(Main *bmain, Scene *scene, PointerRNA *ptr) { - Lattice *lt = ptr->id.data; + Lattice *lt = (Lattice *)ptr->owner_id; Object *ob; int newu, newv, neww; @@ -224,7 +224,7 @@ static void rna_Lattice_vg_name_set(PointerRNA *ptr, const char *value) /* annoying, but is a consequence of RNA structures... */ static char *rna_LatticePoint_path(PointerRNA *ptr) { - Lattice *lt = (Lattice *)ptr->id.data; + Lattice *lt = (Lattice *)ptr->owner_id; void *point = ptr->data; BPoint *points = NULL; @@ -251,7 +251,7 @@ static char *rna_LatticePoint_path(PointerRNA *ptr) static bool rna_Lattice_is_editmode_get(PointerRNA *ptr) { - Lattice *lt = (Lattice *)ptr->id.data; + Lattice *lt = (Lattice *)ptr->owner_id; return (lt->editlatt != NULL); } |