Skip to content

Commit

Permalink
Fix new fallthrough warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao committed May 29, 2017
1 parent 67b9b3e commit 1c5cfb0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,13 @@ value_t fl_invoke_julia_macro(fl_context_t *fl_ctx, value_t *args, uint32_t narg
if (jl_is_expr(lno) && ((jl_expr_t*)lno)->head == line_sym) {
jl_value_t *file = jl_nothing;
jl_value_t *line = NULL;
switch (jl_expr_nargs(lno)) { // fall-through is intentional
switch (jl_expr_nargs(lno)) {
case 2:
file = jl_exprarg(lno, 1); // file
JL_FALLTHROUGH;
case 1:
line = jl_exprarg(lno, 0); // line
JL_FALLTHROUGH;
default: ;
}
if (line == NULL)
Expand Down
4 changes: 3 additions & 1 deletion src/method.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,13 @@ static void jl_method_set_source(jl_method_t *m, jl_code_info_t *src)
}
else if (jl_is_expr(st) && ((jl_expr_t*)st)->head == line_sym) {
if (!set_lineno) {
switch (jl_expr_nargs(st)) { // fall-through is intentional
switch (jl_expr_nargs(st)) {
case 2:
m->file = (jl_sym_t*)jl_exprarg(st, 1);
JL_FALLTHROUGH;
case 1:
m->line = jl_unbox_long(jl_exprarg(st, 0));
JL_FALLTHROUGH;
default: ;
}
st = jl_nothing;
Expand Down

0 comments on commit 1c5cfb0

Please sign in to comment.