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_animation.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_animation.c')
-rw-r--r--source/blender/makesrna/intern/rna_animation.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c
index 3d14616bcc9..6157ec41f19 100644
--- a/source/blender/makesrna/intern/rna_animation.c
+++ b/source/blender/makesrna/intern/rna_animation.c
@@ -128,7 +128,7 @@ const EnumPropertyItem rna_enum_keying_flag_items_api[] = {
static void rna_AnimData_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
- ID *id = ptr->id.data;
+ ID *id = ptr->owner_id;
ANIM_id_update(bmain, id);
}
@@ -157,7 +157,7 @@ static void rna_AnimData_action_set(PointerRNA *ptr,
PointerRNA value,
struct ReportList *UNUSED(reports))
{
- ID *ownerId = (ID *)ptr->id.data;
+ ID *ownerId = ptr->owner_id;
/* set action */
BKE_animdata_set_action(NULL, ownerId, value.data);
@@ -303,7 +303,7 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain,
{
KeyingSetInfo dummyksi = {NULL};
KeyingSetInfo *ksi;
- PointerRNA dummyptr = {{NULL}};
+ PointerRNA dummyptr = {NULL};
int have_function[3];
/* setup dummy type info to store static properties in */
@@ -727,12 +727,12 @@ bool rna_AnimaData_override_apply(Main *UNUSED(bmain),
if (adt_dst == NULL && adt_src != NULL) {
/* Copy anim data from reference into final local ID. */
- BKE_animdata_copy_id(NULL, ptr_dst->id.data, ptr_src->id.data, 0);
+ BKE_animdata_copy_id(NULL, ptr_dst->owner_id, ptr_src->owner_id, 0);
return true;
}
else if (adt_dst != NULL && adt_src == NULL) {
/* Override has cleared/removed anim data from its reference. */
- BKE_animdata_free(ptr_dst->id.data, true);
+ BKE_animdata_free(ptr_dst->owner_id, true);
return true;
}