fixed timer.c: wouldn't compile in C89 mode due to recent change which added two
authorJohn Tsiombikas <nuclear@member.fsf.org>
Tue, 21 Jan 2014 10:50:05 +0000 (10:50 +0000)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Tue, 21 Jan 2014 10:50:05 +0000 (10:50 +0000)
for loops with a loop variable declared in the statement itself.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1639 7f0cb862-5218-0410-a997-914c9d46530a

progs/demos/timer/timer.c

index 11557f7..5119870 100644 (file)
@@ -34,7 +34,8 @@ int menuID, subMenuSurround, subMenuCenter;
 
 void createMenuEntries(int which)
 {
-    for (int i = 0; i < sizeof(timerInts) / sizeof(*timerInts); i++)
+       int i;
+    for (i = 0; i < sizeof(timerInts) / sizeof(*timerInts); i++)
     {
         char temp[10] = {'\0'};
         /* flag current value */
@@ -51,7 +52,8 @@ void createMenuEntries(int which)
 
 void updateMenuEntries(int which)
 {
-    for (int i = 0; i < sizeof(timerInts) / sizeof(*timerInts); i++)
+       int i;
+    for (i = 0; i < sizeof(timerInts) / sizeof(*timerInts); i++)
     {
         char temp[10] = { '\0' };
         /* flag current value */