From d154eaf9027c1fc135ff50c70beed2bc5d7d4a65 Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Mon, 8 Apr 2019 21:26:27 +0200 Subject: xprops: Fix cast from non-struct type to struct type Fixes Clang static analyzer warnings: core/xprops.c:761:9: warning: Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption raw = (xPropWMHints*) results->prop; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ core/xprops.c:883:9: warning: Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption raw = (xPropSizeHints*) results->prop; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- src/core/xprops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/xprops.c b/src/core/xprops.c index 80dd7b59..ea869799 100644 --- a/src/core/xprops.c +++ b/src/core/xprops.c @@ -758,7 +758,7 @@ wm_hints_from_results (GetPropertyResults *results, hints = ag_Xmalloc0 (sizeof (XWMHints)); - raw = (xPropWMHints*) results->prop; + raw = (xPropWMHints*) (gpointer) results->prop; hints->flags = raw->flags; hints->input = (raw->input ? True : False); @@ -880,7 +880,7 @@ size_hints_from_results (GetPropertyResults *results, if (results->n_items < OldNumPropSizeElements) return FALSE; - raw = (xPropSizeHints*) results->prop; + raw = (xPropSizeHints*) (gpointer) results->prop; hints = ag_Xmalloc (sizeof (XSizeHints)); -- cgit v1.2.1