Split a few overlong lines.
authorRichard Rauch <rkr@olib.org>
Tue, 30 Dec 2003 11:50:58 +0000 (11:50 +0000)
committerRichard Rauch <rkr@olib.org>
Tue, 30 Dec 2003 11:50:58 +0000 (11:50 +0000)
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

src/freeglut_main.c
src/freeglut_menu.c
src/freeglut_structure.c

index 16248b5..34e284b 100644 (file)
@@ -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 )
index 3ba5b22..1f9a831 100644 (file)
@@ -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
index cd3a781..42eb578 100644 (file)
@@ -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;
 }