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: https://svn.code.sf.net/p/freeglut/code/trunk@544 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
spanne 2005-01-03 08:44:48 +00:00
parent cfef5bfb34
commit 8afaa43f1d
4 changed files with 12 additions and 10 deletions

View File

@ -144,7 +144,7 @@ void FGAPIENTRY glutSetCursor( int cursorID )
* need to pick a color for foreground/background---but what * need to pick a color for foreground/background---but what
* one we pick doesn't matter for GLUT_CURSOR_NONE. * 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; XColor black;
no_cursor = XCreatePixmapFromBitmapData( fgDisplay.Display, no_cursor = XCreatePixmapFromBitmapData( fgDisplay.Display,
fgDisplay.RootWindow, fgDisplay.RootWindow,

View File

@ -156,7 +156,7 @@ void FGAPIENTRY glutBitmapString( void* fontID, const unsigned char *string )
* A newline will simply translate the next character's insertion * A newline will simply translate the next character's insertion
* point back to the start of the line and down one line. * point back to the start of the line and down one line.
*/ */
while( c = *string++ ) while( ( c = *string++) )
if( string[c] == '\n' ) if( string[c] == '\n' )
{ {
glBitmap ( 0, 0, 0, 0, -x, (float) -font->Height, NULL ); 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 ) if ( !string || ! *string )
return 0; return 0;
while( c = *string++ ) while( ( c = *string++) )
{ {
if( c != '\n' )/* Not an EOL, increment length of line */ if( c != '\n' )/* Not an EOL, increment length of line */
this_line_length += *( font->Characters[ c ]); 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 * A newline will simply translate the next character's insertion
* point back to the start of the line and down one line. * point back to the start of the line and down one line.
*/ */
while( c = *string++ ) while( ( c = *string++) )
if( c < font->Quantity ) if( c < font->Quantity )
{ {
if( c == '\n' ) if( c == '\n' )
@ -348,7 +348,7 @@ int FGAPIENTRY glutStrokeLength( void* fontID, const unsigned char* string )
if ( !string || ! *string ) if ( !string || ! *string )
return 0; return 0;
while( c = *string++ ) while( ( c = *string++) )
if( c < font->Quantity ) if( c < font->Quantity )
{ {
if( c == '\n' ) /* EOL; reset the length of this line */ if( c == '\n' ) /* EOL; reset the length of this line */

View File

@ -228,13 +228,13 @@ void fgDeinitialize( void )
fgDestroyStructure( ); fgDestroyStructure( );
while( timer = fgState.Timers.First ) while( ( timer = fgState.Timers.First) )
{ {
fgListRemove( &fgState.Timers, &timer->Node ); fgListRemove( &fgState.Timers, &timer->Node );
free( timer ); free( timer );
} }
while( timer = fgState.FreeTimers.First ) while( ( timer = fgState.FreeTimers.First) )
{ {
fgListRemove( &fgState.FreeTimers, &timer->Node ); fgListRemove( &fgState.FreeTimers, &timer->Node );
free( timer ); free( timer );
@ -620,9 +620,13 @@ void FGAPIENTRY glutInit( int* pargc, char** argv )
if (geometry ) if (geometry )
{ {
unsigned int parsedWidth, parsedHeight;
int mask = XParseGeometry( geometry, int mask = XParseGeometry( geometry,
&fgState.Position.X, &fgState.Position.Y, &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) ) if( (mask & (WidthValue|HeightValue)) == (WidthValue|HeightValue) )
fgState.Size.Use = GL_TRUE; fgState.Size.Use = GL_TRUE;

View File

@ -75,7 +75,6 @@ SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
{ {
/* Have the window object created */ /* Have the window object created */
SFG_Window *window = (SFG_Window *)calloc( sizeof(SFG_Window), 1 ); SFG_Window *window = (SFG_Window *)calloc( sizeof(SFG_Window), 1 );
int fakeArgc = 0;
fghClearCallBacks( window ); fghClearCallBacks( window );
@ -120,7 +119,6 @@ SFG_Menu* fgCreateMenu( FGCBMenu menuCallback )
/* Have the menu object created */ /* Have the menu object created */
SFG_Menu* menu = (SFG_Menu *)calloc( sizeof(SFG_Menu), 1 ); SFG_Menu* menu = (SFG_Menu *)calloc( sizeof(SFG_Menu), 1 );
int fakeArgc = 0;
menu->ParentWindow = fgStructure.Window; menu->ParentWindow = fgStructure.Window;