From: Richard Rauch Date: Tue, 30 Dec 2003 11:50:58 +0000 (+0000) Subject: Split a few overlong lines. X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;ds=inline;h=36c6530f942007c5a72c6a3bd6d00077027d8c06;p=freeglut Split a few overlong lines. Adjusted some spacing in a few spots to be more consistant with freeglut style. Including one unindented if() body. Eliminated a dead variable. git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@437 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/src/freeglut_main.c b/src/freeglut_main.c index 16248b5..34e284b 100644 --- a/src/freeglut_main.c +++ b/src/freeglut_main.c @@ -1380,13 +1380,13 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, break; } - if ( GetSystemMetrics( SM_SWAPBUTTON ) ) + if( GetSystemMetrics( SM_SWAPBUTTON ) ) { - if ( button == GLUT_LEFT_BUTTON ) + if( button == GLUT_LEFT_BUTTON ) button = GLUT_RIGHT_BUTTON; else - if ( button == GLUT_RIGHT_BUTTON ) - button = GLUT_LEFT_BUTTON; + if( button == GLUT_RIGHT_BUTTON ) + button = GLUT_LEFT_BUTTON; } if( button == -1 ) diff --git a/src/freeglut_menu.c b/src/freeglut_menu.c index 3ba5b22..1f9a831 100644 --- a/src/freeglut_menu.c +++ b/src/freeglut_menu.c @@ -362,7 +362,8 @@ static void fghDisplayMenuBox( SFG_Menu* menu ) /* * Have the label drawn, character after character: */ - glutBitmapString( FREEGLUT_MENU_FONT, (unsigned char *) menuEntry->Text); + glutBitmapString( FREEGLUT_MENU_FONT, + (unsigned char *)menuEntry->Text); /* * If it's a submenu, draw a right arrow @@ -674,15 +675,20 @@ void fghCalculateMenuBoxSize( void ) /* * Update the menu entry's width value */ - menuEntry->Width = glutBitmapLength( FREEGLUT_MENU_FONT, - (unsigned char *) menuEntry->Text ); + menuEntry->Width = glutBitmapLength( + FREEGLUT_MENU_FONT, + (unsigned char *)menuEntry->Text + ); /* * If the entry is a submenu, then it needs to be wider to * accomodate the arrow. JCJ 31 July 2003 */ if (menuEntry->SubMenu ) - menuEntry->Width += glutBitmapLength( FREEGLUT_MENU_FONT, (unsigned char *) "_" ); + menuEntry->Width += glutBitmapLength( + FREEGLUT_MENU_FONT, + (unsigned char *)"_" + ); /* * Check if it's the biggest we've found diff --git a/src/freeglut_structure.c b/src/freeglut_structure.c index cd3a781..42eb578 100644 --- a/src/freeglut_structure.c +++ b/src/freeglut_structure.c @@ -600,15 +600,13 @@ void fgListAppend(SFG_List *list, SFG_Node *node) void fgListRemove(SFG_List *list, SFG_Node *node) { - SFG_Node *ln; - - if( (ln = (SFG_Node *)node->Next) != NULL ) - ln->Prev = node->Prev; - if( (ln = (SFG_Node *)node->Prev) != NULL ) - ln->Next = node->Next; - if( (ln = (SFG_Node *)list->First) == node ) + if( node->Next ) + ( ( SFG_Node * )node->Next )->Prev = node->Prev; + if( node->Prev ) + ( ( SFG_Node * )node->Prev )->Next = node->Next; + if( ( ( SFG_Node * )list->First ) == node ) list->First = node->Next; - if( (ln = (SFG_Node *)list->Last) == node ) + if( ( ( SFG_Node * )list->Last ) == node ) list->Last = node->Prev; }