src/joystick/darwin/SDL_sysjoystick.c
changeset 2776 caf3d5b2153f
parent 2735 204be4fc2726
child 2859 99210400e8b9
equal deleted inserted replaced
2775:6d7baec32718 2776:caf3d5b2153f
   329             HIDGetCollectionElements((CFMutableDictionaryRef) refElement,
   329             HIDGetCollectionElements((CFMutableDictionaryRef) refElement,
   330                                      pDevice);
   330                                      pDevice);
   331     }
   331     }
   332 
   332 
   333     if (element && headElement) {       /* add to list */
   333     if (element && headElement) {       /* add to list */
       
   334         recElement *elementPrevious = NULL;
       
   335         recElement *elementCurrent = *headElement;
       
   336         while (elementCurrent && usage >= elementCurrent->usage) {
       
   337             elementPrevious = elementCurrent;
       
   338             elementCurrent = elementCurrent->pNext;
       
   339         }
       
   340         if (elementPrevious) {
       
   341             elementPrevious->pNext = element;
       
   342         } else {
       
   343             *headElement = element;
       
   344         }
       
   345         element->usagePage = usagePage;
       
   346         element->usage = usage;
       
   347         element->pNext = elementCurrent;
       
   348         HIDGetElementInfo(refElement, element);
   334         pDevice->elements++;
   349         pDevice->elements++;
   335         if (NULL == *headElement)
       
   336             *headElement = element;
       
   337         else {
       
   338             recElement *elementPrevious, *elementCurrent;
       
   339             elementCurrent = *headElement;
       
   340             while (elementCurrent) {
       
   341                 elementPrevious = elementCurrent;
       
   342                 elementCurrent = elementPrevious->pNext;
       
   343             }
       
   344             elementPrevious->pNext = element;
       
   345         }
       
   346         element->pNext = NULL;
       
   347         HIDGetElementInfo(refElement, element);
       
   348     }
   350     }
   349 }
   351 }
   350 
   352 
   351 /* collects information from each array member in device element list (each array memeber = element) */
   353 /* collects information from each array member in device element list (each array memeber = element) */
   352 
   354