some whitespace cleanup
[freeglut] / src / fg_joystick.c
index ab6f401..2f4f6ed 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * freeglut_joystick.c
+ * fg_joystick.c
  *
  * Joystick handling code
  *
 
 #    ifdef HAVE_USB_JS
 #        if defined(__NetBSD__)
-/* XXX The below hack is done until freeglut's autoconf is updated. */
-#            define HAVE_USBHID_H 1
 #            ifdef HAVE_USBHID_H
 #                include <usbhid.h>
 #            else
 #                include <usb.h>
 #            endif
+#            include <dev/usb/usb.h>
 #        elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #            ifdef HAVE_USBHID_H
 #                include <usbhid.h>
 #            else
 #                include <libusbhid.h>
 #            endif
+#            include <legacy/dev/usb/usb.h>
 #        endif
-#        include <legacy/dev/usb/usb.h>
 #        include <dev/usb/usbhid.h>
 
 /* Compatibility with older usb.h revisions */
@@ -147,14 +146,12 @@ static int fghJoystickFindUSBdev(char *name, char *out, int outlen)
       if (cp)
         return 1;
     }
-#ifdef HAVE_ERRNO_H
     else if (errno == EACCES) {
       if (!protection_warned) {
         fgWarning ( "Can't open %s for read!", buf );
         protection_warned = 1;
       }
     }
-#endif
   }
   return 0;
 }
@@ -172,11 +169,7 @@ static int fghJoystickInitializeHID(struct os_specific_s *os,
 
     if ( ( rd = hid_get_report_desc( os->fd ) ) == 0 )
     {
-#ifdef HAVE_ERRNO_H
         fgWarning ( "error: %s: %s", os->fname, strerror( errno ) );
-#else
-        fgWarning ( "error: %s", os->fname );
-#endif
         return FALSE;
     }
 
@@ -186,11 +179,7 @@ static int fghJoystickInitializeHID(struct os_specific_s *os,
         if( ioctl( os->fd, USB_GET_REPORT_ID, &report_id ) < 0)
         {
             /*** XXX {report_id} may not be the right variable? ***/
-#ifdef HAVE_ERRNO_H
             fgWarning ( "error: %s%d: %s", UHIDDEV, report_id, strerror( errno ) );
-#else
-            fgWarning ( "error: %s%d", UHIDDEV, report_id );
-#endif
             return FALSE;
         }
 
@@ -334,7 +323,7 @@ static void fghJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes )
     if( joy->error )
         return;
 
-       fgPlatformJoystickRawRead ( joy, buttons, axes );
+    fgPlatformJoystickRawRead ( joy, buttons, axes );
 }
 
 /*
@@ -592,7 +581,7 @@ void fgPlatformJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes )
 
 void fgPlatformJoystickOpen( SFG_Joystick* joy )
 {
-       int i = 0;
+    int i = 0;
     OSStatus err;
 
     /* XXX FIXME: get joystick name in Mac */
@@ -867,7 +856,7 @@ static void fghJoystickOpen( SFG_Joystick* joy )
     joy->num_axes = joy->num_buttons = 0;
     joy->name[ 0 ] = '\0';
 
-       fgPlatformJoystickOpen ( joy );
+    fgPlatformJoystickOpen ( joy );
 
 }
 
@@ -889,7 +878,7 @@ static void fghJoystickInit( int ident )
     fgJoystick[ ident ]->num_axes = fgJoystick[ ident ]->num_buttons = 0;
     fgJoystick[ ident ]->error = GL_TRUE;
 
-       fgPlatformJoystickInit( fgJoystick, ident );
+    fgPlatformJoystickInit( fgJoystick, ident );
 
     fghJoystickOpen( fgJoystick[ ident  ] );
 }
@@ -917,7 +906,7 @@ void fgJoystickClose( void )
     {
         if( fgJoystick[ ident ] )
         {
-                       fgPlatformJoystickClose ( ident );
+            fgPlatformJoystickClose ( ident );
 
             free( fgJoystick[ ident ] );
             fgJoystick[ ident ] = NULL;