mirror of
https://github.com/ccxvii/mujs.git
synced 2026-02-05 17:29:43 +08:00
Fix gcc compiler warnings about switch fallthroughs.
This commit is contained in:
committed by
Tor Andersson
parent
d4655ae888
commit
7448a82448
@@ -538,7 +538,7 @@ static void ccall(JF, js_Ast *fun, js_Ast *args)
|
||||
ceval(J, F, fun, args);
|
||||
return;
|
||||
}
|
||||
/* fall through */
|
||||
/* fallthrough */
|
||||
default:
|
||||
cexp(J, F, fun);
|
||||
emit(J, F, OP_UNDEF);
|
||||
|
||||
@@ -426,7 +426,8 @@ loop:
|
||||
while (*r) {
|
||||
if (*r == '$') {
|
||||
switch (*(++r)) {
|
||||
case 0: --r; /* end of string; back up and fall through */
|
||||
case 0: --r; /* end of string; back up */
|
||||
/* fallthrough */
|
||||
case '$': js_putc(J, &sb, '$'); break;
|
||||
case '`': js_putm(J, &sb, source, s); break;
|
||||
case '\'': js_puts(J, &sb, s + n); break;
|
||||
@@ -522,7 +523,8 @@ static void Sp_replace_string(js_State *J)
|
||||
while (*r) {
|
||||
if (*r == '$') {
|
||||
switch (*(++r)) {
|
||||
case 0: --r; /* end of string; back up and fall through */
|
||||
case 0: --r; /* end of string; back up */
|
||||
/* fallthrough */
|
||||
case '$': js_putc(J, &sb, '$'); break;
|
||||
case '&': js_putm(J, &sb, s, s + n); break;
|
||||
case '`': js_putm(J, &sb, source, s); break;
|
||||
|
||||
2
regexp.c
2
regexp.c
@@ -110,7 +110,7 @@ static int nextrune(struct cstate *g)
|
||||
if (g->yychar == '\\') {
|
||||
g->source += chartorune(&g->yychar, g->source);
|
||||
switch (g->yychar) {
|
||||
case 0: die(g, "unterminated escape sequence");
|
||||
case 0: die(g, "unterminated escape sequence"); break;
|
||||
case 'f': g->yychar = '\f'; return 0;
|
||||
case 'n': g->yychar = '\n'; return 0;
|
||||
case 'r': g->yychar = '\r'; return 0;
|
||||
|
||||
Reference in New Issue
Block a user