Skip to content

Commit 892114a

Browse files
committed
thecl: fix warnings (fallthrough and unused parameter)
1 parent ba93295 commit 892114a

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

thecl/ecsparse.y

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,6 +1467,7 @@ Address:
14671467
switch (type) {
14681468
case 'z':
14691469
$$->is_inline_string = true;
1470+
/* fallthrough */
14701471
case 'S':
14711472
$$->value.val.S = var_stack(state, state->current_sub, $1, 'S');
14721473
break;

thecl/expr.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -188,20 +188,21 @@ expr_get_by_symbol(
188188
switch (engine_version(version)) {
189189
default:
190190
case VER_POST_TH13:
191-
ret = expr_get_by_symbol_from_table(th13_expressions, symbol);
192-
if (ret) break;
191+
if ((ret = expr_get_by_symbol_from_table(th13_expressions, symbol))) break;
192+
/* fallthrough */
193193
case VER_POST_TH125:
194-
ret = expr_get_by_symbol_from_table(th125_expressions, symbol);
195-
if (ret) break;
194+
if ((ret = expr_get_by_symbol_from_table(th125_expressions, symbol))) break;
195+
/* fallthrough */
196196
case VER_POST_ALCOSTG:
197-
ret = expr_get_by_symbol_from_table(alcostg_expressions, symbol);
198-
if (ret) break;
197+
if ((ret = expr_get_by_symbol_from_table(alcostg_expressions, symbol))) break;
198+
/* fallthrough */
199199
case VER_POST_TH10:
200200
ret = expr_get_by_symbol_from_table(th10_expressions, symbol);
201201
break;
202202
case VER_PRE_TH10:
203203
case VER_PRE_TH8:
204204
ret = expr_get_by_symbol_from_table(th06_expressions, symbol);
205+
break;
205206
}
206207

207208
return ret;
@@ -231,20 +232,21 @@ expr_get_by_id(
231232
switch (engine_version(version)) {
232233
default:
233234
case VER_POST_TH13:
234-
ret = expr_get_by_id_from_table(th13_expressions, id);
235-
if (ret) break;
235+
if ((ret = expr_get_by_id_from_table(th13_expressions, id))) break;
236+
/* fallthrough */
236237
case VER_POST_TH125:
237-
ret = expr_get_by_id_from_table(th125_expressions, id);
238-
if (ret) break;
238+
if ((ret = expr_get_by_id_from_table(th125_expressions, id))) break;
239+
/* fallthrough */
239240
case VER_POST_ALCOSTG:
240-
ret = expr_get_by_id_from_table(alcostg_expressions, id);
241-
if (ret) break;
241+
if ((ret = expr_get_by_id_from_table(alcostg_expressions, id))) break;
242+
/* fallthrough */
242243
case VER_POST_TH10:
243244
ret = expr_get_by_id_from_table(th10_expressions, id);
244245
break;
245246
case VER_PRE_TH10:
246247
case VER_PRE_TH8:
247248
ret = expr_get_by_id_from_table(th06_expressions, id);
249+
break;
248250
}
249251

250252
return ret;

thecl/thecl06.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ th06_stringify_param(
234234
val = (int)floorf(param->value.val.f);
235235
break;
236236
}
237-
237+
238238
seqmap_entry_t * ent = seqmap_get(g_eclmap->gvar_names, val);
239239
if (ent) {
240240
snprintf(temp, 256, "%c%s", param->value.type == 'f' ? '%' : '$', ent->value);
@@ -1424,6 +1424,7 @@ th06_timeline_instr_size(
14241424
ret += utf8_to_cp932_len(param->value.val.z);
14251425
break;
14261426
}
1427+
/* fallthrough */
14271428
default: {
14281429
value_t v = param->value;
14291430
v.type = param->type;
@@ -1570,6 +1571,7 @@ th06_serialize_data(
15701571
size_t data_size,
15711572
bool is_timeline)
15721573
{
1574+
(void)instr; // FIXME: maybe remove this unused parameter?
15731575
value_t v;
15741576
switch (param->type) {
15751577
case 'n':

thecl/thecl10.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2082,6 +2082,7 @@ th10_instr_size(
20822082
// filled in with values once the sub is inlined.
20832083
return 0;
20842084
}
2085+
/* fallthrough */
20852086
default:
20862087
ret += value_size(&param->value);
20872088
break;

0 commit comments

Comments
 (0)