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_shader_fx.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_shader_fx.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_shader_fx.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_shader_fx.c b/source/blender/makesrna/intern/rna_shader_fx.c index 98c80efee0f..acf525e1788 100644 --- a/source/blender/makesrna/intern/rna_shader_fx.c +++ b/source/blender/makesrna/intern/rna_shader_fx.c @@ -140,8 +140,8 @@ static void rna_ShaderFx_name_set(PointerRNA *ptr, const char *value) BLI_strncpy_utf8(gmd->name, value, sizeof(gmd->name)); /* make sure the name is truly unique */ - if (ptr->id.data) { - Object *ob = ptr->id.data; + if (ptr->owner_id) { + Object *ob = (Object *)ptr->owner_id; BKE_shaderfx_unique_name(&ob->shader_fx, gmd); } @@ -160,8 +160,8 @@ static char *rna_ShaderFx_path(PointerRNA *ptr) static void rna_ShaderFx_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - DEG_id_tag_update(ptr->id.data, ID_RECALC_GEOMETRY); - WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ptr->id.data); + DEG_id_tag_update(ptr->owner_id, ID_RECALC_GEOMETRY); + WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ptr->owner_id); } static void rna_ShaderFx_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr) @@ -189,7 +189,7 @@ static void shaderfx_object_set(Object *self, Object **ob_p, int type, PointerRN PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) \ { \ _type##ShaderFxData *tmd = (_type##ShaderFxData *)ptr->data; \ - shaderfx_object_set(ptr->id.data, &tmd->_prop, _obtype, value); \ + shaderfx_object_set((Object *)ptr->owner_id, &tmd->_prop, _obtype, value); \ } RNA_FX_OBJECT_SET(Light, object, OB_EMPTY); |