diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2019-06-24 23:25:41 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2019-06-24 23:25:41 +0300 |
commit | 1b4675cebf7471f7cc9b7072c950e3de97147063 (patch) | |
tree | b0cf7b11e0fd86051192427ac3390372fda8d318 /src/liblzma/common/common.c | |
parent | xz: Silence a warning from clang -Wsign-conversion in main.c. (diff) | |
download | xz-1b4675cebf7471f7cc9b7072c950e3de97147063.tar.xz |
Add LZMA_RET_INTERNAL1..8 to lzma_ret and use one for LZMA_TIMED_OUT.
LZMA_TIMED_OUT is *internally* used as a value for lzma_ret
enumeration. Previously it was #defined to 32 and cast to lzma_ret.
That way it wasn't visible in the public API, but this was hackish.
Now the public API has eight LZMA_RET_INTERNALx members and
LZMA_TIMED_OUT is #defined to LZMA_RET_INTERNAL1. This way
the code is cleaner overall although the public API has a few
extra mysterious enum members.
Diffstat (limited to 'src/liblzma/common/common.c')
-rw-r--r-- | src/liblzma/common/common.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/liblzma/common/common.c b/src/liblzma/common/common.c index 39bfabc2..346fc7af 100644 --- a/src/liblzma/common/common.c +++ b/src/liblzma/common/common.c @@ -298,9 +298,7 @@ lzma_code(lzma_stream *strm, lzma_action action) strm->internal->avail_in = strm->avail_in; - // Cast is needed to silence a warning about LZMA_TIMED_OUT, which - // isn't part of lzma_ret enumeration. - switch ((unsigned int)(ret)) { + switch (ret) { case LZMA_OK: // Don't return LZMA_BUF_ERROR when it happens the first time. // This is to avoid returning LZMA_BUF_ERROR when avail_out |