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/editors/animation/keyingsets.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/editors/animation/keyingsets.c')
-rw-r--r--source/blender/editors/animation/keyingsets.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c
index 7d31c6d3e3a..258c0e4f1f6 100644
--- a/source/blender/editors/animation/keyingsets.c
+++ b/source/blender/editors/animation/keyingsets.c
@@ -287,7 +287,7 @@ static int add_keyingset_button_exec(bContext *C, wmOperator *op)
Scene *scene = CTX_data_scene(C);
KeyingSet *ks = NULL;
PropertyRNA *prop = NULL;
- PointerRNA ptr = {{NULL}};
+ PointerRNA ptr = {NULL};
char *path = NULL;
short success = 0;
int index = 0, pflag = 0;
@@ -332,7 +332,7 @@ static int add_keyingset_button_exec(bContext *C, wmOperator *op)
}
/* check if property is able to be added */
- if (ptr.id.data && ptr.data && prop && RNA_property_animateable(&ptr, prop)) {
+ if (ptr.owner_id && ptr.data && prop && RNA_property_animateable(&ptr, prop)) {
path = RNA_path_from_ID_to_property(&ptr, prop);
if (path) {
@@ -348,7 +348,7 @@ static int add_keyingset_button_exec(bContext *C, wmOperator *op)
}
/* add path to this setting */
- BKE_keyingset_add_path(ks, ptr.id.data, NULL, path, index, pflag, KSP_GROUP_KSNAME);
+ BKE_keyingset_add_path(ks, ptr.owner_id, NULL, path, index, pflag, KSP_GROUP_KSNAME);
ks->active_path = BLI_listbase_count(&ks->paths);
success = 1;
@@ -393,7 +393,7 @@ static int remove_keyingset_button_exec(bContext *C, wmOperator *op)
Scene *scene = CTX_data_scene(C);
KeyingSet *ks = NULL;
PropertyRNA *prop = NULL;
- PointerRNA ptr = {{NULL}};
+ PointerRNA ptr = {NULL};
char *path = NULL;
short success = 0;
int index = 0;
@@ -420,14 +420,14 @@ static int remove_keyingset_button_exec(bContext *C, wmOperator *op)
ks = BLI_findlink(&scene->keyingsets, scene->active_keyingset - 1);
}
- if (ptr.id.data && ptr.data && prop) {
+ if (ptr.owner_id && ptr.data && prop) {
path = RNA_path_from_ID_to_property(&ptr, prop);
if (path) {
KS_Path *ksp;
/* try to find a path matching this description */
- ksp = BKE_keyingset_find_path(ks, ptr.id.data, ks->name, path, index, KSP_GROUP_KSNAME);
+ ksp = BKE_keyingset_find_path(ks, ptr.owner_id, ks->name, path, index, KSP_GROUP_KSNAME);
if (ksp) {
BKE_keyingset_free_path(ks, ksp);