From a1aa4a259713f26c32a5fac4adbe0751e0479f5b Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Fri, 23 Aug 2019 09:52:12 +0200 Subject: 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 --- source/blender/makesrna/intern/rna_sculpt_paint.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/makesrna/intern/rna_sculpt_paint.c') diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index fab3585797a..2e3f41d656b 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -319,7 +319,7 @@ static char *rna_ParticleEdit_path(PointerRNA *UNUSED(ptr)) static bool rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value) { const Paint *paint = ptr->data; - Brush *brush = value.id.data; + Brush *brush = (Brush *)value.owner_id; const uint tool_offset = paint->runtime.tool_offset; const eObjectMode ob_mode = paint->runtime.ob_mode; UNUSED_VARS_NDEBUG(tool_offset); @@ -350,10 +350,10 @@ static bool paint_contains_brush_slot(const Paint *paint, const PaintToolSlot *t static bool rna_Brush_mode_with_tool_poll(PointerRNA *ptr, PointerRNA value) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; const PaintToolSlot *tslot = ptr->data; ToolSettings *ts = scene->toolsettings; - Brush *brush = value.id.data; + Brush *brush = (Brush *)value.owner_id; int mode = 0; int slot_index = 0; @@ -438,7 +438,7 @@ static char *rna_Sculpt_path(PointerRNA *UNUSED(ptr)) static char *rna_VertexPaint_path(PointerRNA *ptr) { - Scene *scene = (Scene *)ptr->id.data; + Scene *scene = (Scene *)ptr->owner_id; ToolSettings *ts = scene->toolsettings; if (ptr->data == ts->vpaint) { return BLI_strdup("tool_settings.vertex_paint"); -- cgit v1.2.3