diff --git a/example/example.c b/example/example.c index 1db8bc5..f35f907 100644 --- a/example/example.c +++ b/example/example.c @@ -295,9 +295,10 @@ void test(struct wiimote_t* wm, byte* data, unsigned short len) { } short any_wiimote_connected(wiimote** wm, int wiimotes) { + int i; if(!wm) return 0; - for(int i = 0; i < wiimotes; i++) { + for(i = 0; i < wiimotes; i++) { if(wm[i] && WIIMOTE_IS_CONNECTED(wm[i])) return 1; } diff --git a/src/os_mac/os_mac_find.m b/src/os_mac/os_mac_find.m index 0c686c3..715569d 100644 --- a/src/os_mac/os_mac_find.m +++ b/src/os_mac/os_mac_find.m @@ -126,7 +126,8 @@ // read found device information NSArray* devices = [inquiry foundDevices]; - for(NSUInteger i = 0; i < [devices count]; i++) { + NSUInteger i; + for(i = 0; i < [devices count]; i++) { IOBluetoothDevice* device = [devices objectAtIndex:i]; // save the device in the wiimote structure