chiark / gitweb /
`BOOLEAN' is a term already used by Win32. Bah. Change terminology.
authorSimon Tatham <anakin@pobox.com>
Sun, 2 May 2004 10:43:46 +0000 (10:43 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 2 May 2004 10:43:46 +0000 (10:43 +0000)
[originally from svn r4183]

cube.c
fifteen.c
gtk.c
net.c
puzzles.h
sixteen.c

diff --git a/cube.c b/cube.c
index d9c0cadf0b3c0f35f9d297514ed5b06baf720245..c867471af140e939f099b1231f38e6d57a9746cb 100644 (file)
--- a/cube.c
+++ b/cube.c
@@ -450,24 +450,24 @@ config_item *game_configure(game_params *params)
     char buf[80];
 
     ret[0].name = "Type of solid";
-    ret[0].type = CHOICES;
+    ret[0].type = C_CHOICES;
     ret[0].sval = ":Tetrahedron:Cube:Octahedron:Icosahedron";
     ret[0].ival = params->solid;
 
     ret[1].name = "Width / top";
-    ret[1].type = STRING;
+    ret[1].type = C_STRING;
     sprintf(buf, "%d", params->d1);
     ret[1].sval = dupstr(buf);
     ret[1].ival = 0;
 
     ret[2].name = "Height / bottom";
-    ret[2].type = STRING;
+    ret[2].type = C_STRING;
     sprintf(buf, "%d", params->d2);
     ret[2].sval = dupstr(buf);
     ret[2].ival = 0;
 
     ret[3].name = NULL;
-    ret[3].type = ENDCFG;
+    ret[3].type = C_END;
     ret[3].sval = NULL;
     ret[3].ival = 0;
 
index f7bcc68650c8cb3e5f32e5f378f48a7a07ac1f6e..7f6769ae441074e9ef08e4dc532622f1aa67de7e 100644 (file)
--- a/fifteen.c
+++ b/fifteen.c
@@ -80,19 +80,19 @@ config_item *game_configure(game_params *params)
     ret = snewn(3, config_item);
 
     ret[0].name = "Width";
-    ret[0].type = STRING;
+    ret[0].type = C_STRING;
     sprintf(buf, "%d", params->w);
     ret[0].sval = dupstr(buf);
     ret[0].ival = 0;
 
     ret[1].name = "Height";
-    ret[1].type = STRING;
+    ret[1].type = C_STRING;
     sprintf(buf, "%d", params->h);
     ret[1].sval = dupstr(buf);
     ret[1].ival = 0;
 
     ret[2].name = NULL;
-    ret[2].type = ENDCFG;
+    ret[2].type = C_END;
     ret[2].sval = NULL;
     ret[2].ival = 0;
 
diff --git a/gtk.c b/gtk.c
index d443f5f76cdc0882416d799079906d53ab805147..5e9de9060b6938796c864a1265f71291869a6a1b 100644 (file)
--- a/gtk.c
+++ b/gtk.c
@@ -495,11 +495,11 @@ static int get_config(frontend *fe)
                      table, FALSE, FALSE, 0);
     gtk_widget_show(table);
 
-    for (i = fe->cfg; i->type != ENDCFG; i++) {
+    for (i = fe->cfg; i->type != C_END; i++) {
        gtk_table_resize(GTK_TABLE(table), y+1, 2);
 
        switch (i->type) {
-         case STRING:
+         case C_STRING:
            /*
             * Edit box with a label beside it.
             */
@@ -524,7 +524,7 @@ static int get_config(frontend *fe)
 
            break;
 
-         case BOOLEAN:
+         case C_BOOLEAN:
            /*
             * Simple checkbox.
             */
@@ -539,7 +539,7 @@ static int get_config(frontend *fe)
            gtk_widget_show(w);
            break;
 
-         case CHOICES:
+         case C_CHOICES:
            /*
             * Drop-down list (GtkOptionMenu).
             */
diff --git a/net.c b/net.c
index 8170bda8828e2a3fb2cd3fc5da099caeadc8c92d..3c28ccc54622c81cadabd8da709935ab7bc76486 100644 (file)
--- a/net.c
+++ b/net.c
@@ -191,30 +191,30 @@ config_item *game_configure(game_params *params)
     ret = snewn(5, config_item);
 
     ret[0].name = "Width";
-    ret[0].type = STRING;
+    ret[0].type = C_STRING;
     sprintf(buf, "%d", params->width);
     ret[0].sval = dupstr(buf);
     ret[0].ival = 0;
 
     ret[1].name = "Height";
-    ret[1].type = STRING;
+    ret[1].type = C_STRING;
     sprintf(buf, "%d", params->height);
     ret[1].sval = dupstr(buf);
     ret[1].ival = 0;
 
     ret[2].name = "Walls wrap around";
-    ret[2].type = BOOLEAN;
+    ret[2].type = C_BOOLEAN;
     ret[2].sval = NULL;
     ret[2].ival = params->wrapping;
 
     ret[3].name = "Barrier probability";
-    ret[3].type = STRING;
+    ret[3].type = C_STRING;
     sprintf(buf, "%g", params->barrier_probability);
     ret[3].sval = dupstr(buf);
     ret[3].ival = 0;
 
     ret[4].name = NULL;
-    ret[4].type = ENDCFG;
+    ret[4].type = C_END;
     ret[4].sval = NULL;
     ret[4].ival = 0;
 
@@ -228,7 +228,7 @@ game_params *custom_params(config_item *cfg)
     ret->width = atoi(cfg[0].sval);
     ret->height = atoi(cfg[1].sval);
     ret->wrapping = cfg[2].ival;
-    ret->barrier_probability = atof(cfg[3].sval);
+    ret->barrier_probability = (float)atof(cfg[3].sval);
 
     return ret;
 }
index be933366713777195c5818aafdbd311a0f4ae1e0..35dc1600a2585efc6211c65edd4113abb91360c6 100644 (file)
--- a/puzzles.h
+++ b/puzzles.h
@@ -52,7 +52,7 @@ typedef struct game_drawstate game_drawstate;
  * Structure used to pass configuration data between frontend and
  * game
  */
-enum { STRING, CHOICES, BOOLEAN, ENDCFG };
+enum { C_STRING, C_CHOICES, C_BOOLEAN, C_END };
 struct config_item {
     /*
      * `name' is never dynamically allocated.
