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_linestyle.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_linestyle.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_linestyle.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_linestyle.c b/source/blender/makesrna/intern/rna_linestyle.c index 936a5e6a53d..f6cfc33c82e 100644 --- a/source/blender/makesrna/intern/rna_linestyle.c +++ b/source/blender/makesrna/intern/rna_linestyle.c @@ -287,7 +287,7 @@ static char *rna_LineStyle_geometry_modifier_path(PointerRNA *ptr) static void rna_LineStyleColorModifier_name_set(PointerRNA *ptr, const char *value) { - FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->id.data; + FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id; LineStyleModifier *m = (LineStyleModifier *)ptr->data; BLI_strncpy_utf8(m->name, value, sizeof(m->name)); @@ -301,7 +301,7 @@ static void rna_LineStyleColorModifier_name_set(PointerRNA *ptr, const char *val static void rna_LineStyleAlphaModifier_name_set(PointerRNA *ptr, const char *value) { - FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->id.data; + FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id; LineStyleModifier *m = (LineStyleModifier *)ptr->data; BLI_strncpy_utf8(m->name, value, sizeof(m->name)); @@ -315,7 +315,7 @@ static void rna_LineStyleAlphaModifier_name_set(PointerRNA *ptr, const char *val static void rna_LineStyleThicknessModifier_name_set(PointerRNA *ptr, const char *value) { - FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->id.data; + FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id; LineStyleModifier *m = (LineStyleModifier *)ptr->data; BLI_strncpy_utf8(m->name, value, sizeof(m->name)); @@ -329,7 +329,7 @@ static void rna_LineStyleThicknessModifier_name_set(PointerRNA *ptr, const char static void rna_LineStyleGeometryModifier_name_set(PointerRNA *ptr, const char *value) { - FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->id.data; + FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id; LineStyleModifier *m = (LineStyleModifier *)ptr->data; BLI_strncpy_utf8(m->name, value, sizeof(m->name)); @@ -343,13 +343,13 @@ static void rna_LineStyleGeometryModifier_name_set(PointerRNA *ptr, const char * static void rna_LineStyle_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->id.data; + FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id; rna_iterator_array_begin(iter, (void *)linestyle->mtex, sizeof(MTex *), MAX_MTEX, 0, NULL); } static PointerRNA rna_LineStyle_active_texture_get(PointerRNA *ptr) { - FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->id.data; + FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id; Tex *tex; tex = give_current_linestyle_texture(linestyle); @@ -360,14 +360,14 @@ static void rna_LineStyle_active_texture_set(PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) { - FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->id.data; + FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id; set_current_linestyle_texture(linestyle, value.data); } static void rna_LineStyle_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - FreestyleLineStyle *linestyle = ptr->id.data; + FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id; DEG_id_tag_update(&linestyle->id, 0); WM_main_add_notifier(NC_LINESTYLE, linestyle); |