aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Borzenkov <arvidjaar@gmail.com>2017-03-25 14:54:18 +0300
committerLasse Collin <lasse.collin@tukaani.org>2017-04-06 23:31:54 +0300
commita2db597faff76c89d0ba419e2217a90c18d94d2b (patch)
treeeb528cc40e1efccad31096da12b24d1a956f5381
parente75f4eb79165213a02d567940d344f5c2ff1be03 (diff)
downloadxz-embedded-a2db597faff76c89d0ba419e2217a90c18d94d2b.tar.gz
xzembed: add fallthrough annotations to fix build with GCC7
GCC7 is more strict than previous versions; add missing fall through annotations. Style is modeled after similar annotations in xz_dec_lzma2.c.
-rw-r--r--linux/lib/xz/xz_dec_stream.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/linux/lib/xz/xz_dec_stream.c b/linux/lib/xz/xz_dec_stream.c
index d652550..a35d317 100644
--- a/linux/lib/xz/xz_dec_stream.c
+++ b/linux/lib/xz/xz_dec_stream.c
@@ -604,6 +604,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
if (ret != XZ_OK)
return ret;
+ /* Fall through */
+
case SEQ_BLOCK_START:
/* We need one byte of input to continue. */
if (b->in_pos == b->in_size)
@@ -627,6 +629,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->temp.pos = 0;
s->sequence = SEQ_BLOCK_HEADER;
+ /* Fall through */
+
case SEQ_BLOCK_HEADER:
if (!fill_temp(s, b))
return XZ_OK;
@@ -637,6 +641,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_BLOCK_UNCOMPRESS;
+ /* Fall through */
+
case SEQ_BLOCK_UNCOMPRESS:
ret = dec_block(s, b);
if (ret != XZ_STREAM_END)
@@ -664,6 +670,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_BLOCK_CHECK;
+ /* Fall through */
+
case SEQ_BLOCK_CHECK:
if (s->check_type == XZ_CHECK_CRC32) {
ret = crc_validate(s, b, 32);
@@ -713,6 +721,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_INDEX_CRC32;
+ /* Fall through */
+
case SEQ_INDEX_CRC32:
ret = crc_validate(s, b, 32);
if (ret != XZ_STREAM_END)
@@ -721,6 +731,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->temp.size = STREAM_HEADER_SIZE;
s->sequence = SEQ_STREAM_FOOTER;
+ /* Fall through */
+
case SEQ_STREAM_FOOTER:
if (!fill_temp(s, b))
return XZ_OK;