aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-09-04 19:43:55 +0200
committerDavid Robillard <d@drobilla.net>2018-09-04 21:16:18 +0200
commitd3e4e496a19a266ffac7c04fb7d54926e39f55a2 (patch)
treec3e2d5b9d64a678a7792c7c2be73ab4737b31576
parent3267bb312f50746202226d29cc196bb47941e4d5 (diff)
downloadserd-d3e4e496a19a266ffac7c04fb7d54926e39f55a2.tar.gz
serd-d3e4e496a19a266ffac7c04fb7d54926e39f55a2.tar.bz2
serd-d3e4e496a19a266ffac7c04fb7d54926e39f55a2.zip
Fix fallthrough warnings with GCC8
-rw-r--r--src/n3.c3
-rw-r--r--src/string.c11
-rw-r--r--src/uri.c3
3 files changed, 13 insertions, 4 deletions
diff --git a/src/n3.c b/src/n3.c
index bb8d4d9d..0a3e1fd3 100644
--- a/src/n3.c
+++ b/src/n3.c
@@ -105,14 +105,17 @@ read_UCHAR(SerdReader* reader, Ref dest, uint32_t* char_code)
buf[3] = 0x80 | (uint8_t)(c & 0x3F);
c >>= 6;
c |= (16 << 12); // set bit 4
+ // fallthru
case 3:
buf[2] = 0x80 | (uint8_t)(c & 0x3F);
c >>= 6;
c |= (32 << 6); // set bit 5
+ // fallthru
case 2:
buf[1] = 0x80 | (uint8_t)(c & 0x3F);
c >>= 6;
c |= 0xC0; // set bits 6 and 7
+ // fallthru
case 1:
buf[0] = (uint8_t)c;
}
diff --git a/src/string.c b/src/string.c
index 2f79f496..cde82134 100644
--- a/src/string.c
+++ b/src/string.c
@@ -103,9 +103,14 @@ read_sign(const char** sptr)
{
double sign = 1.0;
switch (**sptr) {
- case '-': sign = -1.0;
- case '+': ++(*sptr);
- default: return sign;
+ case '-':
+ sign = -1.0;
+ // fallthru
+ case '+':
+ ++(*sptr);
+ // fallthru
+ default:
+ return sign;
}
}
diff --git a/src/uri.c b/src/uri.c
index 0f0b3ca6..6ec6f1c7 100644
--- a/src/uri.c
+++ b/src/uri.c
@@ -278,7 +278,8 @@ remove_dot_segments(const uint8_t* path, size_t len, size_t* up)
}
break;
case '\0':
- ++begin; // Chop input "." (and fall-through)
+ ++begin; // Chop input "."
+ // fallthru
default:
return begin;
}