[PATCH 1/9] render: warning fixes

Adam Jackson ajax at redhat.com
Tue Oct 19 08:59:16 PDT 2010


render.c: In function ‘ProcRenderAddGlyphs’:
render.c:1082: warning: comparison of distinct pointer types lacks a cast
render.c:1082: warning: comparison of distinct pointer types lacks a cast
render.c:1083: warning: comparison of distinct pointer types lacks a cast
render.c:1083: warning: comparison of distinct pointer types lacks a cast

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 render/render.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/render/render.c b/render/render.c
index 00241f9..e00ee7c 100644
--- a/render/render.c
+++ b/render/render.c
@@ -1079,8 +1079,10 @@ ProcRenderAddGlyphs (ClientPtr client)
     remain -= (sizeof (CARD32) + sizeof (xGlyphInfo)) * nglyphs;
 
     /* protect against bad nglyphs */
-    if (gi < stuff || gi > ((CARD32 *)stuff + client->req_len) ||
-        bits < stuff || bits > ((CARD32 *)stuff + client->req_len)) {
+    if ((void *)gi < (void *)stuff ||
+	(void *)gi > (void *)((CARD32 *)stuff + client->req_len) ||
+        (void *)bits < (void *)stuff ||
+	(void *)bits > (void *)((CARD32 *)stuff + client->req_len)) {
         err = BadLength;
         goto bail;
     }
-- 
1.7.2.3



More information about the xorg-devel mailing list