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

@ -217,7 +217,7 @@ word2posix(register char* f, register char* w, int alternate)
{
case 1:
p = '-';
/*FALLTHROUGH*/
/* FALLTHROUGH */
case 2:
c = 'd';
break;
@ -234,7 +234,7 @@ word2posix(register char* f, register char* w, int alternate)
{
case 1:
p = '-';
/*FALLTHROUGH*/
/* FALLTHROUGH */
default:
c = 'I';
break;
@ -245,7 +245,7 @@ word2posix(register char* f, register char* w, int alternate)
{
case 1:
p = '-';
/*FALLTHROUGH*/
/* FALLTHROUGH */
default:
c = 'H';
break;
@ -256,7 +256,7 @@ word2posix(register char* f, register char* w, int alternate)
{
case 1:
p = '-';
/*FALLTHROUGH*/
/* FALLTHROUGH */
case 2:
c = 'm';
break;
@ -273,7 +273,7 @@ word2posix(register char* f, register char* w, int alternate)
{
case 1:
p = '-';
/*FALLTHROUGH*/
/* FALLTHROUGH */
default:
c = 'M';
break;
@ -284,7 +284,7 @@ word2posix(register char* f, register char* w, int alternate)
{
case 1:
p = '-';
/*FALLTHROUGH*/
/* FALLTHROUGH */
default:
c = 'S';
break;
@ -295,7 +295,7 @@ word2posix(register char* f, register char* w, int alternate)
{
case 1:
p = '-';
/*FALLTHROUGH*/
/* FALLTHROUGH */
case 2:
c = 'y';
break;

View file

@ -325,7 +325,7 @@ tmxdate(register const char* s, char** e, Time_t now)
case 'm':
if (!m)
m = 1;
/*FALLTHROUGH*/
/* FALLTHROUGH */
case 'M':
switch (*(s + 1))
{
@ -403,7 +403,7 @@ tmxdate(register const char* s, char** e, Time_t now)
case 'S':
case 's':
m = 2;
/*FALLTHROUGH*/
/* FALLTHROUGH */
case ' ':
case '_':
case '\n':
@ -1243,7 +1243,7 @@ tmxdate(register const char* s, char** e, Time_t now)
set |= state & (EXACT|LAST|NEXT|THIS);
continue;
}
/*FALLTHROUGH*/
/* FALLTHROUGH */
case TM_FINAL:
state |= HOLD|THIS|FINAL;
set &= ~(EXACT|LAST|NEXT|THIS);
@ -1264,7 +1264,7 @@ tmxdate(register const char* s, char** e, Time_t now)
case TM_ORDINAL:
j += TM_ORDINALS - TM_ORDINAL;
message((-1, "AHA#%d j=%d", __LINE__, j));
/*FALLTHROUGH*/
/* FALLTHROUGH */
case TM_ORDINALS:
n = j - TM_ORDINALS + 1;
message((-1, "AHA#%d n=%d", __LINE__, n));
@ -1300,7 +1300,7 @@ tmxdate(register const char* s, char** e, Time_t now)
continue;
case TM_DAY_ABBREV:
j += TM_DAY - TM_DAY_ABBREV;
/*FALLTHROUGH*/
/* FALLTHROUGH */
case TM_DAY:
case TM_PARTS:
case TM_HOURS:
@ -1330,7 +1330,7 @@ tmxdate(register const char* s, char** e, Time_t now)
set &= ~(EXACT|LAST|NEXT|THIS);
set |= state & (EXACT|LAST|NEXT|THIS);
}
/*FALLTHROUGH*/
/* FALLTHROUGH */
case TM_DAYS:
message((-1, "AHA#%d n=%d j=%d f=%d state=" FFMT, __LINE__, n, j, f, FLAGS(state)));
if (n == -1)
@ -1494,7 +1494,7 @@ tmxdate(register const char* s, char** e, Time_t now)
continue;
case TM_MONTH_ABBREV:
j += TM_MONTH - TM_MONTH_ABBREV;
/*FALLTHROUGH*/
/* FALLTHROUGH */
case TM_MONTH:
if (state & MONTH)
goto done;

View file

@ -177,7 +177,7 @@ tmxfmt(char* buf, size_t len, const char* format, Time_t t)
pad = c;
continue;
}
/*FALLTHROUGH*/
/* FALLTHROUGH */
case '1':
case '2':
case '3':
@ -191,7 +191,7 @@ tmxfmt(char* buf, size_t len, const char* format, Time_t t)
{
case 0:
parts++;
/*FALLTHROUGH*/
/* FALLTHROUGH */
case 1:
width = width * 10 + (c - '0');
break;

View file

@ -253,7 +253,7 @@ scan(register const char* s, char** e, const char* format, char** f, Time_t t, l
case 'd':
if (pedantic && !isdigit(*s))
goto next;
/*FALLTHROUGH*/
/* FALLTHROUGH */
case 'e':
NUMBER(2, 1, 31);
set.mday = n;
@ -301,7 +301,7 @@ scan(register const char* s, char** e, const char* format, char** f, Time_t t, l
s++;
continue;
}
/*FALLTHROUGH*/
/* FALLTHROUGH */
case 't':
while (isspace(*s))
s++;
@ -384,6 +384,7 @@ scan(register const char* s, char** e, const char* format, char** f, Time_t t, l
u = 0;
if (d == 'q')
continue;
/* FALLTHROUGH */
case 'z':
if ((zp = tmzone(s, &u, u, &m)))
{

View file

@ -92,10 +92,10 @@ tmzone(register const char* name, char** end, const char* type, int* dst)
{
case 'C':
d += 15;
/*FALLTHROUGH*/
/* FALLTHROUGH */
case 'B':
d += 15;
/*FALLTHROUGH*/
/* FALLTHROUGH */
case 'A':
d += 15;
e++;