Finished off most of the issues with freeglut_structure.c, from a stylistic

point of view (at least, insofar as: The original file's code was INCON-
SISTANT.  I did not remove the "!= NULL" stuff, did not address the
shortest-branch-first issue for if-else statements, and left some rather
ugly "if (x) {... return y} /* else do this */ return NULL;" garbage.
This should, I think, be re-written as "if (x) return y; else return NULL;"
or even better, "ret = NULL; if (x) ret = y; return ret;"

In short, the code still has some issues, but I think that it's a bit
better.

(Oh, I also got rid of oustanding TABs.)


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@271 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
rkrolib 2003-10-30 04:43:08 +00:00
parent 191ff25528
commit 92b5fb9d59

View File

@ -608,19 +608,12 @@ SFG_Menu* fgMenuByID( int menuID )
/*
* It's enough to check all entries in fgStructure.Menus...
*/
for( menu = (SFG_Menu *)fgStructure.Menus.First; menu; menu = (SFG_Menu *)menu->Node.Next )
{
/*
* Does the ID number match?
*/
for( menu = (SFG_Menu *)fgStructure.Menus.First;
menu;
menu = (SFG_Menu *)menu->Node.Next )
if( menu->ID == menuID )
return( menu );
}
/*
* We have not found the requested menu ID
*/
return( NULL );
return menu;
return NULL;
}
/*
@ -673,7 +666,7 @@ int fgListLength(SFG_List *list)
for( node = (SFG_Node *)list->First; node; node = (SFG_Node *)node->Next )
++length;
return( length );
return length;
}
/*** END OF FILE ***/