summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-04-08 21:26:27 +0200
committerVictor Kareh <[email protected]>2019-08-12 16:23:58 +0300
commitd154eaf9027c1fc135ff50c70beed2bc5d7d4a65 (patch)
treec092df31e932bbd93d0b8a197722bce862fefc93 /src
parent8c352c4fed01b70fe109442cd5cfa7f8b19bcb5b (diff)
downloadmarco-d154eaf9027c1fc135ff50c70beed2bc5d7d4a65.tar.bz2
marco-d154eaf9027c1fc135ff50c70beed2bc5d7d4a65.tar.xz
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; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Diffstat (limited to 'src')
-rw-r--r--src/core/xprops.c4
1 files 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));