Several test-on-assignment cases have been converted to stop GCC from
complaining about if( a = get_a_value_for_a( ) ) type code. git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@412 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
0687f2f596
commit
69c32f5e17
@ -303,10 +303,11 @@ static void fghCheckJoystickPolls( void )
|
|||||||
static void fghCheckTimers( void )
|
static void fghCheckTimers( void )
|
||||||
{
|
{
|
||||||
long checkTime = fgElapsedTime( );
|
long checkTime = fgElapsedTime( );
|
||||||
SFG_Timer *timer;
|
|
||||||
|
|
||||||
while( timer = fgState.Timers.First )
|
while( fgState.Timers.First )
|
||||||
{
|
{
|
||||||
|
SFG_Timer *timer = fgState.Timers.First;
|
||||||
|
|
||||||
if( timer->TriggerTime > checkTime )
|
if( timer->TriggerTime > checkTime )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -210,10 +210,9 @@ void fgAddToWindowDestroyList( SFG_Window* window )
|
|||||||
*/
|
*/
|
||||||
void fgCloseWindows( )
|
void fgCloseWindows( )
|
||||||
{
|
{
|
||||||
SFG_WindowList *window_ptr;
|
while( fgStructure.WindowsToDestroy.First )
|
||||||
|
|
||||||
while( window_ptr = fgStructure.WindowsToDestroy.First )
|
|
||||||
{
|
{
|
||||||
|
SFG_WindowList *window_ptr = fgStructure.WindowsToDestroy.First;
|
||||||
fgDestroyWindow( window_ptr->window );
|
fgDestroyWindow( window_ptr->window );
|
||||||
fgListRemove( &fgStructure.WindowsToDestroy, &window_ptr->node );
|
fgListRemove( &fgStructure.WindowsToDestroy, &window_ptr->node );
|
||||||
free( window_ptr );
|
free( window_ptr );
|
||||||
@ -227,19 +226,18 @@ void fgCloseWindows( )
|
|||||||
*/
|
*/
|
||||||
void fgDestroyWindow( SFG_Window* window )
|
void fgDestroyWindow( SFG_Window* window )
|
||||||
{
|
{
|
||||||
SFG_Window* subWindow;
|
int menu_index;
|
||||||
int menu_index ;
|
|
||||||
|
|
||||||
assert( window );
|
assert( window );
|
||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
|
|
||||||
while( subWindow = ( SFG_Window * )window->Children.First )
|
while( window->Children.First )
|
||||||
fgDestroyWindow( subWindow );
|
fgDestroyWindow( ( SFG_Window * )window->Children.First );
|
||||||
|
|
||||||
{
|
{
|
||||||
SFG_Window *activeWindow = fgStructure.Window ;
|
SFG_Window *activeWindow = fgStructure.Window;
|
||||||
INVOKE_WCB( *window, Destroy, ( ) );
|
INVOKE_WCB( *window, Destroy, ( ) );
|
||||||
fgSetWindow ( activeWindow );
|
fgSetWindow( activeWindow );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( window->Parent )
|
if( window->Parent )
|
||||||
@ -250,11 +248,9 @@ void fgDestroyWindow( SFG_Window* window )
|
|||||||
if( window->ActiveMenu )
|
if( window->ActiveMenu )
|
||||||
fgDeactivateMenu( window );
|
fgDeactivateMenu( window );
|
||||||
|
|
||||||
for ( menu_index = 0; menu_index < 3; menu_index ++ )
|
for( menu_index = 0; menu_index < 3; menu_index ++ )
|
||||||
{
|
if( window->Menu[ menu_index ] )
|
||||||
if ( window->Menu[menu_index] )
|
window->Menu[ menu_index ]->ParentWindow = NULL;
|
||||||
window->Menu[menu_index]->ParentWindow = NULL ;
|
|
||||||
}
|
|
||||||
|
|
||||||
fgClearCallBacks( window );
|
fgClearCallBacks( window );
|
||||||
fgCloseWindow( window );
|
fgCloseWindow( window );
|
||||||
@ -397,24 +393,21 @@ void fgCreateStructure( void )
|
|||||||
*/
|
*/
|
||||||
void fgDestroyStructure( void )
|
void fgDestroyStructure( void )
|
||||||
{
|
{
|
||||||
SFG_Window *window;
|
|
||||||
SFG_Menu *menu;
|
|
||||||
|
|
||||||
freeglut_assert_ready;
|
freeglut_assert_ready;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clean up the WindowsToDestroy list.
|
* Clean up the WindowsToDestroy list.
|
||||||
*/
|
*/
|
||||||
fgCloseWindows();
|
fgCloseWindows( );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make sure all windows and menus have been deallocated
|
* Make sure all windows and menus have been deallocated
|
||||||
*/
|
*/
|
||||||
while( menu = ( SFG_Menu * )fgStructure.Menus.First )
|
while( fgStructure.Menus.First )
|
||||||
fgDestroyMenu( menu );
|
fgDestroyMenu( ( SFG_Menu * )fgStructure.Menus.First );
|
||||||
|
|
||||||
while( window = ( SFG_Window * )fgStructure.Windows.First )
|
while( fgStructure.Windows.First )
|
||||||
fgDestroyWindow( window );
|
fgDestroyWindow( ( SFG_Window * )fgStructure.Windows.First );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -517,13 +510,13 @@ static void fghcbWindowByID( SFG_Window *window, SFG_Enumerator *enumerator )
|
|||||||
/*
|
/*
|
||||||
* Make sure we do not overwrite our precious results...
|
* Make sure we do not overwrite our precious results...
|
||||||
*/
|
*/
|
||||||
if ( enumerator->found )
|
if( enumerator->found )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check the window's handle. Hope this works. Looks ugly. That's for sure.
|
* Check the window's handle. Hope this works. Looks ugly. That's for sure.
|
||||||
*/
|
*/
|
||||||
if( window->ID == (int) (enumerator->data) ) /* XXX int/ptr conversion! */
|
if( window->ID == ( int )(enumerator->data) ) /* XXX int/ptr conversion! */
|
||||||
{
|
{
|
||||||
enumerator->found = GL_TRUE;
|
enumerator->found = GL_TRUE;
|
||||||
enumerator->data = window;
|
enumerator->data = window;
|
||||||
@ -550,10 +543,10 @@ SFG_Window* fgWindowByID( int windowID )
|
|||||||
* Uses a method very similiar for fgWindowByHandle...
|
* Uses a method very similiar for fgWindowByHandle...
|
||||||
*/
|
*/
|
||||||
enumerator.found = GL_FALSE;
|
enumerator.found = GL_FALSE;
|
||||||
enumerator.data = (void *) windowID; /* XXX int/pointer conversion! */
|
enumerator.data = ( void * )windowID; /* XXX int/pointer conversion! */
|
||||||
fgEnumWindows( fghcbWindowByID, &enumerator );
|
fgEnumWindows( fghcbWindowByID, &enumerator );
|
||||||
if( enumerator.found )
|
if( enumerator.found )
|
||||||
return( SFG_Window *) enumerator.data;
|
return ( SFG_Window * )enumerator.data;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user