提交 5a244f48 编写于 作者: L Lasse Collin 提交者: Jiri Kosina

lib/xz: Add fall-through comments to a switch statement

It's good style. I was also told that GCC 7 is more strict and might
give a warning when such comments are missing.
Signed-off-by: NLasse Collin <lasse.collin@tukaani.org>
Suggested-by: NAndrei Borzenkov <arvidjaar@gmail.com>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 ff5abbe7
...@@ -583,6 +583,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b) ...@@ -583,6 +583,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
if (ret != XZ_OK) if (ret != XZ_OK)
return ret; return ret;
/* Fall through */
case SEQ_BLOCK_START: case SEQ_BLOCK_START:
/* We need one byte of input to continue. */ /* We need one byte of input to continue. */
if (b->in_pos == b->in_size) if (b->in_pos == b->in_size)
...@@ -606,6 +608,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b) ...@@ -606,6 +608,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->temp.pos = 0; s->temp.pos = 0;
s->sequence = SEQ_BLOCK_HEADER; s->sequence = SEQ_BLOCK_HEADER;
/* Fall through */
case SEQ_BLOCK_HEADER: case SEQ_BLOCK_HEADER:
if (!fill_temp(s, b)) if (!fill_temp(s, b))
return XZ_OK; return XZ_OK;
...@@ -616,6 +620,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b) ...@@ -616,6 +620,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_BLOCK_UNCOMPRESS; s->sequence = SEQ_BLOCK_UNCOMPRESS;
/* Fall through */
case SEQ_BLOCK_UNCOMPRESS: case SEQ_BLOCK_UNCOMPRESS:
ret = dec_block(s, b); ret = dec_block(s, b);
if (ret != XZ_STREAM_END) if (ret != XZ_STREAM_END)
...@@ -623,6 +629,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b) ...@@ -623,6 +629,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_BLOCK_PADDING; s->sequence = SEQ_BLOCK_PADDING;
/* Fall through */
case SEQ_BLOCK_PADDING: case SEQ_BLOCK_PADDING:
/* /*
* Size of Compressed Data + Block Padding * Size of Compressed Data + Block Padding
...@@ -643,6 +651,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b) ...@@ -643,6 +651,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_BLOCK_CHECK; s->sequence = SEQ_BLOCK_CHECK;
/* Fall through */
case SEQ_BLOCK_CHECK: case SEQ_BLOCK_CHECK:
if (s->check_type == XZ_CHECK_CRC32) { if (s->check_type == XZ_CHECK_CRC32) {
ret = crc32_validate(s, b); ret = crc32_validate(s, b);
...@@ -665,6 +675,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b) ...@@ -665,6 +675,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_INDEX_PADDING; s->sequence = SEQ_INDEX_PADDING;
/* Fall through */
case SEQ_INDEX_PADDING: case SEQ_INDEX_PADDING:
while ((s->index.size + (b->in_pos - s->in_start)) while ((s->index.size + (b->in_pos - s->in_start))
& 3) { & 3) {
...@@ -687,6 +699,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b) ...@@ -687,6 +699,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->sequence = SEQ_INDEX_CRC32; s->sequence = SEQ_INDEX_CRC32;
/* Fall through */
case SEQ_INDEX_CRC32: case SEQ_INDEX_CRC32:
ret = crc32_validate(s, b); ret = crc32_validate(s, b);
if (ret != XZ_STREAM_END) if (ret != XZ_STREAM_END)
...@@ -695,6 +709,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b) ...@@ -695,6 +709,8 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->temp.size = STREAM_HEADER_SIZE; s->temp.size = STREAM_HEADER_SIZE;
s->sequence = SEQ_STREAM_FOOTER; s->sequence = SEQ_STREAM_FOOTER;
/* Fall through */
case SEQ_STREAM_FOOTER: case SEQ_STREAM_FOOTER:
if (!fill_temp(s, b)) if (!fill_temp(s, b))
return XZ_OK; return XZ_OK;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册