Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <mail@jlucke.com>2019-08-23 10:52:12 +0300
committerJacques Lucke <mail@jlucke.com>2019-08-23 10:52:12 +0300
commita1aa4a259713f26c32a5fac4adbe0751e0479f5b (patch)
tree0737940d32513ad8e2458760c81ad7c1c61e1ce6 /source/blender/makesrna/intern/rna_gpencil_modifier.c
parent232049dd9408e15d2082181e60ddd775b375ff19 (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_gpencil_modifier.c')
-rw-r--r--source/blender/makesrna/intern/rna_gpencil_modifier.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c
index 21eaaf9dd50..0b40cc9f7f9 100644
--- a/source/blender/makesrna/intern/rna_gpencil_modifier.c
+++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c
@@ -228,8 +228,8 @@ static void rna_GpencilModifier_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_gpencil_modifier_unique_name(&ob->greasepencil_modifiers, gmd);
}
@@ -248,8 +248,8 @@ static char *rna_GpencilModifier_path(PointerRNA *ptr)
static void rna_GpencilModifier_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_GpencilModifier_dependency_update(Main *bmain, Scene *scene, PointerRNA *ptr)
@@ -300,7 +300,7 @@ static void greasepencil_modifier_object_set(Object *self,
PointerRNA *ptr, PointerRNA value, struct ReportList *UNUSED(reports)) \
{ \
_type##GpencilModifierData *tmd = (_type##GpencilModifierData *)ptr->data; \
- greasepencil_modifier_object_set(ptr->id.data, &tmd->_prop, _obtype, value); \
+ greasepencil_modifier_object_set((Object *)ptr->owner_id, &tmd->_prop, _obtype, value); \
}
RNA_GP_MOD_OBJECT_SET(Armature, object, OB_ARMATURE);