liblzma: Use memzero() to initialize supported_actions[].
authorLasse Collin <lasse.collin@tukaani.org>
Mon, 11 Apr 2011 16:28:18 +0000 (19:28 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Mon, 11 Apr 2011 16:28:18 +0000 (19:28 +0300)
This is cleaner and makes it simpler to add new members
to lzma_action enumeration.

src/liblzma/common/common.c

index 0408e15..3005cca 100644 (file)
@@ -156,10 +156,8 @@ lzma_strm_init(lzma_stream *strm)
                strm->internal->next = LZMA_NEXT_CODER_INIT;
        }
 
-       strm->internal->supported_actions[LZMA_RUN] = false;
-       strm->internal->supported_actions[LZMA_SYNC_FLUSH] = false;
-       strm->internal->supported_actions[LZMA_FULL_FLUSH] = false;
-       strm->internal->supported_actions[LZMA_FINISH] = false;
+       memzero(strm->internal->supported_actions,
+                       sizeof(strm->internal->supported_actions));
        strm->internal->sequence = ISEQ_RUN;
        strm->internal->allow_buf_error = false;