some cleanup, correctness in naming, correctness in type (those ATOM should be BOOL)
authorDiederick Niehorster <dcnieho@gmail.com>
Sun, 12 Oct 2014 09:50:19 +0000 (09:50 +0000)
committerDiederick Niehorster <dcnieho@gmail.com>
Sun, 12 Oct 2014 09:50:19 +0000 (09:50 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1712 7f0cb862-5218-0410-a997-914c9d46530a

src/fg_state.c
src/mswin/fg_gamemode_mswin.c
src/mswin/fg_init_mswin.c
src/mswin/fg_state_mswin.c
src/mswin/fg_window_mswin.c

index bb2e8f7..8f0b3c9 100644 (file)
@@ -110,16 +110,16 @@ void FGAPIENTRY glutSetOption( GLenum eWhat, int value )
       break;
 
     case GLUT_SKIP_STALE_MOTION_EVENTS:
-      fgState.SkipStaleMotion = value;
+      fgState.SkipStaleMotion = !!value;
       break;
 
     case GLUT_GEOMETRY_VISUALIZE_NORMALS:
       if( fgStructure.CurrentWindow != NULL )
-        fgStructure.CurrentWindow->State.VisualizeNormals = value;
+        fgStructure.CurrentWindow->State.VisualizeNormals = !!value;
       break;
 
     case GLUT_STROKE_FONT_DRAW_JOIN_DOTS:
-      fgState.StrokeFontDrawJoinDots = value;
+      fgState.StrokeFontDrawJoinDots = !!value;
       break;
 
     default:
@@ -229,7 +229,6 @@ int FGAPIENTRY glutGet( GLenum eWhat )
         return fgPlatformGlutGet ( eWhat );
         break;
     }
-    return -1;
 }
 
 /*
@@ -289,9 +288,6 @@ int FGAPIENTRY glutDeviceGet( GLenum eWhat )
     default:
                return fgPlatformGlutDeviceGet ( eWhat );
     }
-
-    /* And now -- the failure. */
-    return -1;
 }
 
 /*
index b36767a..48d9c9e 100644 (file)
@@ -31,7 +31,7 @@
 /*
  * Changes to requested devmode, if it doesn't match current mode
  */
-GLboolean fghPlatformChangeDisplayMode(GLboolean haveToTest, DEVMODE *devModeRequested)
+GLboolean fghChangeDisplayMode(GLboolean haveToTest, DEVMODE *devModeRequested)
 {
     GLboolean success = GL_FALSE;
     DEVMODE  devModeCurrent;
@@ -138,7 +138,7 @@ void fgPlatformRememberState( void )
 void fgPlatformRestoreState( void )
 {
     /* Restore the previously remembered desktop display settings */
-    fghPlatformChangeDisplayMode(GL_FALSE,&fgDisplay.pDisplay.DisplayMode);
+    fghChangeDisplayMode(GL_FALSE,&fgDisplay.pDisplay.DisplayMode);
 }
 
 
@@ -176,7 +176,7 @@ GLboolean fgPlatformChangeDisplayMode( GLboolean haveToTest )
         devMode.dmFields |= DM_DISPLAYFREQUENCY;
     }
 
-    return fghPlatformChangeDisplayMode(haveToTest, &devMode);
+    return fghChangeDisplayMode(haveToTest, &devMode);
 }
 
 void fgPlatformEnterGameMode( void ) 
index 9822f8c..c47116d 100644 (file)
@@ -42,7 +42,7 @@ extern void fgPlatformInitSystemTime();
 void fgPlatformInitialize( const char* displayName )
 {
     WNDCLASS wc;
-    ATOM atom;
+    BOOL atom;
 
     /* What we need to do is to initialize the fgDisplay global structure here. */
     fgDisplay.pDisplay.Instance = GetModuleHandle( NULL );
index aada564..7c510c5 100644 (file)
@@ -327,11 +327,9 @@ int fgPlatformGlutDeviceGet ( GLenum eWhat )
 
     default:
         fgWarning( "glutDeviceGet(): missing enum handle %d", eWhat );
+        return -1;
         break;
     }
-
-    /* And now -- the failure. */
-    return -1;
 }
 
 /*
index 42b670d..641ea53 100644 (file)
@@ -233,7 +233,7 @@ static void fghFillPFD( PIXELFORMATDESCRIPTOR *ppfd, HDC hdc, unsigned char laye
   ppfd->cDepthBits = 24;
   ppfd->cStencilBits = 8;
 
-  ppfd->cAuxBuffers = fghNumberOfAuxBuffersRequested();
+  ppfd->cAuxBuffers = (BYTE) fghNumberOfAuxBuffersRequested();
   ppfd->iLayerType = layer_type;
   ppfd->bReserved = 0;
   ppfd->dwLayerMask = 0;
@@ -570,7 +570,7 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title,
     WNDCLASS wc;
     DWORD flags   = 0;
     DWORD exFlags = 0;
-    ATOM atom;
+    BOOL atom;
 
     /* Grab the window class we have registered on glutInit(): */
     atom = GetClassInfo( fgDisplay.pDisplay.Instance, _T("FREEGLUT"), &wc );