From 17853bced259fb720d738f59efc0af4ee5578a26 Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Fri, 15 Mar 2019 05:10:56 +0100 Subject: eggsmclient-xsmp: Fix cast from non-struct type to struct type Fixes Clang static analyzer warning: eggsmclient-xsmp.c:1156:18: warning: Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption prop->vals = (SmPropValue *)vals->data; ^~~~~~~~~~~~~~~~~~~~~~~~~ eggsmclient-xsmp.c:1189:18: warning: Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption prop->vals = (SmPropValue *)vals->data; ^~~~~~~~~~~~~~~~~~~~~~~~~ --- libegg/eggsmclient-xsmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libegg') diff --git a/libegg/eggsmclient-xsmp.c b/libegg/eggsmclient-xsmp.c index 808fffc0..d93dcd1a 100644 --- a/libegg/eggsmclient-xsmp.c +++ b/libegg/eggsmclient-xsmp.c @@ -1153,7 +1153,7 @@ array_prop (const char *name, ...) va_end (ap); prop->num_vals = vals->len; - prop->vals = (SmPropValue *)vals->data; + prop->vals = (SmPropValue *) (gpointer) vals->data; g_array_free (vals, FALSE); @@ -1186,7 +1186,7 @@ ptrarray_prop (const char *name, GPtrArray *values) } prop->num_vals = vals->len; - prop->vals = (SmPropValue *)vals->data; + prop->vals = (SmPropValue *) (gpointer) vals->data; g_array_free (vals, FALSE); -- cgit v1.2.1