aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2004-05-02 10:43:46 +0000
committerSimon Tatham <anakin@pobox.com>2004-05-02 10:43:46 +0000
commitee171498221e701d446fd1bf18c5e1c5771ef128 (patch)
treec82ab56dfb47a40cf3f5f7cf6ebdb87257ab9d76
parent44ff00665b271ffc789d750d8ad2e5cf25e5327d (diff)
downloadpuzzles-ee171498221e701d446fd1bf18c5e1c5771ef128.zip
puzzles-ee171498221e701d446fd1bf18c5e1c5771ef128.tar.gz
puzzles-ee171498221e701d446fd1bf18c5e1c5771ef128.tar.bz2
puzzles-ee171498221e701d446fd1bf18c5e1c5771ef128.tar.xz
`BOOLEAN' is a term already used by Win32. Bah. Change terminology.
[originally from svn r4183]
-rw-r--r--cube.c8
-rw-r--r--fifteen.c6
-rw-r--r--gtk.c8
-rw-r--r--net.c12
-rw-r--r--puzzles.h18
-rw-r--r--sixteen.c6
6 files changed, 29 insertions, 29 deletions
diff --git a/cube.c b/cube.c
index d9c0cad..c867471 100644
--- 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;
diff --git a/fifteen.c b/fifteen.c
index f7bcc68..7f6769a 100644
--- 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 d443f5f..5e9de90 100644
--- 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 8170bda..3c28ccc 100644
--- 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;
}
diff --git a/puzzles.h b/puzzles.h
index be93336..35dc160 100644
--- 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.
*/
diff --git a/sixteen.c b/sixteen.c
index 22faea9..7217d10 100644
--- 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;