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: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@271
7f0cb862-5218-0410-a997-
914c9d46530a
/*
* 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;
}
/*
for( node = (SFG_Node *)list->First; node; node = (SFG_Node *)node->Next )
++length;
- return( length );
+ return length;
}
/*** END OF FILE ***/