From 354569a7c4cb38e48754c649caa9896de3fbb2ec Mon Sep 17 00:00:00 2001 From: rkrolib Date: Fri, 21 Nov 2003 21:15:58 +0000 Subject: [PATCH] Numerous style normalizations from John: * Convert "return( value );" to "return value;" * Normalize spacing around semicolons. * Remove extraneous parens. * Split multi-statement lines into multiple lines. (Mostly things of the form: "if( condition ) return;".) git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@361 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/freeglut_font.c | 38 +- freeglut/freeglut/src/freeglut_geometry.c | 476 +++++++++--------- .../src/freeglut_glutfont_definitions.c | 4 +- freeglut/freeglut/src/freeglut_init.c | 41 +- freeglut/freeglut/src/freeglut_internal.h | 4 +- freeglut/freeglut/src/freeglut_main.c | 18 +- freeglut/freeglut/src/freeglut_menu.c | 2 +- freeglut/freeglut/src/freeglut_misc.c | 2 +- freeglut/freeglut/src/freeglut_state.c | 199 ++++---- freeglut/freeglut/src/freeglut_structure.c | 16 +- freeglut/freeglut/src/freeglut_window.c | 8 +- 11 files changed, 406 insertions(+), 402 deletions(-) diff --git a/freeglut/freeglut/src/freeglut_font.c b/freeglut/freeglut/src/freeglut_font.c index ae44763..52a80c1 100644 --- a/freeglut/freeglut/src/freeglut_font.c +++ b/freeglut/freeglut/src/freeglut_font.c @@ -62,18 +62,21 @@ extern SFG_StrokeFont fgStrokeMonoRoman; */ static SFG_Font* fghFontByID( void* font ) { - /* - * XXX Use a macro, a table of some kind, or else split these - * XXX statements properly. Jamming "return" on the end of an - * XXX "if" is just bad style, IMHO. - */ - if( font == GLUT_BITMAP_8_BY_13 ) return &fgFontFixed8x13; - if( font == GLUT_BITMAP_9_BY_15 ) return &fgFontFixed9x15; - if( font == GLUT_BITMAP_HELVETICA_10 ) return &fgFontHelvetica10; - if( font == GLUT_BITMAP_HELVETICA_12 ) return &fgFontHelvetica12; - if( font == GLUT_BITMAP_HELVETICA_18 ) return &fgFontHelvetica18; - if( font == GLUT_BITMAP_TIMES_ROMAN_10 ) return &fgFontTimesRoman10; - if( font == GLUT_BITMAP_TIMES_ROMAN_24 ) return &fgFontTimesRoman24; + if( font == GLUT_BITMAP_8_BY_13 ) + return &fgFontFixed8x13; + if( font == GLUT_BITMAP_9_BY_15 ) + return &fgFontFixed9x15; + if( font == GLUT_BITMAP_HELVETICA_10 ) + return &fgFontHelvetica10; + if( font == GLUT_BITMAP_HELVETICA_12 ) + return &fgFontHelvetica12; + if( font == GLUT_BITMAP_HELVETICA_18 ) + return &fgFontHelvetica18; + if( font == GLUT_BITMAP_TIMES_ROMAN_10 ) + return &fgFontTimesRoman10; + if( font == GLUT_BITMAP_TIMES_ROMAN_24 ) + return &fgFontTimesRoman24; + fgError( "font 0x%08x not found", font ); return 0; /*** NOT REACHED ***/ } @@ -84,12 +87,11 @@ static SFG_Font* fghFontByID( void* font ) */ static SFG_StrokeFont* fghStrokeByID( void* font ) { - /* - * XXX Same comment as above about jamming "return" in after an - * XXX "if". - */ - if( font == GLUT_STROKE_ROMAN ) return &fgStrokeRoman; - if( font == GLUT_STROKE_MONO_ROMAN ) return &fgStrokeMonoRoman; + if( font == GLUT_STROKE_ROMAN ) + return &fgStrokeRoman; + if( font == GLUT_STROKE_MONO_ROMAN ) + return &fgStrokeMonoRoman; + fgError( "stroke font 0x%08x not found", font ); return 0; /*** NOT REACHED ***/ } diff --git a/freeglut/freeglut/src/freeglut_geometry.c b/freeglut/freeglut/src/freeglut_geometry.c index d286b29..98f2046 100644 --- a/freeglut/freeglut/src/freeglut_geometry.c +++ b/freeglut/freeglut/src/freeglut_geometry.c @@ -138,15 +138,15 @@ void FGAPIENTRY glutWireSphere( GLdouble dRadius, GLint slices, GLint stacks ) for( j=0; jNode ); free( timer ); @@ -376,9 +376,9 @@ ReadInteger(char *string, char **NextString) } *NextString = string; if (Sign >= 0) - return (Result); + return Result; else - return (-Result); + return -Result; } static int XParseGeometry ( @@ -394,7 +394,8 @@ static int XParseGeometry ( int tempX = 0, tempY = 0; char *nextCharacter; - if ( (string == NULL) || (*string == '\0')) return(mask); + if ( (string == NULL) || (*string == '\0')) + return mask; if (*string == '=') string++; /* ignore possible '=' at beg of geometry spec */ @@ -402,7 +403,7 @@ static int XParseGeometry ( if (*strind != '+' && *strind != '-' && *strind != 'x') { tempWidth = ReadInteger(strind, &nextCharacter); if (strind == nextCharacter) - return (0); + return 0; strind = nextCharacter; mask |= WidthValue; } @@ -411,7 +412,7 @@ static int XParseGeometry ( strind++; tempHeight = ReadInteger(strind, &nextCharacter); if (strind == nextCharacter) - return (0); + return 0; strind = nextCharacter; mask |= HeightValue; } @@ -421,7 +422,7 @@ static int XParseGeometry ( strind++; tempX = -ReadInteger(strind, &nextCharacter); if (strind == nextCharacter) - return (0); + return 0; strind = nextCharacter; mask |= XNegative; } @@ -430,7 +431,7 @@ static int XParseGeometry ( strind++; tempX = ReadInteger(strind, &nextCharacter); if (strind == nextCharacter) - return(0); + return 0; strind = nextCharacter; } mask |= XValue; @@ -439,7 +440,7 @@ static int XParseGeometry ( strind++; tempY = -ReadInteger(strind, &nextCharacter); if (strind == nextCharacter) - return(0); + return 0; strind = nextCharacter; mask |= YNegative; } @@ -448,7 +449,7 @@ static int XParseGeometry ( strind++; tempY = ReadInteger(strind, &nextCharacter); if (strind == nextCharacter) - return(0); + return 0; strind = nextCharacter; } mask |= YValue; @@ -458,7 +459,7 @@ static int XParseGeometry ( /* If strind isn't at the end of the string the it's an invalid geometry specification. */ - if (*strind != '\0') return (0); + if (*strind != '\0') return 0; if (mask & XValue) *x = tempX; @@ -468,7 +469,7 @@ static int XParseGeometry ( *width = tempWidth; if (mask & HeightValue) *height = tempHeight; - return (mask); + return mask; } #endif @@ -699,12 +700,12 @@ void FGAPIENTRY glutInitDisplayString( const char* displayMode ) * delimited by blanks or tabs. */ char *token ; - int len = strlen ( displayMode ) ; - char *buffer = (char *)malloc ( (len+1) * sizeof(char) ) ; - memcpy ( buffer, displayMode, len ) ; - buffer[len] = '\0' ; + int len = strlen ( displayMode ); + char *buffer = (char *)malloc ( (len+1) * sizeof(char) ); + memcpy ( buffer, displayMode, len ); + buffer[len] = '\0'; - token = strtok ( buffer, " \t" ) ; + token = strtok ( buffer, " \t" ); while ( token ) { /* @@ -856,14 +857,14 @@ void FGAPIENTRY glutInitDisplayString( const char* displayMode ) case 28 : /* Unrecognized */ printf ( "WARNING - Display string token not recognized: %s\n", - token ) ; + token ); break ; } - token = strtok ( NULL, " \t" ) ; + token = strtok ( NULL, " \t" ); } - free ( buffer ) ; + free ( buffer ); /* * We will make use of this value when creating a new OpenGL context... diff --git a/freeglut/freeglut/src/freeglut_internal.h b/freeglut/freeglut/src/freeglut_internal.h index 9105338..2b93afb 100644 --- a/freeglut/freeglut/src/freeglut_internal.h +++ b/freeglut/freeglut/src/freeglut_internal.h @@ -705,13 +705,13 @@ GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly, SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title, int x, int y, int w, int h, GLboolean gameMode, GLboolean isMenu ); -void fgSetWindow ( SFG_Window *window ) ; +void fgSetWindow ( SFG_Window *window ); void fgOpenWindow( SFG_Window* window, const char* title, int x, int y, int w, int h, GLboolean gameMode, GLboolean isSubWindow ); void fgCloseWindow( SFG_Window* window ); void fgAddToWindowDestroyList ( SFG_Window* window, - GLboolean needToClose ) ; + GLboolean needToClose ); void fgCloseWindows (); void fgDestroyWindow( SFG_Window* window, GLboolean needToClose ); void fgClearCallBacks( SFG_Window *window ); diff --git a/freeglut/freeglut/src/freeglut_main.c b/freeglut/freeglut/src/freeglut_main.c index 15020e8..1e313c4 100644 --- a/freeglut/freeglut/src/freeglut_main.c +++ b/freeglut/freeglut/src/freeglut_main.c @@ -387,7 +387,7 @@ long fgElapsedTime( void ) #if TARGET_HOST_UNIX_X11 gettimeofday( &fgState.Time.Value, NULL ); #elif TARGET_HOST_WIN32 - fgState.Time.Value = timeGetTime () ; + fgState.Time.Value = timeGetTime (); #endif fgState.Time.Set = GL_TRUE ; @@ -413,7 +413,7 @@ void fgError( const char *fmt, ... ) va_end( ap ); if ( fgState.Initialised ) - fgDeinitialize () ; + fgDeinitialize (); exit( 1 ); } @@ -605,7 +605,7 @@ void FGAPIENTRY glutMainLoopEvent( void ) { GETWINDOW( xclient ); - fgCloseWindow ( window ) ; + fgCloseWindow ( window ); fgAddToWindowDestroyList ( window, GL_FALSE ); } break; @@ -730,7 +730,7 @@ void FGAPIENTRY glutMainLoopEvent( void ) event.xmotion.y_root - window->ActiveMenu->Y; } window->ActiveMenu->Window->State.Redisplay = GL_TRUE ; - fgSetWindow( window->ActiveMenu->ParentWindow ) ; + fgSetWindow( window->ActiveMenu->ParentWindow ); break; } @@ -1119,7 +1119,7 @@ void FGAPIENTRY glutMainLoop( void ) fgDeinitialize( ); if( execState == GLUT_ACTION_EXIT ) - exit( 0 ) ; + exit( 0 ); } } @@ -1158,7 +1158,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LONG lRet = 1; if ( ( window == NULL ) && ( uMsg != WM_CREATE ) ) - return DefWindowProc( hWnd, uMsg, wParam, lParam ) ; + return DefWindowProc( hWnd, uMsg, wParam, lParam ); /* printf ( "Window %3d message <%04x> %12d %12d\n", window?window->ID:0, uMsg, wParam, lParam ); */ @@ -1183,7 +1183,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, if( fgStructure.MenuContext ) wglMakeCurrent( window->Window.Device, fgStructure.MenuContext->Context - ) ; + ); else { fgStructure.MenuContext = @@ -1192,7 +1192,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, wglCreateContext( window->Window.Device ); } - /* window->Window.Context = wglGetCurrentContext () ; */ + /* window->Window.Context = wglGetCurrentContext (); */ window->Window.Context = wglCreateContext( window->Window.Device ); } else @@ -1756,7 +1756,7 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, /* User has finished resizing the window, force a redraw */ INVOKE_WCB( *window, Display, ( ) ); - /*lRet = DefWindowProc( hWnd, uMsg, wParam, lParam ) ; */ + /*lRet = DefWindowProc( hWnd, uMsg, wParam, lParam ); */ break; /* diff --git a/freeglut/freeglut/src/freeglut_menu.c b/freeglut/freeglut/src/freeglut_menu.c index bd945a7..a98a358 100644 --- a/freeglut/freeglut/src/freeglut_menu.c +++ b/freeglut/freeglut/src/freeglut_menu.c @@ -289,7 +289,7 @@ static void fghDisplayMenuBox( SFG_Menu* menu ) glVertex2i( menu->Width - border, border); glEnd( ); - glColor4fv( menu_pen_back ) ; + glColor4fv( menu_pen_back ); glBegin( GL_QUADS ); glVertex2i( border, border); glVertex2i( menu->Width - border, border); diff --git a/freeglut/freeglut/src/freeglut_misc.c b/freeglut/freeglut/src/freeglut_misc.c index d950d0a..2af1731 100644 --- a/freeglut/freeglut/src/freeglut_misc.c +++ b/freeglut/freeglut/src/freeglut_misc.c @@ -51,7 +51,7 @@ int FGAPIENTRY glutExtensionSupported( const char* extension ) { const char *extensions, *start; - const int len = strlen( extension ) ; + const int len = strlen( extension ); /* * Make sure there is a current window, and thus a current context available diff --git a/freeglut/freeglut/src/freeglut_state.c b/freeglut/freeglut/src/freeglut_state.c index 5e4ad04..6a7d515 100644 --- a/freeglut/freeglut/src/freeglut_state.c +++ b/freeglut/freeglut/src/freeglut_state.c @@ -132,10 +132,10 @@ int FGAPIENTRY glutGet( GLenum eWhat ) switch (eWhat) { case GLUT_INIT_STATE: - return ( fgState.Initialised ) ; + return fgState.Initialised; case GLUT_ELAPSED_TIME: - return( fgElapsedTime() ); + return fgElapsedTime(); } freeglut_assert_ready; @@ -148,15 +148,15 @@ int FGAPIENTRY glutGet( GLenum eWhat ) /* * Following values are stored in fgState and fgDisplay global structures */ - case GLUT_SCREEN_WIDTH: return( fgDisplay.ScreenWidth ); - case GLUT_SCREEN_HEIGHT: return( fgDisplay.ScreenHeight ); - case GLUT_SCREEN_WIDTH_MM: return( fgDisplay.ScreenWidthMM ); - case GLUT_SCREEN_HEIGHT_MM: return( fgDisplay.ScreenHeightMM ); - case GLUT_INIT_WINDOW_X: return( fgState.Position.X ); - case GLUT_INIT_WINDOW_Y: return( fgState.Position.Y ); - case GLUT_INIT_WINDOW_WIDTH: return( fgState.Size.X ); - case GLUT_INIT_WINDOW_HEIGHT: return( fgState.Size.Y ); - case GLUT_INIT_DISPLAY_MODE: return( fgState.DisplayMode ); + case GLUT_SCREEN_WIDTH: return fgDisplay.ScreenWidth ; + case GLUT_SCREEN_HEIGHT: return fgDisplay.ScreenHeight ; + case GLUT_SCREEN_WIDTH_MM: return fgDisplay.ScreenWidthMM ; + case GLUT_SCREEN_HEIGHT_MM: return fgDisplay.ScreenHeightMM; + case GLUT_INIT_WINDOW_X: return fgState.Position.X ; + case GLUT_INIT_WINDOW_Y: return fgState.Position.Y ; + case GLUT_INIT_WINDOW_WIDTH: return fgState.Size.X ; + case GLUT_INIT_WINDOW_HEIGHT: return fgState.Size.Y ; + case GLUT_INIT_DISPLAY_MODE: return fgState.DisplayMode ; /* * The window/context specific queries are handled mostly by @@ -166,14 +166,14 @@ int FGAPIENTRY glutGet( GLenum eWhat ) /* * XXX Multisampling. Return what I know about multisampling. */ - return( 0 ); + return 0; #if TARGET_HOST_UNIX_X11 /* * The rest of GLX queries under X are general enough to use a macro to * check them */ -# define GLX_QUERY(a,b) case a: return( fghGetConfig( b ) ); +# define GLX_QUERY(a,b) case a: return fghGetConfig( b ); GLX_QUERY( GLUT_WINDOW_RGBA, GLX_RGBA ); GLX_QUERY( GLUT_WINDOW_DOUBLEBUFFER, GLX_DOUBLEBUFFER ); @@ -202,9 +202,9 @@ int FGAPIENTRY glutGet( GLenum eWhat ) * We've got a RGBA visual, so there is no colormap at all. * The other possibility is that we have no current window set. */ - return( 0 ); + return 0; } - return( fgStructure.Window->Window.VisualInfo->visual->map_entries ); + return fgStructure.Window->Window.VisualInfo->visual->map_entries; /* * Those calls are somewhat similiar, as they use XGetWindowAttributes() @@ -219,7 +219,7 @@ int FGAPIENTRY glutGet( GLenum eWhat ) Window w; if( fgStructure.Window == NULL ) - return( 0 ); + return 0; XTranslateCoordinates( fgDisplay.Display, @@ -234,7 +234,7 @@ int FGAPIENTRY glutGet( GLenum eWhat ) } if ( w == 0 ) - return( 0 ); + return 0; XTranslateCoordinates( fgDisplay.Display, fgStructure.Window->Window.Handle, @@ -253,7 +253,7 @@ int FGAPIENTRY glutGet( GLenum eWhat ) XWindowAttributes winAttributes; if( fgStructure.Window == NULL ) - return( 0 ); + return 0; XGetWindowAttributes( fgDisplay.Display, fgStructure.Window->Window.Handle, @@ -277,9 +277,9 @@ int FGAPIENTRY glutGet( GLenum eWhat ) */ case GLUT_WINDOW_FORMAT_ID: if( fgStructure.Window == NULL ) - return( 0 ); + return 0; - return( fgStructure.Window->Window.VisualInfo->visualid ); + return fgStructure.Window->Window.VisualInfo->visualid; #elif TARGET_HOST_WIN32 @@ -287,52 +287,52 @@ int FGAPIENTRY glutGet( GLenum eWhat ) * Handle the OpenGL inquiries */ case GLUT_WINDOW_RGBA: - glGetBooleanv ( GL_RGBA_MODE, &boolValue ) ; - returnValue = boolValue ? 1 : 0 ; - return ( returnValue ) ; + glGetBooleanv ( GL_RGBA_MODE, &boolValue ); + returnValue = boolValue ? 1 : 0; + return returnValue; case GLUT_WINDOW_DOUBLEBUFFER: - glGetBooleanv ( GL_DOUBLEBUFFER, &boolValue ) ; - returnValue = boolValue ? 1 : 0 ; - return ( returnValue ) ; + glGetBooleanv ( GL_DOUBLEBUFFER, &boolValue ); + returnValue = boolValue ? 1 : 0; + return returnValue; case GLUT_WINDOW_STEREO: - glGetBooleanv ( GL_STEREO, &boolValue ) ; - returnValue = boolValue ? 1 : 0 ; - return ( returnValue ) ; + glGetBooleanv ( GL_STEREO, &boolValue ); + returnValue = boolValue ? 1 : 0; + return returnValue; case GLUT_WINDOW_RED_SIZE: - glGetIntegerv ( GL_RED_BITS, &returnValue ) ; - return ( returnValue ) ; + glGetIntegerv ( GL_RED_BITS, &returnValue ); + return returnValue; case GLUT_WINDOW_GREEN_SIZE: - glGetIntegerv ( GL_GREEN_BITS, &returnValue ) ; - return ( returnValue ) ; + glGetIntegerv ( GL_GREEN_BITS, &returnValue ); + return returnValue; case GLUT_WINDOW_BLUE_SIZE: - glGetIntegerv ( GL_BLUE_BITS, &returnValue ) ; - return ( returnValue ) ; + glGetIntegerv ( GL_BLUE_BITS, &returnValue ); + return returnValue; case GLUT_WINDOW_ALPHA_SIZE: - glGetIntegerv ( GL_ALPHA_BITS, &returnValue ) ; - return ( returnValue ) ; + glGetIntegerv ( GL_ALPHA_BITS, &returnValue ); + return returnValue; case GLUT_WINDOW_ACCUM_RED_SIZE: - glGetIntegerv ( GL_ACCUM_RED_BITS, &returnValue ) ; - return ( returnValue ) ; + glGetIntegerv ( GL_ACCUM_RED_BITS, &returnValue ); + return returnValue; case GLUT_WINDOW_ACCUM_GREEN_SIZE: - glGetIntegerv ( GL_ACCUM_GREEN_BITS, &returnValue ) ; - return ( returnValue ) ; + glGetIntegerv ( GL_ACCUM_GREEN_BITS, &returnValue ); + return returnValue; case GLUT_WINDOW_ACCUM_BLUE_SIZE: - glGetIntegerv ( GL_ACCUM_BLUE_BITS, &returnValue ) ; - return ( returnValue ) ; + glGetIntegerv ( GL_ACCUM_BLUE_BITS, &returnValue ); + return returnValue; case GLUT_WINDOW_ACCUM_ALPHA_SIZE: - glGetIntegerv ( GL_ACCUM_ALPHA_BITS, &returnValue ) ; - return ( returnValue ) ; + glGetIntegerv ( GL_ACCUM_ALPHA_BITS, &returnValue ); + return returnValue; case GLUT_WINDOW_DEPTH_SIZE: - glGetIntegerv ( GL_DEPTH_BITS, &returnValue ) ; - return ( returnValue ) ; + glGetIntegerv ( GL_DEPTH_BITS, &returnValue ); + return returnValue; case GLUT_WINDOW_BUFFER_SIZE: returnValue = 1 ; /* ????? */ - return ( returnValue ) ; + return returnValue; case GLUT_WINDOW_STENCIL_SIZE: returnValue = 0 ; /* ????? */ - return ( returnValue ) ; + return returnValue; case GLUT_WINDOW_X: case GLUT_WINDOW_Y: @@ -387,28 +387,28 @@ int FGAPIENTRY glutGet( GLenum eWhat ) switch( eWhat ) { - case GLUT_WINDOW_X: return( winRect.left ); - case GLUT_WINDOW_Y: return( winRect.top ); - case GLUT_WINDOW_WIDTH: return( winRect.right - winRect.left ); - case GLUT_WINDOW_HEIGHT: return( winRect.bottom - winRect.top ); + case GLUT_WINDOW_X: return winRect.left ; + case GLUT_WINDOW_Y: return winRect.top ; + case GLUT_WINDOW_WIDTH: return winRect.right - winRect.left; + case GLUT_WINDOW_HEIGHT: return winRect.bottom - winRect.top; } } break; case GLUT_WINDOW_BORDER_WIDTH : - return ( GetSystemMetrics( SM_CXSIZEFRAME ) ) ; + return GetSystemMetrics( SM_CXSIZEFRAME ); case GLUT_WINDOW_HEADER_HEIGHT : - return ( GetSystemMetrics( SM_CYCAPTION ) ) ; + return GetSystemMetrics( SM_CYCAPTION ); case GLUT_DISPLAY_MODE_POSSIBLE: - return( fgSetupPixelFormat( fgStructure.Window, GL_TRUE, - PFD_MAIN_PLANE ) ); + return fgSetupPixelFormat( fgStructure.Window, GL_TRUE, + PFD_MAIN_PLANE ); case GLUT_WINDOW_FORMAT_ID: if( fgStructure.Window != NULL ) - return( GetPixelFormat( fgStructure.Window->Window.Device ) ); - return( 0 ); + return GetPixelFormat( fgStructure.Window->Window.Device ); + return 0; #endif @@ -416,39 +416,40 @@ int FGAPIENTRY glutGet( GLenum eWhat ) * The window structure queries */ case GLUT_WINDOW_PARENT: - if( fgStructure.Window == NULL ) return( 0 ); - if( fgStructure.Window->Parent == NULL ) return( 0 ); - return( fgStructure.Window->Parent->ID ); + if( fgStructure.Window == NULL ) return 0; + if( fgStructure.Window->Parent == NULL ) return 0; + return fgStructure.Window->Parent->ID; case GLUT_WINDOW_NUM_CHILDREN: if( fgStructure.Window == NULL ) - return( 0 ); - return( fgListLength( &fgStructure.Window->Children ) ); + return 0; + return fgListLength( &fgStructure.Window->Children ); case GLUT_WINDOW_CURSOR: if( fgStructure.Window == NULL ) - return( 0 ); - return( fgStructure.Window->State.Cursor ); + return 0; + return fgStructure.Window->State.Cursor; case GLUT_MENU_NUM_ITEMS: if( fgStructure.Menu == NULL ) - return( 0 ); - return( fgListLength( &fgStructure.Menu->Entries ) ); + return 0; + return fgListLength( &fgStructure.Menu->Entries ); case GLUT_ACTION_ON_WINDOW_CLOSE: - return fgState.ActionOnWindowClose ; + return fgState.ActionOnWindowClose; case GLUT_VERSION : - return VERSION_MAJOR * 10000 + VERSION_MINOR * 100 + VERSION_PATCH ; + return VERSION_MAJOR * 10000 + VERSION_MINOR * 100 + VERSION_PATCH; case GLUT_RENDERING_CONTEXT: - return ( fgState.UseCurrentContext ? GLUT_USE_CURRENT_CONTEXT : GLUT_CREATE_NEW_CONTEXT ) ; + return fgState.UseCurrentContext ? GLUT_USE_CURRENT_CONTEXT + : GLUT_CREATE_NEW_CONTEXT; default: fgWarning( "glutGet(): missing enum handle %i\n", eWhat ); break; } - return( -1 ); + return -1; } /* @@ -473,12 +474,12 @@ int FGAPIENTRY glutDeviceGet( GLenum eWhat ) * XXX Though in actuality, we can probably assume BOTH a * XXX mouse and keyboard for most/all of our users. */ - return( TRUE ); + return TRUE ; #if TARGET_HOST_UNIX_X11 case GLUT_HAS_MOUSE: - return( TRUE ); + return TRUE ; case GLUT_NUM_MOUSE_BUTTONS: /* @@ -500,7 +501,7 @@ int FGAPIENTRY glutDeviceGet( GLenum eWhat ) * XXX XFree86...) It is at least worth taking a look at * XXX this file. */ - return( 3 ); + return 3 ; #elif TARGET_HOST_WIN32 @@ -509,13 +510,13 @@ int FGAPIENTRY glutDeviceGet( GLenum eWhat ) * The Windows can be booted without a mouse. * It would be nice to have this reported. */ - return( GetSystemMetrics( SM_MOUSEPRESENT ) ); + return GetSystemMetrics( SM_MOUSEPRESENT ); case GLUT_NUM_MOUSE_BUTTONS: /* * We are much more fortunate under Win32 about this... */ - return( GetSystemMetrics( SM_CMOUSEBUTTONS ) ); + return GetSystemMetrics( SM_CMOUSEBUTTONS ); #endif @@ -526,27 +527,27 @@ int FGAPIENTRY glutDeviceGet( GLenum eWhat ) /* * XXX WARNING: THIS IS A BIG LIE! */ - return( 0 ); + return 0; case GLUT_HAS_SPACEBALL: case GLUT_HAS_DIAL_AND_BUTTON_BOX: case GLUT_HAS_TABLET: - return( FALSE ); + return FALSE; case GLUT_NUM_SPACEBALL_BUTTONS: case GLUT_NUM_BUTTON_BOX_BUTTONS: case GLUT_NUM_DIALS: case GLUT_NUM_TABLET_BUTTONS: - return( 0 ); + return 0; case GLUT_DEVICE_IGNORE_KEY_REPEAT: - return( fgState.IgnoreKeyRepeat ); + return fgState.IgnoreKeyRepeat; case GLUT_DEVICE_KEY_REPEAT: /* * XXX WARNING: THIS IS A BIG LIE! */ - return( GLUT_KEY_REPEAT_DEFAULT ); + return GLUT_KEY_REPEAT_DEFAULT; default: fgWarning( "glutDeviceGet(): missing enum handle %i\n", eWhat ); @@ -556,7 +557,7 @@ int FGAPIENTRY glutDeviceGet( GLenum eWhat ) /* * And now -- the failure. */ - return( -1 ); + return -1; } /* @@ -567,10 +568,10 @@ int FGAPIENTRY glutGetModifiers( void ) if( fgState.Modifiers == 0xffffffff ) { fgWarning( "glutGetModifiers() called outside an input callback" ); - return( 0 ); + return 0; } - return( fgState.Modifiers ); + return fgState.Modifiers; } /* @@ -592,13 +593,13 @@ int FGAPIENTRY glutLayerGet( GLenum eWhat ) #if TARGET_HOST_UNIX_X11 case GLUT_OVERLAY_POSSIBLE: - return( FALSE ); + return FALSE; case GLUT_LAYER_IN_USE: - return( GLUT_NORMAL ); + return GLUT_NORMAL; case GLUT_HAS_OVERLAY: - return( FALSE ); + return FALSE; case GLUT_TRANSPARENT_INDEX: /* @@ -606,29 +607,29 @@ int FGAPIENTRY glutLayerGet( GLenum eWhat ) * * XXX HUH? */ - return( 0 ); + return 0; case GLUT_NORMAL_DAMAGED: /* * XXX Actually I do not know. Maybe. */ - return( FALSE ); + return FALSE; case GLUT_OVERLAY_DAMAGED: - return( -1 ); + return -1; #elif TARGET_HOST_WIN32 case GLUT_OVERLAY_POSSIBLE: -/* return( fgSetupPixelFormat( fgStructure.Window, GL_TRUE, - PFD_OVERLAY_PLANE ) ); */ +/* return fgSetupPixelFormat( fgStructure.Window, GL_TRUE, + PFD_OVERLAY_PLANE ); */ return FALSE ; case GLUT_LAYER_IN_USE: - return( GLUT_NORMAL ); + return GLUT_NORMAL; case GLUT_HAS_OVERLAY: - return( FALSE ); + return FALSE; case GLUT_TRANSPARENT_INDEX: /* @@ -636,16 +637,16 @@ int FGAPIENTRY glutLayerGet( GLenum eWhat ) * * XXX HUH? */ - return( 0 ); + return 0; case GLUT_NORMAL_DAMAGED: /* * XXX Actually I do not know. Maybe. */ - return( FALSE ); + return FALSE; case GLUT_OVERLAY_DAMAGED: - return( -1 ); + return -1; #endif default: @@ -656,7 +657,7 @@ int FGAPIENTRY glutLayerGet( GLenum eWhat ) /* * And fail. That's good. Programs do love failing. */ - return( -1 ); + return -1; } /*** END OF FILE ***/ diff --git a/freeglut/freeglut/src/freeglut_structure.c b/freeglut/freeglut/src/freeglut_structure.c index e7464bc..69090cb 100644 --- a/freeglut/freeglut/src/freeglut_structure.c +++ b/freeglut/freeglut/src/freeglut_structure.c @@ -279,7 +279,7 @@ void fgDestroyWindow( SFG_Window* window, GLboolean needToClose ) assert( window ); freeglut_assert_ready; - while( (subWindow = ( SFG_Window * )window->Children.First) ) + while( subWindow = ( SFG_Window * )window->Children.First ) fgDestroyWindow( subWindow, needToClose ); /* @@ -291,7 +291,7 @@ void fgDestroyWindow( SFG_Window* window, GLboolean needToClose ) { SFG_Window *activeWindow = fgStructure.Window ; INVOKE_WCB( *window, Destroy, ( ) ); - fgSetWindow ( activeWindow ) ; + fgSetWindow ( activeWindow ); } if( window->Parent ) @@ -402,7 +402,7 @@ void fgDestroyMenu( SFG_Menu* menu ) * Now we are pretty sure the menu is not used anywhere * and that we can remove all of its entries */ - while( (entry = ( SFG_MenuEntry * )menu->Entries.First) ) + while( entry = ( SFG_MenuEntry * )menu->Entries.First ) { fgListRemove( &menu->Entries, &entry->Node ); @@ -457,10 +457,10 @@ void fgDestroyStructure( void ) /* * Make sure all windows and menus have been deallocated */ - while( (menu = ( SFG_Menu * )fgStructure.Menus.First) ) + while( menu = ( SFG_Menu * )fgStructure.Menus.First ) fgDestroyMenu( menu ); - while( (window = ( SFG_Window * )fgStructure.Windows.First) ) + while( window = ( SFG_Window * )fgStructure.Windows.First ) fgDestroyWindow( window, GL_TRUE ); } @@ -651,7 +651,7 @@ void fgListAppend(SFG_List *list, SFG_Node *node) { SFG_Node *ln; - if ( (ln = (SFG_Node *)list->Last) ) + if ( ln = (SFG_Node *)list->Last ) { ln->Next = node; node->Prev = ln; @@ -670,9 +670,9 @@ void fgListRemove(SFG_List *list, SFG_Node *node) { SFG_Node *ln; - if( (ln = (SFG_Node *)node->Next) ) + if( ln = (SFG_Node *)node->Next ) ln->Prev = node->Prev; - if( (ln = (SFG_Node *)node->Prev) ) + if( ln = (SFG_Node *)node->Prev ) ln->Next = node->Next; if( (ln = (SFG_Node *)list->First) == node ) list->First = node->Next; diff --git a/freeglut/freeglut/src/freeglut_window.c b/freeglut/freeglut/src/freeglut_window.c index f268eb3..99f871f 100644 --- a/freeglut/freeglut/src/freeglut_window.c +++ b/freeglut/freeglut/src/freeglut_window.c @@ -529,12 +529,12 @@ void fgOpenWindow( SFG_Window* window, const char* title, #endif window->Window.DoubleBuffered = - ( fgState.DisplayMode & GLUT_DOUBLE ) ? 1 : 0 ; + ( fgState.DisplayMode & GLUT_DOUBLE ) ? 1 : 0; if ( ! window->Window.DoubleBuffered ) { - glDrawBuffer ( GL_FRONT ) ; - glReadBuffer ( GL_FRONT ) ; + glDrawBuffer ( GL_FRONT ); + glReadBuffer ( GL_FRONT ); } fgSetWindow( window ); } @@ -625,7 +625,7 @@ void FGAPIENTRY glutSetWindow( int ID ) return; } - fgSetWindow( window ) ; + fgSetWindow( window ); } /*