Skip to content

Commit

Permalink
xz: add fallthrough annotations to silence GCC7 warning
Browse files Browse the repository at this point in the history
The fallthrough is intentional (or at least appears to be), and
I'd rather not have warnings show up in the skiboot build at all.

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
stewartsmith committed Jul 12, 2017
1 parent 0751c40 commit 63db51d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions libxz/xz_dec_lzma2.c
Expand Up @@ -1042,7 +1042,7 @@ XZ_EXTERN enum xz_ret xz_dec_lzma2_run(struct xz_dec_lzma2 *s,
return XZ_DATA_ERROR;

s->lzma2.sequence = SEQ_LZMA_PREPARE;

/* fallthrough */
case SEQ_LZMA_PREPARE:
if (s->lzma2.compressed < RC_INIT_BYTES)
return XZ_DATA_ERROR;
Expand All @@ -1052,7 +1052,7 @@ XZ_EXTERN enum xz_ret xz_dec_lzma2_run(struct xz_dec_lzma2 *s,

s->lzma2.compressed -= RC_INIT_BYTES;
s->lzma2.sequence = SEQ_LZMA_RUN;

/* fallthrough */
case SEQ_LZMA_RUN:
/*
* Set dictionary limit to indicate how much we want
Expand Down
12 changes: 6 additions & 6 deletions libxz/xz_dec_stream.c
Expand Up @@ -603,7 +603,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
ret = dec_stream_header(s);
if (ret != XZ_OK)
return ret;

/* fallthrough */
case SEQ_BLOCK_START:
/* We need one byte of input to continue. */
if (b->in_pos == b->in_size)
Expand All @@ -626,7 +626,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
s->temp.size = s->block_header.size;
s->temp.pos = 0;
s->sequence = SEQ_BLOCK_HEADER;

/* fallthrough */
case SEQ_BLOCK_HEADER:
if (!fill_temp(s, b))
return XZ_OK;
Expand All @@ -636,7 +636,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
return ret;

s->sequence = SEQ_BLOCK_UNCOMPRESS;

/* fallthrough */
case SEQ_BLOCK_UNCOMPRESS:
ret = dec_block(s, b);
if (ret != XZ_STREAM_END)
Expand All @@ -663,7 +663,7 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
}

s->sequence = SEQ_BLOCK_CHECK;

/* fallthrough */
case SEQ_BLOCK_CHECK:
if (s->check_type == XZ_CHECK_CRC32) {
ret = crc_validate(s, b, 32);
Expand Down Expand Up @@ -712,15 +712,15 @@ static enum xz_ret dec_main(struct xz_dec *s, struct xz_buf *b)
return XZ_DATA_ERROR;

s->sequence = SEQ_INDEX_CRC32;

/* fallthrough */
case SEQ_INDEX_CRC32:
ret = crc_validate(s, b, 32);
if (ret != XZ_STREAM_END)
return ret;

s->temp.size = STREAM_HEADER_SIZE;
s->sequence = SEQ_STREAM_FOOTER;

/* fallthrough */
case SEQ_STREAM_FOOTER:
if (!fill_temp(s, b))
return XZ_OK;
Expand Down

0 comments on commit 63db51d

Please sign in to comment.