Skip to content

Commit f8226f2

Browse files
author
Matthias Güdemann
committed
type cleanup in miniz
1 parent 9a95352 commit f8226f2

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/miniz/miniz.h

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176

177177

178178

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

182182
/* Define MINIZ_NO_STDIO to disable all usage and any functions which rely on stdio for file I/O. */
@@ -199,7 +199,7 @@
199199
/* Define MINIZ_NO_ZLIB_COMPATIBLE_NAME to disable zlib names, to prevent conflicts against stock zlib. */
200200
/*#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES */
201201

202-
/* Define MINIZ_NO_MALLOC to disable all calls to malloc, free, and realloc.
202+
/* Define MINIZ_NO_MALLOC to disable all calls to malloc, free, and realloc.
203203
Note if MINIZ_NO_MALLOC is defined then the user must always provide custom user alloc/free/realloc
204204
callbacks to the zlib and archive API's, and a few stand-alone helper API's which don't provide custom user
205205
functions (such as tdefl_compress_mem_to_heap() and tinfl_decompress_mem_to_heap()) won't work. */
@@ -523,19 +523,20 @@ typedef void *const voidpc;
523523
#include <stdlib.h>
524524
#include <string.h>
525525
#include <stdint.h>
526+
#include <stdbool.h>
526527

527528
/* ------------------- Types and macros */
528-
typedef unsigned char mz_uint8;
529-
typedef signed short mz_int16;
530-
typedef unsigned short mz_uint16;
531-
typedef unsigned int mz_uint32;
529+
typedef uint8_t mz_uint8;
530+
typedef int16_t mz_int16;
531+
typedef uint16_t mz_uint16;
532+
typedef uint32_t mz_uint32;
532533
typedef unsigned int mz_uint;
533534
typedef int64_t mz_int64;
534535
typedef uint64_t mz_uint64;
535-
typedef int mz_bool;
536+
typedef bool mz_bool;
536537

537-
#define MZ_FALSE (0)
538-
#define MZ_TRUE (1)
538+
#define MZ_FALSE false
539+
#define MZ_TRUE true
539540

540541
/* Works around MSVC's spammy "warning C4127: conditional expression is constant" message. */
541542
#ifdef _MSC_VER
@@ -1195,7 +1196,7 @@ mz_uint mz_zip_reader_get_filename(mz_zip_archive *pZip, mz_uint file_index, cha
11951196
/* Valid flags: MZ_ZIP_FLAG_CASE_SENSITIVE, MZ_ZIP_FLAG_IGNORE_PATH */
11961197
/* Returns -1 if the file cannot be found. */
11971198
int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags);
1198-
int mz_zip_reader_locate_file_v2(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags, mz_uint32 *file_index);
1199+
mz_bool mz_zip_reader_locate_file_v2(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags, mz_uint32 *file_index);
11991200

12001201
/* Returns detailed information about an archive file entry. */
12011202
mz_bool mz_zip_reader_file_stat(mz_zip_archive *pZip, mz_uint file_index, mz_zip_archive_file_stat *pStat);

0 commit comments

Comments
 (0)