mirror of
https://github.com/eledio-devices/thirdparty-miniz.git
synced 2025-11-01 16:14:13 +01:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
36b6c99f62 | ||
|
|
04f2169b8a | ||
|
|
14a5a1397b | ||
|
|
fef12d34f1 | ||
|
|
b01930542e | ||
|
|
9c88e826a2 | ||
|
|
22e4ef1b1d | ||
|
|
7a7d0b423b | ||
|
|
c17cc20c80 | ||
|
|
0f6b199e5b | ||
|
|
0b7d3070b9 | ||
|
|
aadc405b1c | ||
|
|
02c51d3662 | ||
|
|
9393a95f26 | ||
|
|
82e5b184e4 |
@@ -1,7 +1,12 @@
|
||||
PROJECT(miniz)
|
||||
PROJECT(miniz C)
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
set(CMAKE_CONFIGURATION_TYPES Release Debug)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "")
|
||||
# CMake defaults to leaving CMAKE_BUILD_TYPE empty. This screws up
|
||||
# differentiation between debug and release builds.
|
||||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
|
||||
"Choose the type of build, options are: None (CMAKE_CXX_FLAGS or \
|
||||
CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
|
||||
endif ()
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
|
||||
|
||||
@@ -38,3 +43,10 @@ endif()
|
||||
|
||||
# add_executable(miniz_tester ${MINIZ_TESTER_SRC_LIST})
|
||||
# target_link_libraries(miniz_tester miniz)
|
||||
|
||||
install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Targets
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib
|
||||
)
|
||||
file(GLOB INSTALL_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.h)
|
||||
install(FILES ${INSTALL_HEADERS} DESTINATION include/${PROJECT_NAME})
|
||||
8
miniz.h
8
miniz.h
@@ -1,4 +1,4 @@
|
||||
/* miniz.c 2.0.6 beta - public domain deflate/inflate, zlib-subset, ZIP reading/writing/appending, PNG writing
|
||||
/* miniz.c 2.0.7 - public domain deflate/inflate, zlib-subset, ZIP reading/writing/appending, PNG writing
|
||||
See "unlicense" statement at the end of this file.
|
||||
Rich Geldreich <richgel99@gmail.com>, last updated Oct. 13, 2013
|
||||
Implements RFC 1950: http://www.ietf.org/rfc/rfc1950.txt and RFC 1951: http://www.ietf.org/rfc/rfc1951.txt
|
||||
@@ -234,11 +234,11 @@ enum
|
||||
MZ_DEFAULT_COMPRESSION = -1
|
||||
};
|
||||
|
||||
#define MZ_VERSION "10.0.1"
|
||||
#define MZ_VERNUM 0xA010
|
||||
#define MZ_VERSION "10.0.2"
|
||||
#define MZ_VERNUM 0xA020
|
||||
#define MZ_VER_MAJOR 10
|
||||
#define MZ_VER_MINOR 0
|
||||
#define MZ_VER_REVISION 1
|
||||
#define MZ_VER_REVISION 2
|
||||
#define MZ_VER_SUBREVISION 0
|
||||
|
||||
#ifndef MINIZ_NO_ZLIB_APIS
|
||||
|
||||
@@ -1334,6 +1334,8 @@ tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_fun
|
||||
d->m_pSrc = NULL;
|
||||
d->m_src_buf_left = 0;
|
||||
d->m_out_buf_ofs = 0;
|
||||
if (!(flags & TDEFL_NONDETERMINISTIC_PARSING_FLAG))
|
||||
MZ_CLEAR_OBJ(d->m_dict);
|
||||
memset(&d->m_huff_count[0][0], 0, sizeof(d->m_huff_count[0][0]) * TDEFL_MAX_HUFF_SYMBOLS_0);
|
||||
memset(&d->m_huff_count[1][0], 0, sizeof(d->m_huff_count[1][0]) * TDEFL_MAX_HUFF_SYMBOLS_1);
|
||||
return TDEFL_STATUS_OKAY;
|
||||
|
||||
10
miniz_zip.c
10
miniz_zip.c
@@ -112,7 +112,7 @@ static FILE *mz_freopen(const char *pPath, const char *pMode, FILE *pStream)
|
||||
#define MZ_FFLUSH fflush
|
||||
#define MZ_FREOPEN(p, m, s) freopen64(p, m, s)
|
||||
#define MZ_DELETE_FILE remove
|
||||
#elif defined(__APPLE__) && _LARGEFILE64_SOURCE
|
||||
#elif defined(__APPLE__)
|
||||
#ifndef MINIZ_NO_TIME
|
||||
#include <utime.h>
|
||||
#endif
|
||||
@@ -978,7 +978,10 @@ mz_bool mz_zip_reader_init_file_v2(mz_zip_archive *pZip, const char *pFilename,
|
||||
/* TODO: Better sanity check archive_size and the # of actual remaining bytes */
|
||||
|
||||
if (file_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
|
||||
{
|
||||
MZ_FCLOSE(pFile);
|
||||
return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE);
|
||||
}
|
||||
|
||||
if (!mz_zip_reader_init_internal(pZip, flags))
|
||||
{
|
||||
@@ -3128,14 +3131,15 @@ mz_bool mz_zip_writer_add_mem_ex_v2(mz_zip_archive *pZip, const char *pArchive_n
|
||||
mz_uint8 extra_data[MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE];
|
||||
mz_uint16 bit_flags = 0;
|
||||
|
||||
if ((int)level_and_flags < 0)
|
||||
level_and_flags = MZ_DEFAULT_LEVEL;
|
||||
|
||||
if (uncomp_size || (buf_size && !(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)))
|
||||
bit_flags |= MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR;
|
||||
|
||||
if (!(level_and_flags & MZ_ZIP_FLAG_ASCII_FILENAME))
|
||||
bit_flags |= MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8;
|
||||
|
||||
if ((int)level_and_flags < 0)
|
||||
level_and_flags = MZ_DEFAULT_LEVEL;
|
||||
level = level_and_flags & 0xF;
|
||||
store_data_uncompressed = ((!level) || (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user