Make it compile again with "-Wall -pedantic -Werror", redoing quite a
authorSven Panne <sven.panne@aedion.de>
Mon, 3 Jan 2005 08:44:48 +0000 (08:44 +0000)
committerSven Panne <sven.panne@aedion.de>
Mon, 3 Jan 2005 08:44:48 +0000 (08:44 +0000)
few things I've fixed already a few days ago. Have today's commits
been done by copying instead of merging? :-(

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@544 7f0cb862-5218-0410-a997-914c9d46530a

src/freeglut_cursor.c
src/freeglut_font.c
src/freeglut_init.c
src/freeglut_structure.c

index 2d789bf..d26b581 100644 (file)
@@ -144,7 +144,7 @@ void FGAPIENTRY glutSetCursor( int cursorID )
              * need to pick a color for foreground/background---but what
              * one we pick doesn't matter for GLUT_CURSOR_NONE.
              */
-            static unsigned char no_cursor_bits[ 32 ];
+            static char no_cursor_bits[ 32 ];
             XColor black;
             no_cursor = XCreatePixmapFromBitmapData( fgDisplay.Display,
                                                      fgDisplay.RootWindow,
index 2c6ed5e..8042234 100644 (file)
@@ -156,7 +156,7 @@ void FGAPIENTRY glutBitmapString( void* fontID, const unsigned char *string )
      * A newline will simply translate the next character's insertion
      * point back to the start of the line and down one line.
      */
-    while( c = *string++ )
+    while( ( c = *string++) )
         if( string[c] == '\n' )
         {
             glBitmap ( 0, 0, 0, 0, -x, (float) -font->Height, NULL );
@@ -206,7 +206,7 @@ int FGAPIENTRY glutBitmapLength( void* fontID, const unsigned char* string )
     if ( !string || ! *string )
         return 0;
 
-    while( c = *string++ )
+    while( ( c = *string++) )
     {
         if( c != '\n' )/* Not an EOL, increment length of line */
             this_line_length += *( font->Characters[ c ]);
@@ -281,7 +281,7 @@ void FGAPIENTRY glutStrokeString( void* fontID, const unsigned char *string )
      * A newline will simply translate the next character's insertion
      * point back to the start of the line and down one line.
      */
-    while( c = *string++ )
+    while( ( c = *string++) )
         if( c < font->Quantity )
         {
             if( c == '\n' )
@@ -348,7 +348,7 @@ int FGAPIENTRY glutStrokeLength( void* fontID, const unsigned char* string )
     if ( !string || ! *string )
         return 0;
 
-    while( c = *string++ )
+    while( ( c = *string++) )
         if( c < font->Quantity )
         {
             if( c == '\n' ) /* EOL; reset the length of this line */
index 01f2af2..7688714 100644 (file)
@@ -228,13 +228,13 @@ void fgDeinitialize( void )
 
     fgDestroyStructure( );
 
-    while( timer = fgState.Timers.First )
+    while( ( timer = fgState.Timers.First) )
     {
         fgListRemove( &fgState.Timers, &timer->Node );
         free( timer );
     }
 
-    while( timer = fgState.FreeTimers.First )
+    while( ( timer = fgState.FreeTimers.First) )
     {
         fgListRemove( &fgState.FreeTimers, &timer->Node );
         free( timer );
@@ -620,9 +620,13 @@ void FGAPIENTRY glutInit( int* pargc, char** argv )
 
     if (geometry )
     {
+        unsigned int parsedWidth, parsedHeight;
         int mask = XParseGeometry( geometry,
                                    &fgState.Position.X, &fgState.Position.Y,
-                                   &fgState.Size.X, &fgState.Size.Y );
+                                   &parsedWidth, &parsedHeight );
+        /* TODO: Check for overflow? */
+        fgState.Size.X = parsedWidth;
+        fgState.Size.Y = parsedHeight;
 
         if( (mask & (WidthValue|HeightValue)) == (WidthValue|HeightValue) )
             fgState.Size.Use = GL_TRUE;
index 1610056..2b70de2 100644 (file)
@@ -75,7 +75,6 @@ SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
 {
     /* Have the window object created */
     SFG_Window *window = (SFG_Window *)calloc( sizeof(SFG_Window), 1 );
-    int fakeArgc = 0;
 
     fghClearCallBacks( window );
 
@@ -120,7 +119,6 @@ SFG_Menu* fgCreateMenu( FGCBMenu menuCallback )
 
     /* Have the menu object created */
     SFG_Menu* menu = (SFG_Menu *)calloc( sizeof(SFG_Menu), 1 );
-    int fakeArgc = 0;
 
     menu->ParentWindow = fgStructure.Window;