diff options
Diffstat (limited to 'apps/plugins/puzzles/src/cube.c')
-rw-r--r-- | apps/plugins/puzzles/src/cube.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/apps/plugins/puzzles/src/cube.c b/apps/plugins/puzzles/src/cube.c index a30dc10b3f..2a79a81eef 100644 --- a/apps/plugins/puzzles/src/cube.c +++ b/apps/plugins/puzzles/src/cube.c | |||
@@ -238,7 +238,7 @@ static game_params *default_params(void) | |||
238 | static int game_fetch_preset(int i, char **name, game_params **params) | 238 | static int game_fetch_preset(int i, char **name, game_params **params) |
239 | { | 239 | { |
240 | game_params *ret = snew(game_params); | 240 | game_params *ret = snew(game_params); |
241 | char *str; | 241 | const char *str; |
242 | 242 | ||
243 | switch (i) { | 243 | switch (i) { |
244 | case 0: | 244 | case 0: |
@@ -489,25 +489,21 @@ static config_item *game_configure(const game_params *params) | |||
489 | 489 | ||
490 | ret[0].name = "Type of solid"; | 490 | ret[0].name = "Type of solid"; |
491 | ret[0].type = C_CHOICES; | 491 | ret[0].type = C_CHOICES; |
492 | ret[0].sval = ":Tetrahedron:Cube:Octahedron:Icosahedron"; | 492 | ret[0].u.choices.choicenames = ":Tetrahedron:Cube:Octahedron:Icosahedron"; |
493 | ret[0].ival = params->solid; | 493 | ret[0].u.choices.selected = params->solid; |
494 | 494 | ||
495 | ret[1].name = "Width / top"; | 495 | ret[1].name = "Width / top"; |
496 | ret[1].type = C_STRING; | 496 | ret[1].type = C_STRING; |
497 | sprintf(buf, "%d", params->d1); | 497 | sprintf(buf, "%d", params->d1); |
498 | ret[1].sval = dupstr(buf); | 498 | ret[1].u.string.sval = dupstr(buf); |
499 | ret[1].ival = 0; | ||
500 | 499 | ||
501 | ret[2].name = "Height / bottom"; | 500 | ret[2].name = "Height / bottom"; |
502 | ret[2].type = C_STRING; | 501 | ret[2].type = C_STRING; |
503 | sprintf(buf, "%d", params->d2); | 502 | sprintf(buf, "%d", params->d2); |
504 | ret[2].sval = dupstr(buf); | 503 | ret[2].u.string.sval = dupstr(buf); |
505 | ret[2].ival = 0; | ||
506 | 504 | ||
507 | ret[3].name = NULL; | 505 | ret[3].name = NULL; |
508 | ret[3].type = C_END; | 506 | ret[3].type = C_END; |
509 | ret[3].sval = NULL; | ||
510 | ret[3].ival = 0; | ||
511 | 507 | ||
512 | return ret; | 508 | return ret; |
513 | } | 509 | } |
@@ -516,9 +512,9 @@ static game_params *custom_params(const config_item *cfg) | |||
516 | { | 512 | { |
517 | game_params *ret = snew(game_params); | 513 | game_params *ret = snew(game_params); |
518 | 514 | ||
519 | ret->solid = cfg[0].ival; | 515 | ret->solid = cfg[0].u.choices.selected; |
520 | ret->d1 = atoi(cfg[1].sval); | 516 | ret->d1 = atoi(cfg[1].u.string.sval); |
521 | ret->d2 = atoi(cfg[2].sval); | 517 | ret->d2 = atoi(cfg[2].u.string.sval); |
522 | 518 | ||
523 | return ret; | 519 | return ret; |
524 | } | 520 | } |
@@ -538,7 +534,7 @@ static void count_grid_square_callback(void *ctx, struct grid_square *sq) | |||
538 | classes[thisclass]++; | 534 | classes[thisclass]++; |
539 | } | 535 | } |
540 | 536 | ||
541 | static char *validate_params(const game_params *params, int full) | 537 | static const char *validate_params(const game_params *params, int full) |
542 | { | 538 | { |
543 | int classes[5]; | 539 | int classes[5]; |
544 | int i; | 540 | int i; |
@@ -846,7 +842,7 @@ static struct solid *transform_poly(const struct solid *solid, int flip, | |||
846 | return ret; | 842 | return ret; |
847 | } | 843 | } |
848 | 844 | ||
849 | static char *validate_desc(const game_params *params, const char *desc) | 845 | static const char *validate_desc(const game_params *params, const char *desc) |
850 | { | 846 | { |
851 | int area = grid_area(params->d1, params->d2, solids[params->solid]->order); | 847 | int area = grid_area(params->d1, params->d2, solids[params->solid]->order); |
852 | int i, j; | 848 | int i, j; |
@@ -1004,7 +1000,7 @@ static void free_game(game_state *state) | |||
1004 | } | 1000 | } |
1005 | 1001 | ||
1006 | static char *solve_game(const game_state *state, const game_state *currstate, | 1002 | static char *solve_game(const game_state *state, const game_state *currstate, |
1007 | const char *aux, char **error) | 1003 | const char *aux, const char **error) |
1008 | { | 1004 | { |
1009 | return NULL; | 1005 | return NULL; |
1010 | } | 1006 | } |