From ee171498221e701d446fd1bf18c5e1c5771ef128 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 2 May 2004 10:43:46 +0000 Subject: [PATCH] `BOOLEAN' is a term already used by Win32. Bah. Change terminology. [originally from svn r4183] --- cube.c | 8 ++++---- fifteen.c | 6 +++--- gtk.c | 8 ++++---- net.c | 12 ++++++------ puzzles.h | 18 +++++++++--------- sixteen.c | 6 +++--- 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; -- 2.30.2