Fixed compiler warnings on mac.

Cleaned up includes.
This commit is contained in:
Nathan Moinvaziri 2017-10-10 11:59:09 -07:00
parent 8ada9d0409
commit 869dc30652
7 changed files with 11 additions and 26 deletions

View File

@ -12,7 +12,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <fcntl.h>
@ -22,7 +21,6 @@
#if defined unix || defined __APPLE__
# include <unistd.h>
# include <utime.h>
# include <fcntl.h>
#endif
#include "mz_error.h"

View File

@ -225,7 +225,6 @@ uint32_t mz_stream_bzip_compress(void *stream, int flush)
int32_t mz_stream_bzip_write(void *stream, const void *buf, int32_t size)
{
mz_stream_bzip *bzip = (mz_stream_bzip *)stream;
uint32_t out_bytes = 0;
bzip->bzstream.next_in = (char *)buf;
@ -252,7 +251,6 @@ int32_t mz_stream_bzip_seek(void *stream, int64_t offset, int32_t origin)
int32_t mz_stream_bzip_close(void *stream)
{
mz_stream_bzip *bzip = (mz_stream_bzip *)stream;
uint32_t out_bytes = 0;
if (bzip->mode & MZ_STREAM_MODE_READ)
{

View File

@ -273,7 +273,6 @@ int32_t mz_stream_lzma_seek(void *stream, int64_t offset, int32_t origin)
int32_t mz_stream_lzma_close(void *stream)
{
mz_stream_lzma *lzma = (mz_stream_lzma *)stream;
uint32_t out_bytes = 0;
if (lzma->mode & MZ_STREAM_MODE_READ)
{

View File

@ -17,18 +17,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#if defined unix || defined __APPLE__
# include <unistd.h>
# include <utime.h>
# include <fcntl.h>
#endif
#include "mz_error.h"
#include "mz_strm.h"

View File

@ -14,6 +14,10 @@
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
#define snprintf _snprintf
#endif
#include "mz_error.h"
#include "mz_strm.h"
#include "mz_strm_split.h"
@ -71,7 +75,7 @@ int32_t mz_stream_split_open_disk(void *stream, int32_t number_disk)
{
if (split->current_path[i] != '.')
continue;
_snprintf(&split->current_path[i], split->current_path_size - i, ".z%02d", number_disk + 1);
snprintf(&split->current_path[i], split->current_path_size - i, ".z%02d", number_disk + 1);
break;
}
}
@ -127,7 +131,6 @@ int32_t mz_stream_split_is_open(void *stream)
int32_t mz_stream_split_read(void *stream, void *buf, int32_t size)
{
mz_stream_split *split = (mz_stream_split *)stream;
return size;
}
@ -191,7 +194,6 @@ int64_t mz_stream_split_tell(void *stream)
int32_t mz_stream_split_seek(void *stream, int64_t offset, int32_t origin)
{
mz_stream_split *split = (mz_stream_split *)stream;
return MZ_OK;
}

View File

@ -245,7 +245,6 @@ int32_t mz_stream_zlib_deflate(void *stream, int flush)
int32_t mz_stream_zlib_write(void *stream, const void *buf, int32_t size)
{
mz_stream_zlib *zlib = (mz_stream_zlib *)stream;
uint32_t out_bytes = 0;
zlib->zstream.next_in = (uint8_t*)buf;

View File

@ -693,8 +693,8 @@ extern int ZEXPORT mz_zip_entry_close_raw(void *handle, uint64_t uncompressed_si
{
crc32 = mz_stream_crc32_get_value(zip->crc32_stream);
mz_stream_get_prop_int64(zip->crc32_stream, MZ_STREAM_PROP_TOTAL_OUT, &uncompressed_size);
mz_stream_get_prop_int64(zip->compress_stream, MZ_STREAM_PROP_TOTAL_OUT, &compressed_size);
mz_stream_get_prop_int64(zip->crc32_stream, MZ_STREAM_PROP_TOTAL_OUT, (int64_t *)&uncompressed_size);
mz_stream_get_prop_int64(zip->compress_stream, MZ_STREAM_PROP_TOTAL_OUT, (int64_t *)&compressed_size);
}
if (zip->file_info.flag & MZ_ZIP_FLAG_ENCRYPTED)
@ -704,7 +704,7 @@ extern int ZEXPORT mz_zip_entry_close_raw(void *handle, uint64_t uncompressed_si
err = mz_stream_close(zip->crypt_stream);
if ((zip->compress_info.method != 0) || (uncompressed_size == 0))
mz_stream_get_prop_int64(zip->crypt_stream, MZ_STREAM_PROP_TOTAL_OUT, &compressed_size);
mz_stream_get_prop_int64(zip->crypt_stream, MZ_STREAM_PROP_TOTAL_OUT, (int64_t *)&compressed_size);
mz_stream_delete(&zip->crypt_stream);
}