@@ -63,17 +63,17 @@ struct config_item {
      */
     int type;
     /*
-     * For STRING, `sval' is always dynamically allocated and
-     * non-NULL. For BOOLEAN and ENDCFG, `sval' is always NULL. For
-     * CHOICES, `sval' is non-NULL, _not_ dynamically allocated,
-     * and contains a set of option strings separated by a
-     * delimiter. The delimeter is also the first character in the
-     * string, so for example ":Foo:Bar:Baz" gives three options
-     * `Foo', `Bar' and `Baz'.
+     * For C_STRING, `sval' is always dynamically allocated and
+     * non-NULL. For C_BOOLEAN and C_END, `sval' is always NULL.
+     * For C_CHOICES, `sval' is non-NULL, _not_ dynamically
+     * allocated, and contains a set of option strings separated by
+     * a delimiter. The delimeter is also the first character in
+     * the string, so for example ":Foo:Bar:Baz" gives three
+     * options `Foo', `Bar' and `Baz'.
      */
     char *sval;
     /*
-     * For BOOLEAN, this is TRUE or FALSE. For CHOICES, it
+     * For C_BOOLEAN, this is TRUE or FALSE. For C_CHOICES, it
      * indicates the chosen index from the `sval' list. In the
      * above example, 0==Foo, 1==Bar and 2==Baz.
      */
index 22faea9a4273f364c1d24ff67f776a782c0f43aa..7217d10f7be0def2b628f78a0da745414f6950fb 100644 (file)
--- a/sixteen.c
+++ b/sixteen.c
@@ -100,19 +100,19 @@ config_item *game_configure(game_params *params)
     ret = snewn(3, config_item);
 
     ret[0].name = "Width";
-    ret[0].type = STRING;
+    ret[0].type = C_STRING;
     sprintf(buf, "%d", params->w);
     ret[0].sval = dupstr(buf);
     ret[0].ival = 0;
 
     ret[1].name = "Height";
-    ret[1].type = STRING;
+    ret[1].type = C_STRING;
     sprintf(buf, "%d", params->h);
     ret[1].sval = dupstr(buf);
     ret[1].ival = 0;
 
     ret[2].name = NULL;
-    ret[2].type = ENDCFG;
+    ret[2].type = C_END;
     ret[2].sval = NULL;
     ret[2].ival = 0;