[PATCH 4/5] dmx: warning fixes

Adam Jackson ajax at redhat.com
Thu Jan 20 16:08:46 PST 2011


dmxinputinit.c: In function ‘dmxBlockHandler’:
dmxinputinit.c:610:44: warning: cast from pointer to integer of different size
dmxinputinit.c: In function ‘dmxWakeupHandler’:
dmxinputinit.c:637:41: warning: cast from pointer to integer of different size
dmxinputinit.c: In function ‘dmxInputInit’:
dmxinputinit.c:1041:36: warning: cast to pointer from integer of different size

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 hw/dmx/input/dmxinputinit.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c
index 6fc11cd..5cbd620 100644
--- a/hw/dmx/input/dmxinputinit.c
+++ b/hw/dmx/input/dmxinputinit.c
@@ -607,7 +607,7 @@ static void dmxCollectAll(DMXInputInfo *dmxInput)
 static void dmxBlockHandler(pointer blockData, OSTimePtr pTimeout,
                             pointer pReadMask)
 {
-    DMXInputInfo    *dmxInput = &dmxInputs[(int)blockData];
+    DMXInputInfo    *dmxInput = &dmxInputs[(uintptr_t)blockData];
     static unsigned long generation = 0;
     
     if (generation != serverGeneration) {
@@ -634,7 +634,7 @@ static void dmxSwitchReturn(pointer p)
 
 static void dmxWakeupHandler(pointer blockData, int result, pointer pReadMask)
 {
-    DMXInputInfo *dmxInput = &dmxInputs[(int)blockData];
+    DMXInputInfo *dmxInput = &dmxInputs[(uintptr_t)blockData];
     int          i;
 
     if (dmxInput->vt_switch_pending) {
@@ -1036,9 +1036,8 @@ void dmxInputInit(DMXInputInfo *dmxInput)
     dmxInput->processInputEvents    = dmxProcessInputEvents;
     dmxInput->detached              = False;
     
-    RegisterBlockAndWakeupHandlers(dmxBlockHandler,
-                                   dmxWakeupHandler,
-                                   (void *)dmxInput->inputIdx);
+    RegisterBlockAndWakeupHandlers(dmxBlockHandler, dmxWakeupHandler,
+                                   (void *)(uintptr_t)dmxInput->inputIdx);
 }
 
 static void dmxInputFreeLocal(DMXLocalInputInfoRec *local)
-- 
1.7.3.4



More information about the xorg-devel mailing list