From 8c18b050e929364e344dfa4cb11e5200771e0d1d Mon Sep 17 00:00:00 2001 From: Sven Panne Date: Mon, 3 Jan 2005 08:44:48 +0000 Subject: [PATCH] Make it compile again with "-Wall -pedantic -Werror", redoing quite a 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 | 2 +- src/freeglut_font.c | 8 ++++---- src/freeglut_init.c | 10 +++++++--- src/freeglut_structure.c | 2 -- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/freeglut_cursor.c b/src/freeglut_cursor.c index 2d789bf..d26b581 100644 --- a/src/freeglut_cursor.c +++ b/src/freeglut_cursor.c @@ -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, diff --git a/src/freeglut_font.c b/src/freeglut_font.c index 2c6ed5e..8042234 100644 --- a/src/freeglut_font.c +++ b/src/freeglut_font.c @@ -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 */ diff --git a/src/freeglut_init.c b/src/freeglut_init.c index 01f2af2..7688714 100644 --- a/src/freeglut_init.c +++ b/src/freeglut_init.c @@ -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; diff --git a/src/freeglut_structure.c b/src/freeglut_structure.c index 1610056..2b70de2 100644 --- a/src/freeglut_structure.c +++ b/src/freeglut_structure.c @@ -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; -- 1.7.10.4