@@ -126,14 +126,14 @@ static void joy_hidlib_close_device(joy_hid_device_t *device)
126126 }
127127}
128128
129- static void joy_hidlib_process_element (IOHIDElementRef internal_element ,
129+ static void joy_hidlib_process_element (IOHIDElementRef internal_element ,
130130 joystick_device_t * joydev ,
131131 joy_hid_element_t * * elements_ptr ,
132132 int * element_count ,
133133 int * capacity )
134134{
135135 IOHIDElementType type = IOHIDElementGetType (internal_element );
136-
136+
137137 /* Recursively process collection elements */
138138 if (type == kIOHIDElementTypeCollection ) {
139139 CFArrayRef children = IOHIDElementGetChildren (internal_element );
@@ -146,23 +146,23 @@ static void joy_hidlib_process_element(IOHIDElementRef internal_element,
146146 }
147147 return ;
148148 }
149-
149+
150150 /* Only process input elements */
151- if (type != kIOHIDElementTypeInput_Misc &&
152- type != kIOHIDElementTypeInput_Button &&
151+ if (type != kIOHIDElementTypeInput_Misc &&
152+ type != kIOHIDElementTypeInput_Button &&
153153 type != kIOHIDElementTypeInput_Axis ) {
154154 return ;
155155 }
156-
156+
157157 /* Expand array if needed */
158158 if (* element_count >= * capacity ) {
159159 * capacity *= 2 ;
160160 * elements_ptr = lib_realloc (* elements_ptr , sizeof (joy_hid_element_t ) * (* capacity ));
161161 }
162-
162+
163163 joy_hid_element_t * e = & (* elements_ptr )[* element_count ];
164164 (* element_count )++ ;
165-
165+
166166 uint32_t usage_page = IOHIDElementGetUsagePage (internal_element );
167167 uint32_t usage = IOHIDElementGetUsage (internal_element );
168168 CFIndex pmin = IOHIDElementGetPhysicalMin (internal_element );
@@ -338,7 +338,7 @@ static void macos_joystick_poll(joystick_device_t *joydev)
338338
339339 for (i = 0 ; i < device -> num_elements ; i ++ ) {
340340 joy_hid_element_t e = device -> elements [i ];
341-
341+
342342 if (e .usage_page == kHIDPage_GenericDesktop ) {
343343 switch (e .usage ) {
344344 case kHIDUsage_GD_X :
@@ -407,7 +407,7 @@ static void macos_joystick_poll(joystick_device_t *joydev)
407407 /*
408408 * Until we have a joystick mapping UI we use this to turn all buttons
409409 * into a single button by counting pressed buttons.
410- *
410+ *
411411 * Yes this sucks but for controllers with many buttons this is better
412412 * than picking some arbitrary button and having that be the only one.
413413 */
@@ -573,11 +573,11 @@ void joystick_arch_init(void)
573573 joydev_priv -> internal_device = dev ;
574574
575575 joy_hidlib_enumerate_elements (joydev );
576-
576+
577577 joystick_device_register (joydev );
578578 }
579579 }
580-
580+
581581 lib_free (all_devices );
582582 CFRelease ( device_set );
583583}
0 commit comments