Replace MODE_COUNT hack with an enumeration
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Sat, 30 Aug 2008 00:07:33 +0000 (00:07 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Sat, 30 Aug 2008 00:07:33 +0000 (00:07 +0000)
git-svn-id: https://s.snth.net/svn/neverball/trunk@2494 78b8d119-cf0a-0410-b17c-f493084dd1d7

ball/progress.h
ball/st_demo.c

index c6368e4..bd15585 100644 (file)
@@ -44,10 +44,15 @@ int  progress_reward_ball(int);
 
 /*---------------------------------------------------------------------------*/
 
-#define MODE_CHALLENGE 1
-#define MODE_NORMAL    2
+enum
+{
+    MODE_NONE = 0,
 
-#define MODE_COUNT 2
+    MODE_CHALLENGE,
+    MODE_NORMAL,
+
+    MODE_MAX
+};
 
 const char *mode_to_str(int, int);
 
index 95069f4..960fbe7 100644 (file)
@@ -132,7 +132,7 @@ static int gui_demo_status(int id, const struct demo *d)
         mode = mode_to_str(0, 0);
         j = strlen(mode);
 
-        for (i = 1; i <= MODE_COUNT; i++)
+        for (i = MODE_NONE + 1; i < MODE_MAX; i++)
         {
             k = strlen(mode_to_str(i, 0));