ref: 7448a82448aa4eff952a4fdb836f197b844e3d1d
parent: d4655ae8882ef601b06d3f6f0e35bc38ebeea763
author: Sebastian Rasmussen <sebras@gmail.com>
date: Mon Sep 3 19:26:46 EDT 2018
Fix gcc compiler warnings about switch fallthroughs.
--- a/jscompile.c
+++ b/jscompile.c
@@ -538,7 +538,7 @@
ceval(J, F, fun, args);
return;
}
- /* fall through */
+ /* fallthrough */
default:
cexp(J, F, fun);
emit(J, F, OP_UNDEF);
--- a/jsstring.c
+++ b/jsstring.c
@@ -426,7 +426,8 @@
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 @@
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;
--- a/regexp.c
+++ b/regexp.c
@@ -110,7 +110,7 @@
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;