diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2023-02-18 22:04:52 +0000 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2023-02-18 22:04:52 +0000 |
| commit | d7b931824b452a6b70a599c69f4f1843f1b2daa5 (patch) | |
| tree | 55dd81c0f83606d4a70c5a5f2885b3318ad4702b | |
| parent | 5fa60c4d460e9054b9e6cb62549dd40612c0ea48 (diff) | |
| download | puzzles-d7b931824b452a6b70a599c69f4f1843f1b2daa5.zip puzzles-d7b931824b452a6b70a599c69f4f1843f1b2daa5.tar.gz puzzles-d7b931824b452a6b70a599c69f4f1843f1b2daa5.tar.bz2 puzzles-d7b931824b452a6b70a599c69f4f1843f1b2daa5.tar.xz | |
Replace a buch of "const static" with "static const"
C18 section 6.11.5 says that "const static" is obsolescent.
| -rw-r--r-- | unfinished/group.c | 2 | ||||
| -rw-r--r-- | unfinished/numgame.c | 44 |
2 files changed, 23 insertions, 23 deletions
diff --git a/unfinished/group.c b/unfinished/group.c index 2eca7c4..891c4e4 100644 --- a/unfinished/group.c +++ b/unfinished/group.c @@ -123,7 +123,7 @@ static game_params *default_params(void) return ret; } -const static struct game_params group_presets[] = { +static const struct game_params group_presets[] = { { 6, DIFF_NORMAL, true }, { 6, DIFF_NORMAL, false }, { 8, DIFF_NORMAL, true }, diff --git a/unfinished/numgame.c b/unfinished/numgame.c index b819a93..849c83e 100644 --- a/unfinished/numgame.c +++ b/unfinished/numgame.c @@ -549,47 +549,47 @@ static int perform_sqrt(int *a, int *b, int *output) return perform_exp(a, half, output); } -const static struct operation op_add = { +static const struct operation op_add = { true, "+", "+", 0, 10, 0, true, perform_add }; -const static struct operation op_sub = { +static const struct operation op_sub = { true, "-", "-", 0, 10, 2, false, perform_sub }; -const static struct operation op_mul = { +static const struct operation op_mul = { true, "*", "*", 0, 20, 0, true, perform_mul }; -const static struct operation op_div = { +static const struct operation op_div = { true, "/", "/", 0, 20, 2, false, perform_div }; -const static struct operation op_xdiv = { +static const struct operation op_xdiv = { true, "/", "/", 0, 20, 2, false, perform_exact_div }; -const static struct operation op_concat = { +static const struct operation op_concat = { false, "", "concat", OPFLAG_NEEDS_CONCAT | OPFLAG_KEEPS_CONCAT, 1000, 0, false, perform_concat }; -const static struct operation op_exp = { +static const struct operation op_exp = { true, "^", "^", 0, 30, 1, false, perform_exp }; -const static struct operation op_factorial = { +static const struct operation op_factorial = { true, "!", "!", OPFLAG_UNARY, 40, 0, false, perform_factorial }; -const static struct operation op_decimal = { +static const struct operation op_decimal = { true, ".", ".", OPFLAG_UNARY | OPFLAG_UNARYPREFIX | OPFLAG_NEEDS_CONCAT | OPFLAG_KEEPS_CONCAT, 50, 0, false, perform_decimal }; -const static struct operation op_recur = { +static const struct operation op_recur = { true, "...", "recur", OPFLAG_UNARY | OPFLAG_NEEDS_CONCAT, 45, 2, false, perform_recur }; -const static struct operation op_root = { +static const struct operation op_root = { true, "v~", "root", 0, 30, 1, false, perform_root }; -const static struct operation op_perc = { +static const struct operation op_perc = { true, "%", "%", OPFLAG_UNARY | OPFLAG_NEEDS_CONCAT, 45, 1, false, perform_perc }; -const static struct operation op_gamma = { +static const struct operation op_gamma = { true, "gamma", "gamma", OPFLAG_UNARY | OPFLAG_UNARYPREFIX | OPFLAG_FN, 1, 3, false, perform_gamma }; -const static struct operation op_sqrt = { +static const struct operation op_sqrt = { true, "v~", "sqrt", OPFLAG_UNARY | OPFLAG_UNARYPREFIX, 30, 1, false, perform_sqrt }; @@ -597,10 +597,10 @@ const static struct operation op_sqrt = { * In Countdown, divisions resulting in fractions are disallowed. * http://www.askoxford.com/wordgames/countdown/rules/ */ -const static struct operation *const ops_countdown[] = { +static const struct operation *const ops_countdown[] = { &op_add, &op_mul, &op_sub, &op_xdiv, NULL }; -const static struct rules rules_countdown = { +static const struct rules rules_countdown = { ops_countdown, false }; @@ -609,10 +609,10 @@ const static struct rules rules_countdown = { * known puzzle of making 24 using two 3s and two 8s. For this we * need rational rather than integer division. */ -const static struct operation *const ops_3388[] = { +static const struct operation *const ops_3388[] = { &op_add, &op_mul, &op_sub, &op_div, NULL }; -const static struct rules rules_3388 = { +static const struct rules rules_3388 = { ops_3388, true }; @@ -620,10 +620,10 @@ const static struct rules rules_3388 = { * A still more permissive rule set usable for the four-4s problem * and similar things. Permits concatenation. */ -const static struct operation *const ops_four4s[] = { +static const struct operation *const ops_four4s[] = { &op_add, &op_mul, &op_sub, &op_div, &op_concat, NULL }; -const static struct rules rules_four4s = { +static const struct rules rules_four4s = { ops_four4s, true }; @@ -631,11 +631,11 @@ const static struct rules rules_four4s = { * The most permissive ruleset I can think of. Permits * exponentiation, and also silly unary operators like factorials. */ -const static struct operation *const ops_anythinggoes[] = { +static const struct operation *const ops_anythinggoes[] = { &op_add, &op_mul, &op_sub, &op_div, &op_concat, &op_exp, &op_factorial, &op_decimal, &op_recur, &op_root, &op_perc, &op_gamma, &op_sqrt, NULL }; -const static struct rules rules_anythinggoes = { +static const struct rules rules_anythinggoes = { ops_anythinggoes, true }; |