`BOOLEAN' is a term already used by Win32. Bah. Change terminology.

[originally from svn r4183]
This commit is contained in:
Simon Tatham
2004-05-02 10:43:46 +00:00
parent 44ff00665b
commit ee17149822
6 changed files with 29 additions and 29 deletions

8
cube.c
View File

@ -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;

View File

@ -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;

8
gtk.c
View File

@ -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).
*/

12
net.c
View File

@ -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;
}

View File

@ -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.
*/

View File

@ -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;