Fix -Werror=implicit-fallthrough on gcc7

This commit is contained in:
Julien Lecoeur 2017-06-28 16:06:06 +02:00
parent 4db21f4d7e
commit f26e83d0a1
6 changed files with 16 additions and 4 deletions

View File

@ -99,7 +99,7 @@ off_t file_seek(FAR struct file *filep, off_t offset, int whence)
{ {
case SEEK_CUR: case SEEK_CUR:
offset += filep->f_pos; offset += filep->f_pos;
/* FALLTHROUGH */
case SEEK_SET: case SEEK_SET:
if (offset >= 0) if (offset >= 0)
{ {

View File

@ -1193,7 +1193,7 @@ char *__dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve)
case 2: case 2:
leftright = 0; leftright = 0;
/* no break */ /* FALLTHROUGH */
case 4: case 4:
if (ndigits <= 0) if (ndigits <= 0)
{ {
@ -1205,8 +1205,7 @@ char *__dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve)
case 3: case 3:
leftright = 0; leftright = 0;
/* no break */ /* FALLTHROUGH */
case 5: case 5:
i = ndigits + k + 1; i = ndigits + k + 1;
ilim = i; ilim = i;

View File

@ -646,6 +646,7 @@ int vsscanf(FAR const char *buf, FAR const char *fmt, va_list ap)
default: default:
case 'd': case 'd':
sign = true; sign = true;
/* FALLTHROUGH */
case 'u': case 'u':
base = 10; base = 10;
break; break;

View File

@ -113,8 +113,10 @@ double strtod(FAR const char *str, FAR char **endptr)
{ {
case '-': case '-':
negative = 1; /* Fall through to increment position */ negative = 1; /* Fall through to increment position */
/* FALLTHROUGH */
case '+': case '+':
p++; p++;
/* FALLTHROUGH */
default: default:
break; break;
} }
@ -175,8 +177,10 @@ double strtod(FAR const char *str, FAR char **endptr)
{ {
case '-': case '-':
negative = 1; /* Fall through to increment pos */ negative = 1; /* Fall through to increment pos */
/* FALLTHROUGH */
case '+': case '+':
p++; p++;
/* FALLTHROUGH */
default: default:
break; break;
} }

View File

@ -115,8 +115,10 @@ float strtof(FAR const char *str, FAR char **endptr)
{ {
case '-': case '-':
negative = 1; /* Fall through to increment position */ negative = 1; /* Fall through to increment position */
/* FALLTHROUGH */
case '+': case '+':
p++; p++;
/* FALLTHROUGH */
default: default:
break; break;
} }
@ -177,8 +179,10 @@ float strtof(FAR const char *str, FAR char **endptr)
{ {
case '-': case '-':
negative = 1; /* Fall through to increment pos */ negative = 1; /* Fall through to increment pos */
/* FALLTHROUGH */
case '+': case '+':
p++; p++;
/* FALLTHROUGH */
default: default:
break; break;
} }

View File

@ -113,8 +113,10 @@ long double strtold(FAR const char *str, FAR char **endptr)
{ {
case '-': case '-':
negative = 1; /* Fall through to increment position */ negative = 1; /* Fall through to increment position */
/* FALLTHROUGH */
case '+': case '+':
p++; p++;
/* FALLTHROUGH */
default: default:
break; break;
} }
@ -175,8 +177,10 @@ long double strtold(FAR const char *str, FAR char **endptr)
{ {
case '-': case '-':
negative = 1; /* Fall through to increment pos */ negative = 1; /* Fall through to increment pos */
/* FALLTHROUGH */
case '+': case '+':
p++; p++;
/* FALLTHROUGH */
default: default:
break; break;
} }