summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2017-07-01 09:13:45 +0300
committerDan McDonald <danmcd@joyent.com>2018-05-30 10:28:48 -0400
commit5c16836ed07979c9ee681cb8eff401a0caacbc7e (patch)
tree99a3d7ebb520ee3eb11a3ec4c6d796b75b95757d
parente5d18d1ceadd308280e89216cc186d7aa8058459 (diff)
downloadillumos-joyent-5c16836ed07979c9ee681cb8eff401a0caacbc7e.tar.gz
9145 libast: this statement may fall through
Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk> Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/lib/libast/common/misc/glob.c1
-rw-r--r--usr/src/lib/libast/common/misc/magic.c3
-rw-r--r--usr/src/lib/libast/common/sfio/_sfputl.c7
-rw-r--r--usr/src/lib/libast/common/sfio/_sfputm.c7
-rw-r--r--usr/src/lib/libast/common/sfio/_sfputu.c7
-rw-r--r--usr/src/lib/libast/common/sfio/sfhdr.h22
-rw-r--r--usr/src/lib/libast/common/sfio/sftable.c2
-rw-r--r--usr/src/lib/libast/common/sfio/sfvprintf.c5
-rw-r--r--usr/src/lib/libast/common/tm/tmxscan.c1
9 files changed, 34 insertions, 21 deletions
diff --git a/usr/src/lib/libast/common/misc/glob.c b/usr/src/lib/libast/common/misc/glob.c
index a0fb74c0a5..1a7a8bbe20 100644
--- a/usr/src/lib/libast/common/misc/glob.c
+++ b/usr/src/lib/libast/common/misc/glob.c
@@ -374,6 +374,7 @@ again:
case '(':
if (!(gp->gl_flags & GLOB_AUGMENTED))
continue;
+ /* FALLTHROUGH */
case '*':
case '?':
meta = MATCH_META;
diff --git a/usr/src/lib/libast/common/misc/magic.c b/usr/src/lib/libast/common/misc/magic.c
index 9a0345b00d..d451db78e2 100644
--- a/usr/src/lib/libast/common/misc/magic.c
+++ b/usr/src/lib/libast/common/misc/magic.c
@@ -1424,13 +1424,16 @@ cklang(register Magic_t* mp, const char* file, char* buf, struct stat* st)
case 4:
if (b < e && (*b++ & 0xc0) != 0x80)
break;
+ /* FALLTHROUGH */
case 3:
if (b < e && (*b++ & 0xc0) != 0x80)
break;
+ /* FALLTHROUGH */
case 2:
if (b < e && (*b++ & 0xc0) != 0x80)
break;
n = 1;
+ /* FALLTHROUGH */
case 0:
if (b >= e)
{
diff --git a/usr/src/lib/libast/common/sfio/_sfputl.c b/usr/src/lib/libast/common/sfio/_sfputl.c
index 597944fbd4..98ba7209e8 100644
--- a/usr/src/lib/libast/common/sfio/_sfputl.c
+++ b/usr/src/lib/libast/common/sfio/_sfputl.c
@@ -66,12 +66,19 @@ Sflong_t v; /* the value to be written */
{ switch(n)
{
case 8 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 7 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 6 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 5 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 4 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 3 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 2 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 1 : *ps++ = *s++;
}
f->next = ps;
diff --git a/usr/src/lib/libast/common/sfio/_sfputm.c b/usr/src/lib/libast/common/sfio/_sfputm.c
index 37ecc4dfaa..b238ea3229 100644
--- a/usr/src/lib/libast/common/sfio/_sfputm.c
+++ b/usr/src/lib/libast/common/sfio/_sfputm.c
@@ -62,12 +62,19 @@ Sfulong_t m; /* the max value of the range */
{ switch(n)
{
case 8 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 7 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 6 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 5 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 4 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 3 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 2 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 1 : *ps++ = *s++;
}
f->next = ps;
diff --git a/usr/src/lib/libast/common/sfio/_sfputu.c b/usr/src/lib/libast/common/sfio/_sfputu.c
index 6afa21ca88..b3d448d46c 100644
--- a/usr/src/lib/libast/common/sfio/_sfputu.c
+++ b/usr/src/lib/libast/common/sfio/_sfputu.c
@@ -59,12 +59,19 @@ Sfulong_t v; /* the unsigned value to be written */
{ switch(n)
{
case 8 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 7 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 6 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 5 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 4 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 3 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 2 : *ps++ = *s++;
+ /* FALLTHROUGH */
case 1 : *ps++ = *s++;
}
f->next = ps;
diff --git a/usr/src/lib/libast/common/sfio/sfhdr.h b/usr/src/lib/libast/common/sfio/sfhdr.h
index 0547ee54ec..5350181e72 100644
--- a/usr/src/lib/libast/common/sfio/sfhdr.h
+++ b/usr/src/lib/libast/common/sfio/sfhdr.h
@@ -1132,27 +1132,9 @@ typedef struct _sftab_
/* note that MEMCPY advances the associated pointers */
#define MEMCPY(to,fr,n) \
- switch(n) \
- { default : memcpy((Void_t*)to,(Void_t*)fr,n); to += n; fr += n; break; \
- case 7 : *to++ = *fr++; \
- case 6 : *to++ = *fr++; \
- case 5 : *to++ = *fr++; \
- case 4 : *to++ = *fr++; \
- case 3 : *to++ = *fr++; \
- case 2 : *to++ = *fr++; \
- case 1 : *to++ = *fr++; \
- }
+ { memcpy((Void_t*)to,(Void_t*)fr,n); to += n; fr += n; }
#define MEMSET(s,c,n) \
- switch(n) \
- { default : memset((Void_t*)s,(int)c,n); s += n; break; \
- case 7 : *s++ = c; \
- case 6 : *s++ = c; \
- case 5 : *s++ = c; \
- case 4 : *s++ = c; \
- case 3 : *s++ = c; \
- case 2 : *s++ = c; \
- case 1 : *s++ = c; \
- }
+ { memset((Void_t*)s,(int)c,n); s += n; }
_BEGIN_EXTERNS_
diff --git a/usr/src/lib/libast/common/sfio/sftable.c b/usr/src/lib/libast/common/sfio/sftable.c
index df4760602e..c872f34709 100644
--- a/usr/src/lib/libast/common/sfio/sftable.c
+++ b/usr/src/lib/libast/common/sfio/sftable.c
@@ -181,7 +181,7 @@ int type; /* >0: scanf, =0: printf, -1: internal */
else if(*form != '*')
goto loop_flags;
else form += 1; /* drop thru below */
-
+ /* FALLTHROUGH */
case '*' :
form = sffmtint(form,&n);
if(*form == '$' )
diff --git a/usr/src/lib/libast/common/sfio/sfvprintf.c b/usr/src/lib/libast/common/sfio/sfvprintf.c
index 4a17020776..b66f01457b 100644
--- a/usr/src/lib/libast/common/sfio/sfvprintf.c
+++ b/usr/src/lib/libast/common/sfio/sfvprintf.c
@@ -363,6 +363,7 @@ loop_fmt :
goto loop_flags;
do_star:
form += 1; /* fall thru for '*' */
+ /* FALLTHROUGH */
case '*' :
form = (*_Sffmtintf)(form,&n);
if(*form == '$')
@@ -668,6 +669,7 @@ loop_fmt :
case 'S':
flags = (flags & ~(SFFMT_TYPES|SFFMT_LDOUBLE)) | SFFMT_LONG;
+ /* FALLTHROUGH */
case 's':
#if _has_multibyte && defined(mbwidth)
wc = (flags & SFFMT_LDOUBLE) && mbwide();
@@ -788,6 +790,7 @@ loop_fmt :
case 'C':
flags = (flags & ~(SFFMT_TYPES|SFFMT_LDOUBLE)) | SFFMT_LONG;
+ /* FALLTHROUGH */
case 'c':
#if _has_multibyte && defined(mbwidth)
wc = (flags & SFFMT_LDOUBLE) && mbwide();
@@ -914,6 +917,7 @@ loop_fmt :
goto int_arg;
case 'X':
ssp = "0123456789ABCDEF";
+ /* FALLTHROUGH */
case 'x':
base = 16; n_s = 15; n = 4;
flags &= ~(SFFMT_SIGN|SFFMT_BLANK);
@@ -929,6 +933,7 @@ loop_fmt :
goto d_format;
case 'u':
flags &= ~(SFFMT_SIGN|SFFMT_BLANK);
+ /* FALLTHROUGH */
case 'd':
d_format:
#if _PACKAGE_ast
diff --git a/usr/src/lib/libast/common/tm/tmxscan.c b/usr/src/lib/libast/common/tm/tmxscan.c
index 43ddbd026b..86b0d83c69 100644
--- a/usr/src/lib/libast/common/tm/tmxscan.c
+++ b/usr/src/lib/libast/common/tm/tmxscan.c
@@ -380,6 +380,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)))
{