[PATCH:libXt 5/6] Silence compiler clang warnings.

Thomas Klausner wiz at NetBSD.org
Tue Jun 25 14:02:49 PDT 2013


Fixes:
warning: cast from function call of type 'char *' to non-matching
type 'XtArgVal' (aka 'long') [-Wbad-function-cast]
---
 src/Resources.c | 2 +-
 src/Varargs.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/Resources.c b/src/Resources.c
index 1d2871c..657c55d 100644
--- a/src/Resources.c
+++ b/src/Resources.c
@@ -738,7 +738,7 @@ static XtCacheRef *GetResources(
 		     */
 
 		    if(rx->xrm_size > sizeof(XtArgVal)) {
-			arg->value = (XtArgVal) __XtMalloc(rx->xrm_size);
+			arg->value = (XtArgVal)(void *) __XtMalloc(rx->xrm_size);
 			arg->size = -(arg->size);
 		    } else { /* will fit - copy directly into value field */
 			arg->value = (XtArgVal) NULL;
diff --git a/src/Varargs.c b/src/Varargs.c
index b33e287..fd81bd0 100644
--- a/src/Varargs.c
+++ b/src/Varargs.c
@@ -243,8 +243,8 @@ TypedArgToArg(
 	else if (to_val.size == sizeof(XtArgVal))
 	    arg_return->value = *(XtArgVal *)to_val.addr;
 	else if (to_val.size > sizeof(XtArgVal)) {
-	    arg_return->value = (XtArgVal) __XtMalloc(to_val.size);
-	    memory_return->value = (XtArgVal)
+	    arg_return->value = (XtArgVal)(void *) __XtMalloc(to_val.size);
+	    memory_return->value = (XtArgVal)(void *)
 		memcpy((void *)arg_return->value, to_val.addr, to_val.size);
 	}
     }
-- 
1.8.3.1



More information about the xorg-devel mailing list