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

@ -361,7 +361,7 @@ visit(State_t* state, register FTSENT* ent)
error(2, "%s: cannot search directory", ent->fts_path);
fts_set(NiL, ent, FTS_SKIP);
/*FALLTHROUGH*/
/* FALLTHROUGH */
case FTS_D:
if (state->directory)
memcpy(state->path + state->postsiz, base, len);
@ -520,7 +520,7 @@ visit(State_t* state, register FTSENT* ent)
sfprintf(state->tmp, "%s.%s%d%s", state->path, state->suffix, v + 1, state->suffix);
goto backup;
}
/*FALLTHROUGH*/
/* FALLTHROUGH */
case BAK_simple:
sfprintf(state->tmp, "%s%s", state->path, state->suffix);
backup:
@ -564,7 +564,7 @@ visit(State_t* state, register FTSENT* ent)
else
break;
}
/*FALLTHROUGH*/
/* FALLTHROUGH */
case CP:
if (S_ISLNK(ent->fts_statp->st_mode))
{

View file

@ -165,7 +165,7 @@ cutinit(int mode, char* str, Delim_t* wdelim, Delim_t* ldelim, size_t reclen)
case '\t':
while(*cp==' ' || *cp=='\t')
cp++;
/*FALLTHROUGH*/
/* FALLTHROUGH */
case 0:
case ',':
if(range)

View file

@ -87,7 +87,7 @@ b_head(int argc, register char** argv, Shbltin_t* context)
{
case 'c':
delim = -1;
/*FALLTHROUGH*/
/* FALLTHROUGH */
case 'n':
if (opt_info.offset && argv[opt_info.index][opt_info.offset] == 'c')
{

View file

@ -348,7 +348,7 @@ getrec(Join_t* jp, int index, int discard)
cp = tp;
break;
}
/*FALLTHROUGH*/
/* FALLTHROUGH */
default:
goto next;
}
@ -866,7 +866,7 @@ b_join(int argc, char** argv, Shbltin_t* context)
jp->file[0].field = (int)(opt_info.num-1);
n = '2';
}
/*FALLTHROUGH*/
/* FALLTHROUGH */
case '1':
case '2':
if (opt_info.num <=0)
@ -875,7 +875,7 @@ b_join(int argc, char** argv, Shbltin_t* context)
continue;
case 'v':
jp->outmode &= ~C_COMMON;
/*FALLTHROUGH*/
/* FALLTHROUGH */
case 'a':
if (opt_info.num!=1 && opt_info.num!=2)
error(2,"%s: file number must be 1 or 2", opt_info.name);

View file

@ -198,7 +198,7 @@ rm(State_t* state, register FTSENT* ent)
}
else if (ent->fts_info == FTS_D)
break;
/*FALLTHROUGH*/
/* FALLTHROUGH */
case FTS_DP:
if (isempty(ent) || state->directory)
{
@ -223,7 +223,7 @@ rm(State_t* state, register FTSENT* ent)
fts_set(NiL, ent, FTS_AGAIN);
break;
}
/*FALLTHROUGH*/
/* FALLTHROUGH */
default:
nonempty(ent);
if (!state->force)

View file

@ -936,7 +936,7 @@ b_stty(int argc, char** argv, Shbltin_t* context)
}
continue;
}
/*FALLTHROUGH*/
/* FALLTHROUGH */
case ':':
if (!opt_info.offset)
error(2, "%s", opt_info.arg);

View file

@ -462,7 +462,7 @@ b_tail(int argc, char** argv, Shbltin_t* context)
t = opt_info.arg;
goto suffix;
}
/*FALLTHROUGH*/
/* FALLTHROUGH */
case 'n':
flags |= COUNT;
if (s = opt_info.arg)