Fixed compiler warnings and fixed erase unit test.

This commit is contained in:
Nathan Moinvaziri 2018-11-23 10:30:04 -08:00
parent ba1db16a28
commit b4d88d426b
6 changed files with 18 additions and 4 deletions

View File

@ -683,8 +683,7 @@ if(BUILD_UNIT_TEST)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
endif()
add_test(NAME ${COMPRESS_METHOD_NAME}-erase-${EXTRA_NAME}
COMMAND minizip ${COMPRESS_METHOD_ARG} -o -e
result.zip test.c test.h
COMMAND minizip -o -e result.zip test.c test.h
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
if(NOT COMPRESS_ONLY)
add_test(NAME ${COMPRESS_METHOD_NAME}-erase-unzip-${EXTRA_NAME}

View File

@ -112,6 +112,9 @@ int32_t mz_stream_bzip_is_open(void *stream)
int32_t mz_stream_bzip_read(void *stream, void *buf, int32_t size)
{
#ifdef MZ_ZIP_NO_DECOMPRESSION
MZ_UNUSED(stream);
MZ_UNUSED(buf);
MZ_UNUSED(size);
return MZ_SUPPORT_ERROR;
#else
mz_stream_bzip *bzip = (mz_stream_bzip *)stream;

View File

@ -108,6 +108,9 @@ int32_t mz_stream_libcomp_is_open(void *stream)
int32_t mz_stream_libcomp_read(void *stream, void *buf, int32_t size)
{
#ifdef MZ_ZIP_NO_DECOMPRESSION
MZ_UNUSED(stream);
MZ_UNUSED(buf);
MZ_UNUSED(size);
return MZ_SUPPORT_ERROR;
#else
mz_stream_libcomp *libcomp = (mz_stream_libcomp *)stream;

View File

@ -79,6 +79,8 @@ int32_t mz_stream_lzma_open(void *stream, const char *path, int32_t mode)
{
#ifdef MZ_ZIP_NO_COMPRESSION
MZ_UNUSED(filters);
MZ_UNUSED(major);
MZ_UNUSED(minor);
return MZ_SUPPORT_ERROR;
#else
lzma->lstream.next_out = lzma->buffer;
@ -107,6 +109,9 @@ int32_t mz_stream_lzma_open(void *stream, const char *path, int32_t mode)
else if (mode & MZ_OPEN_MODE_READ)
{
#ifdef MZ_ZIP_NO_DECOMPRESSION
MZ_UNUSED(filters);
MZ_UNUSED(major);
MZ_UNUSED(minor);
return MZ_SUPPORT_ERROR;
#else
lzma->lstream.next_in = lzma->buffer;
@ -141,6 +146,9 @@ int32_t mz_stream_lzma_is_open(void *stream)
int32_t mz_stream_lzma_read(void *stream, void *buf, int32_t size)
{
#ifdef MZ_ZIP_NO_DECOMPRESSION
MZ_UNUSED(stream);
MZ_UNUSED(buf);
MZ_UNUSED(size);
return MZ_SUPPORT_ERROR;
#else
mz_stream_lzma *lzma = (mz_stream_lzma *)stream;

View File

@ -120,6 +120,9 @@ int32_t mz_stream_zlib_is_open(void *stream)
int32_t mz_stream_zlib_read(void *stream, void *buf, int32_t size)
{
#ifdef MZ_ZIP_NO_DECOMPRESSION
MZ_UNUSED(stream);
MZ_UNUSED(buf);
MZ_UNUSED(size);
return MZ_SUPPORT_ERROR;
#else
mz_stream_zlib *zlib = (mz_stream_zlib *)stream;

View File

@ -1183,7 +1183,6 @@ static int32_t mz_zip_recover_cd(void *handle)
mz_zip *zip = (mz_zip *)handle;
mz_zip_file local_file_info;
void *local_file_info_stream = NULL;
void *file_extra_stream = NULL;
void *cd_mem_stream = NULL;
uint64_t number_entry = 0;
int64_t descriptor_pos = 0;
@ -1997,7 +1996,6 @@ int32_t mz_zip_entry_write_close(void *handle, uint32_t crc32, int64_t compresse
int64_t uncompressed_size)
{
mz_zip *zip = (mz_zip *)handle;
int64_t total_in = 0;
int32_t err = MZ_OK;
uint8_t zip64 = 0;