8000 [pull] master from richgel999:master by pull[bot] · Pull Request #41 · forksnd/miniz · GitHub
[go: up one dir, main page]

Skip to content
Merged
8000
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ endif()

set(MINIZ_API_VERSION 3)
set(MINIZ_MINOR_VERSION 1)
set(MINIZ_PATCH_VERSION 0)
set(MINIZ_PATCH_VERSION 1)
set(MINIZ_VERSION
${MINIZ_API_VERSION}.${MINIZ_MINOR_VERSION}.${MINIZ_PATCH_VERSION})

Expand Down
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changelog

### 3.1.1

- Declare function wrappers as inline static to fix warnings

### 3.1.0

- Fix warnings: Ensure correct integer promotion when adding
Expand Down
56 changes: 33 additions & 23 deletions miniz.h
< 8000 tr data-hunk="622a79ac429aea0714cbad9386f56685381398ffba4523abfc56aaed4c3cceb0" class="show-top-border">
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@

#include "miniz_export.h"

#if defined(__STRICT_ANSI__)
#define MZ_FORCEINLINE
#elif defined(_MSC_VER)
#define MZ_FORCEINLINE __forceinline
#elif defined(__GNUC__)
#define MZ_FORCEINLINE __inline__ __attribute__((__always_inline__))
#else
#define MZ_FORCEINLINE inline
#endif

/* Defines to completely disable specific portions of miniz.c:
If all macros here are defined the only functionality remaining will be CRC-32 and adler-32. */

Expand Down Expand Up @@ -273,11 +283,11 @@ extern "C"
MZ_DEFAULT_COMPRESSION = -1
};

#define MZ_VERSION "11.3.0"
#define MZ_VERNUM 0xB300
#define MZ_VERSION "11.3.1"
#define MZ_VERNUM 0xB301
#define MZ_VER_MAJOR 11
#define MZ_VER_MINOR 3
#define MZ_VER_REVISION 0
#define MZ_VER_REVISION 1
#define MZ_VER_SUBREVISION 0

#ifndef MINIZ_NO_ZLIB_APIS
Expand Down Expand Up @@ -489,96 +499,96 @@ extern "C"

#ifndef MINIZ_NO_DEFLATE_APIS
/* Compatiblity with zlib API. See called functions for documentation */
static int deflateInit(mz_streamp pStream, int level)
static MZ_FORCEINLINE int deflateInit(mz_streamp pStream, int level)
{
return mz_deflateInit(pStream, level);
}
static int deflateInit2(mz_streamp pStream, int level, int method, int window_bits, int mem_level, int strategy)
static MZ_FORCEINLINE int deflateInit2(mz_streamp pStream, int level, int method, int window_bits, int mem_level, int strategy)
{
return mz_deflateInit2(pStream, level, method, window_bits, mem_level, strategy);
}
static int deflateReset(mz_streamp pStream)
static MZ_FORCEINLINE int deflateReset(mz_streamp pStream)
{
return mz_deflateReset(pStream);
}
static int deflate(mz_streamp pStream, int flush)
static MZ_FORCEINLINE int deflate(mz_streamp pStream, int flush)
{
return mz_deflate(pStream, flush);
}
static int deflateEnd(mz_streamp pStream)
static MZ_FORCEINLINE int deflateEnd(mz_streamp pStream)
{
return mz_deflateEnd(pStream);
}
static mz_ulong deflateBound(mz_streamp pStream, mz_ulong source_len)
static MZ_FORCEINLINE mz_ulong deflateBound(mz_streamp pStream, mz_ulong source_len)
{
return mz_deflateBound(pStream, source_len);
}
static int compress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len)
static MZ_FORCEINLINE int compress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len)
{
return mz_compress(pDest, pDest_len, pSource, source_len);
}
static int compress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len, int level)
static MZ_FORCEINLINE int compress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len, int level)
{
return mz_compress2(pDest, pDest_len, pSource, source_len, level);
}
static mz_ulong compressBound(mz_ulong source_len)
static MZ_FORCEINLINE mz_ulong compressBound(mz_ulong source_len)
{
return mz_compressBound(source_len);
}
#endif /*#ifndef MINIZ_NO_DEFLATE_APIS*/

#ifndef MINIZ_NO_INFLATE_APIS
/* Compatiblity with zlib API. See called functions for documentation */
static int inflateInit(mz_streamp pStream)
static MZ_FORCEINLINE int inflateInit(mz_streamp pStream)
{
return mz_inflateInit(pStream);
}

static int inflateInit2(mz_streamp pStream, int window_bits)
static MZ_FORCEINLINE int inflateInit2(mz_streamp pStream, int window_bits)
{
return mz_inflateInit2(pStream, window_bits);
}

static int inflateReset(mz_streamp pStream)
static MZ_FORCEINLINE int inflateReset(mz_streamp pStream)
{
return mz_inflateReset(pStream);
}

static int inflate(mz_streamp pStream, int flush)
static MZ_FORCEINLINE int inflate(mz_streamp pStream, int flush)
{
return mz_inflate(pStream, flush);
}

static int inflateEnd(mz_streamp pStream)
static MZ_FORCEINLINE int inflateEnd(mz_streamp pStream)
{
return mz_inflateEnd(pStream);
}

static int uncompress(unsigned char* pDest, mz_ulong* pDest_len, const unsigned char* pSource, mz_ulong source_len)
static MZ_FORCEINLINE int uncompress(unsigned char* pDest, mz_ulong* pDest_len, const unsigned char* pSource, mz_ulong source_len)
{
return mz_uncompress(pDest, pDest_len, pSource, source_len);
}

static int uncompress2(unsigned char* pDest, mz_ulong* pDest_len, const unsigned char* pSource, mz_ulong* pSource_len)
static MZ_FORCEINLINE int uncompress2(unsigned char* pDest, mz_ulong* pDest_len, const unsigned char* pSource, mz_ulong* pSource_len)
{
return mz_uncompress2(pDest, pDest_len, pSource, pSource_len);
}
#endif /*#ifndef MINIZ_NO_INFLATE_APIS*/

static mz_ulong crc32(mz_ulong crc, const unsigned char *ptr, size_t buf_len)
static MZ_FORCEINLINE mz_ulong crc32(mz_ulong crc, const unsigned char *ptr, size_t buf_len)
{
return mz_crc32(crc, ptr, buf_len);
}

static mz_ulong adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len)
static MZ_FORCEINLINE mz_ulong adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len)
{
return mz_adler32(adler, ptr, buf_len);
}

#define MAX_WBITS 15
#define MAX_MEM_LEVEL 9

static const char* zError(int err)
static MZ_FORCEINLINE const char* zError(int err)
{
return mz_error(err);
}
Expand All @@ -602,4 +612,4 @@ extern "C"
#include "miniz_common.h"
#include "miniz_tdef.h"
#include "miniz_tinfl.h"
#include "miniz_zip.h"
#include "miniz_zip.h"
8 changes: 0 additions & 8 deletions miniz_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,6 @@ typedef struct mz_dummy_time_t_tag

#define MZ_READ_LE64(p) (((mz_uint64)MZ_READ_LE32(p)) | (((mz_uint64)MZ_READ_LE32((const mz_uint8 *)(p) + sizeof(mz_uint32))) << 32U))

#ifdef _MSC_VER
#define MZ_FORCEINLINE __forceinline
#elif defined(__GNUC__)
#define MZ_FORCEINLINE __inline__ __attribute__((__always_inline__))
#else
#define MZ_FORCEINLINE inline
#endif

#ifdef __cplusplus
extern "C"
{
Expand Down
Loading
0