projects
/
enjoyable.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9a9baa7
)
Fix warning from unknown type by using a fast enumeration. Also, it's faster.
author
Joe Wreschnig
<joe.wreschnig@gmail.com>
Tue, 26 Feb 2013 16:41:44 +0000
(17:41 +0100)
committer
Joe Wreschnig
<joe.wreschnig@gmail.com>
Tue, 26 Feb 2013 16:41:44 +0000
(17:41 +0100)
JoystickController.m
patch
|
blob
|
history
diff --git
a/JoystickController.m
b/JoystickController.m
index 976b531a01c89c61081fa84b2e97b4c6d94a8de3..15512956eb64ef04eeeb26eba2ce878be1a95e29 100644
(file)
--- a/
JoystickController.m
+++ b/
JoystickController.m
@@
-148,10
+148,10
@@
void add_callback(void* inContext, IOReturn inResult, void* inSender, IOHIDDevic
}
-(Joystick*) findJoystickByRef: (IOHIDDeviceRef) device {
-
for(int i=0; i<[joysticks count]; i++
)
-
if([[joysticks objectAtIndex:i] device]
== device)
-
return [joysticks objectAtIndex:i]
;
- return
NULL
;
+
for (Joystick *js in joysticks
)
+
if (js.device
== device)
+
return js
;
+ return
nil
;
}
void remove_callback(void* inContext, IOReturn inResult, void* inSender, IOHIDDeviceRef device) {