From 251facffa4009af1aed8a5575187c9ed1496d0c8 Mon Sep 17 00:00:00 2001 From: gregorypierce Date: Sat, 9 Aug 2003 18:17:38 +0000 Subject: Couple of bug fixes git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@43 e343933a-64c8-49c5-92b1-88f2ce3e89e8 --- plugins/OSX/src/native/jinputjnilib.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'plugins') diff --git a/plugins/OSX/src/native/jinputjnilib.c b/plugins/OSX/src/native/jinputjnilib.c index 7aa2ceb..26fd940 100644 --- a/plugins/OSX/src/native/jinputjnilib.c +++ b/plugins/OSX/src/native/jinputjnilib.c @@ -740,11 +740,12 @@ JNIEXPORT jint JNICALL Java_net_java_games_input_OSXEnvironmentPlugin_pollDevice queue = (IOHIDQueueInterface **)(long)lpQueue; AbsoluteTime zeroTime = {0,0}; + IOReturn ioReturnValue = kIOReturnSuccess; - HRESULT result = (*queue)->getNextEvent(queue, &event, zeroTime, 0); - if ( result ) + ioReturnValue = (*queue)->getNextEvent(queue, &event, zeroTime, 0); + if ( ioReturnValue == kIOReturnSuccess ) { - printf("Queue getNextEvent result: %lx\n", result ); + printf("Queue getNextEvent return value: %ld\n", (long)ioReturnValue ); } else { @@ -769,10 +770,12 @@ JNIEXPORT jint JNICALL Java_net_java_games_input_OSXEnvironmentPlugin_pollElemen IOHIDEventStruct event; - HRESULT result = (*hidDeviceInterface)->getElementValue(hidDeviceInterface, cookie, &event); - if ( result ) + IOReturn ioReturnValue = kIOReturnSuccess; + + ioReturnValue = (*hidDeviceInterface)->getElementValue(hidDeviceInterface, cookie, &event); + if ( ioReturnValue == kIOReturnSuccess ) { - printf("Queue getNextEvent result: %lx\n", result ); + printf("Queue getNextEvent return value: %ld\n", (long)ioReturnValue ); } else { @@ -795,11 +798,12 @@ JNIEXPORT void JNICALL Java_net_java_games_input_OSXEnvironmentPlugin_registerDe queue = (IOHIDQueueInterface **)(long)lpQueue; IOHIDElementCookie cookie = (IOHIDElementCookie)(long)hidCookie; + IOReturn ioReturnValue = kIOReturnSuccess; - HRESULT result = (*queue)->addElement(queue, cookie, 0); - if ( result ) + ioReturnValue = (*queue)->addElement(queue, cookie, 0); + if ( ioReturnValue == kIOReturnSuccess ) { - printf("Added pollElement: %ld\n", (long)cookie ); + printf("Registered pollElement: %ld\n", (long)cookie ); } else { @@ -820,8 +824,10 @@ JNIEXPORT void JNICALL Java_net_java_games_input_OSXEnvironmentPlugin_deregister IOHIDElementCookie cookie = (IOHIDElementCookie)(long)hidCookie; - HRESULT result = (*queue)->removeElement(queue, cookie ); - if ( result ) + IOReturn ioReturnValue = kIOReturnSuccess; + + ioReturnValue = (*queue)->removeElement(queue, cookie ); + if ( ioReturnValue == kIOReturnSuccess ) { printf("Removed pollElement: %ld\n", (long)cookie ); } -- cgit v1.2.3