1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Fix many GCC -Wimplicit-fallthrough warnings (#243)

This commit adds '/* FALLTHROUGH */' comments to fix many
GCC warnings when compiling with -Wimplicit-fallthrough.
Additionally, the existing fallthrough comments have been
changed for consistency.
This commit is contained in:
Johnothan King 2021-03-30 13:49:20 -07:00 committed by GitHub
parent f30da49564
commit ed478ab7e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
73 changed files with 271 additions and 158 deletions

View file

@ -390,7 +390,7 @@ void sh_machere(Shell_t *shp,Sfio_t *infile, Sfio_t *outfile, char *string)
case S_EOF:
if((c=fcfill()) > 0)
goto again;
/* FALL THRU */
/* FALLTHROUGH */
default:
regular:
sfputc(outfile,'$');
@ -464,6 +464,7 @@ static void copyto(register Mac_t *mp,int endch, int newquote)
case -1: /* illegal multi-byte char */
case 0:
len = 1;
/* FALLTHROUGH */
case 1:
n = state[*(unsigned char*)cp++];
break;
@ -643,6 +644,7 @@ static void copyto(register Mac_t *mp,int endch, int newquote)
goto pattern;
continue;
}
/* FALLTHROUGH */
case S_EOF:
if(c)
{
@ -667,6 +669,7 @@ static void copyto(register Mac_t *mp,int endch, int newquote)
case S_QUOTE:
if(mp->lit || mp->arith)
break;
/* FALLTHROUGH */
case S_LIT:
if(mp->arith)
{
@ -729,6 +732,7 @@ static void copyto(register Mac_t *mp,int endch, int newquote)
cp = first = fcseek(0);
break;
}
/* FALLTHROUGH */
case S_PAT:
if(mp->pattern && !(mp->quote || mp->lit))
{
@ -1102,7 +1106,7 @@ retry1:
/* This code handles ${#} */
c = mode;
mode = type = 0;
/* FALL THRU */
/* FALLTHROUGH */
case S_SPC1:
if(type==M_BRACE)
{
@ -1129,7 +1133,7 @@ retry1:
goto retry1;
}
}
/* FALL THRU */
/* FALLTHROUGH */
case S_SPC2:
var = 0;
*id = c;