diff options
author | gregorypierce <[email protected]> | 2003-08-09 18:17:38 +0000 |
---|---|---|
committer | gregorypierce <[email protected]> | 2003-08-09 18:17:38 +0000 |
commit | 251facffa4009af1aed8a5575187c9ed1496d0c8 (patch) | |
tree | 87ec86a334dc68f6dd706871e96ba8b5cba9bec2 /plugins | |
parent | b044146181500258082acf0cd70506558816048f (diff) |
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
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/OSX/src/native/jinputjnilib.c | 28 |
1 files changed, 17 insertions, 11 deletions
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 ); } |