* to ensure that they are no longer called after this point.
*/
{
- void *destroy = FETCH_WCB( *window, Destroy );
+ FGCBDestroy destroy = FETCH_WCB( *window, Destroy );
fgClearCallBacks( window );
SET_WCB( *window, Destroy, destroy );
}
{
SFG_Window *window;
SFG_Menu *from;
- SFG_MenuEntry *entry;
assert( menu );
freeglut_assert_ready;
* 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( menu->Entries.First )
{
+ SFG_MenuEntry *entry = ( SFG_MenuEntry * ) menu->Entries.First;
+
fgListRemove( &menu->Entries, &entry->Node );
if( entry->Text )
entry->Text = NULL;
free( entry );
- entry = NULL;
}
if( fgStructure.Window == menu->Window )
void fgListAppend(SFG_List *list, SFG_Node *node)
{
- SFG_Node *ln;
-
- if ( ln = (SFG_Node *)list->Last )
+ if ( list->Last )
{
+ SFG_Node *ln = (SFG_Node *) list->Last;
ln->Next = node;
node->Prev = ln;
}
{
SFG_Node *ln;
- if( ln = (SFG_Node *)node->Next )
+ if( (ln = (SFG_Node *)node->Next) != NULL )
ln->Prev = node->Prev;
- if( ln = (SFG_Node *)node->Prev )
+ if( (ln = (SFG_Node *)node->Prev) != NULL )
ln->Next = node->Next;
if( (ln = (SFG_Node *)list->First) == node )
list->First = node->Next;