mirror of
				https://github.com/eledio-devices/thirdparty-miniz.git
				synced 2025-10-31 08:42:39 +01:00 
			
		
		
		
	Rerun clang-format
This commit is contained in:
		
							
								
								
									
										4
									
								
								miniz.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								miniz.c
									
									
									
									
									
								
							| @@ -320,7 +320,7 @@ int mz_compress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char | |||||||
|     stream.next_in = pSource; |     stream.next_in = pSource; | ||||||
|     stream.avail_in = (mz_uint32)source_len; |     stream.avail_in = (mz_uint32)source_len; | ||||||
|     stream.next_out = pDest; |     stream.next_out = pDest; | ||||||
|     stream.avail_out = (mz_uint32)*pDest_len; |     stream.avail_out = (mz_uint32) * pDest_len; | ||||||
|  |  | ||||||
|     status = mz_deflateInit(&stream, level); |     status = mz_deflateInit(&stream, level); | ||||||
|     if (status != MZ_OK) |     if (status != MZ_OK) | ||||||
| @@ -534,7 +534,7 @@ int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char | |||||||
|     stream.next_in = pSource; |     stream.next_in = pSource; | ||||||
|     stream.avail_in = (mz_uint32)source_len; |     stream.avail_in = (mz_uint32)source_len; | ||||||
|     stream.next_out = pDest; |     stream.next_out = pDest; | ||||||
|     stream.avail_out = (mz_uint32)*pDest_len; |     stream.avail_out = (mz_uint32) * pDest_len; | ||||||
|  |  | ||||||
|     status = mz_inflateInit(&stream); |     status = mz_inflateInit(&stream); | ||||||
|     if (status != MZ_OK) |     if (status != MZ_OK) | ||||||
|   | |||||||
| @@ -45,7 +45,7 @@ typedef struct mz_dummy_time_t_tag | |||||||
|  |  | ||||||
| #ifdef MINIZ_NO_MALLOC | #ifdef MINIZ_NO_MALLOC | ||||||
| #define MZ_MALLOC(x) NULL | #define MZ_MALLOC(x) NULL | ||||||
| #define MZ_FREE(x) (void)x, ((void)0) | #define MZ_FREE(x) (void) x, ((void)0) | ||||||
| #define MZ_REALLOC(p, x) NULL | #define MZ_REALLOC(p, x) NULL | ||||||
| #else | #else | ||||||
| #define MZ_MALLOC(x) malloc(x) | #define MZ_MALLOC(x) malloc(x) | ||||||
| @@ -57,7 +57,7 @@ typedef struct mz_dummy_time_t_tag | |||||||
| #define MZ_MIN(a, b) (((a) < (b)) ? (a) : (b)) | #define MZ_MIN(a, b) (((a) < (b)) ? (a) : (b)) | ||||||
| #define MZ_CLEAR_OBJ(obj) memset(&(obj), 0, sizeof(obj)) | #define MZ_CLEAR_OBJ(obj) memset(&(obj), 0, sizeof(obj)) | ||||||
|  |  | ||||||
| #if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN | #if MINIZ_USE_UNALIGNED_LOADS_AND_STORES &&MINIZ_LITTLE_ENDIAN | ||||||
| #define MZ_READ_LE16(p) *((const mz_uint16 *)(p)) | #define MZ_READ_LE16(p) *((const mz_uint16 *)(p)) | ||||||
| #define MZ_READ_LE32(p) *((const mz_uint32 *)(p)) | #define MZ_READ_LE32(p) *((const mz_uint32 *)(p)) | ||||||
| #else | #else | ||||||
|   | |||||||
| @@ -1482,7 +1482,7 @@ void *tdefl_write_image_to_png_file_in_memory_ex(const void *pImage, int w, int | |||||||
|         static const mz_uint8 chans[] = { 0x00, 0x00, 0x04, 0x02, 0x06 }; |         static const mz_uint8 chans[] = { 0x00, 0x00, 0x04, 0x02, 0x06 }; | ||||||
|         mz_uint8 pnghdr[41] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, |         mz_uint8 pnghdr[41] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, | ||||||
|                                 0, 0, (mz_uint8)(w >> 8), (mz_uint8)w, 0, 0, (mz_uint8)(h >> 8), (mz_uint8)h, 8, chans[num_chans], 0, 0, 0, 0, 0, 0, 0, |                                 0, 0, (mz_uint8)(w >> 8), (mz_uint8)w, 0, 0, (mz_uint8)(h >> 8), (mz_uint8)h, 8, chans[num_chans], 0, 0, 0, 0, 0, 0, 0, | ||||||
|                                 (mz_uint8)(*pLen_out >> 24), (mz_uint8)(*pLen_out >> 16), (mz_uint8)(*pLen_out >> 8), (mz_uint8)*pLen_out, 0x49, 0x44, 0x41, 0x54 }; |                                 (mz_uint8)(*pLen_out >> 24), (mz_uint8)(*pLen_out >> 16), (mz_uint8)(*pLen_out >> 8), (mz_uint8) * pLen_out, 0x49, 0x44, 0x41, 0x54 }; | ||||||
|         c = (mz_uint32)mz_crc32(MZ_CRC32_INIT, pnghdr + 12, 17); |         c = (mz_uint32)mz_crc32(MZ_CRC32_INIT, pnghdr + 12, 17); | ||||||
|         for (i = 0; i < 4; ++i, c <<= 8) |         for (i = 0; i < 4; ++i, c <<= 8) | ||||||
|             ((mz_uint8 *)(pnghdr + 29))[i] = (mz_uint8)(c >> 24); |             ((mz_uint8 *)(pnghdr + 29))[i] = (mz_uint8)(c >> 24); | ||||||
| @@ -1530,4 +1530,3 @@ void tdefl_compressor_free(tdefl_compressor *pComp) | |||||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|   | |||||||
| @@ -30,7 +30,6 @@ | |||||||
| extern "C" { | extern "C" { | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  |  | ||||||
| /* ------------------- Low-level Decompression (completely independent from all compression API's) */ | /* ------------------- Low-level Decompression (completely independent from all compression API's) */ | ||||||
|  |  | ||||||
| #define TINFL_MEMCPY(d, s, l) memcpy(d, s, l) | #define TINFL_MEMCPY(d, s, l) memcpy(d, s, l) | ||||||
| @@ -46,7 +45,8 @@ extern "C" { | |||||||
|         status = result;                     \ |         status = result;                     \ | ||||||
|         r->m_state = state_index;            \ |         r->m_state = state_index;            \ | ||||||
|         goto common_exit;                    \ |         goto common_exit;                    \ | ||||||
|         case state_index:;                   \ |         case state_index:                    \ | ||||||
|  |             ;                                \ | ||||||
|     }                                        \ |     }                                        \ | ||||||
|     MZ_MACRO_END |     MZ_MACRO_END | ||||||
| #define TINFL_CR_RETURN_FOREVER(state_index, result) \ | #define TINFL_CR_RETURN_FOREVER(state_index, result) \ | ||||||
| @@ -732,4 +732,3 @@ void tinfl_decompressor_free(tinfl_decompressor *pDecomp) | |||||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|   | |||||||
| @@ -84,7 +84,6 @@ typedef enum | |||||||
|     /* (either exact or worst case) and will stop calling the inflator and fail after receiving too much. In pure streaming scenarios where you have no idea how many bytes to expect this may not be possible */ |     /* (either exact or worst case) and will stop calling the inflator and fail after receiving too much. In pure streaming scenarios where you have no idea how many bytes to expect this may not be possible */ | ||||||
|     /* so I may need to add some code to address this. */ |     /* so I may need to add some code to address this. */ | ||||||
|     TINFL_STATUS_HAS_MORE_OUTPUT = 2 |     TINFL_STATUS_HAS_MORE_OUTPUT = 2 | ||||||
|  |  | ||||||
| } tinfl_status; | } tinfl_status; | ||||||
|  |  | ||||||
| /* Initializes the decompressor to its initial state. */ | /* Initializes the decompressor to its initial state. */ | ||||||
|   | |||||||
							
								
								
									
										27
									
								
								miniz_zip.c
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								miniz_zip.c
									
									
									
									
									
								
							| @@ -199,7 +199,7 @@ enum | |||||||
|     MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS = 22, |     MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS = 22, | ||||||
|     MZ_ZIP_LDH_FILENAME_LEN_OFS = 26, |     MZ_ZIP_LDH_FILENAME_LEN_OFS = 26, | ||||||
|     MZ_ZIP_LDH_EXTRA_LEN_OFS = 28, |     MZ_ZIP_LDH_EXTRA_LEN_OFS = 28, | ||||||
|     MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR = 1<<3, |     MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR = 1 << 3, | ||||||
|  |  | ||||||
|     /* End of central directory offsets */ |     /* End of central directory offsets */ | ||||||
|     MZ_ZIP_ECDH_SIG_OFS = 0, |     MZ_ZIP_ECDH_SIG_OFS = 0, | ||||||
| @@ -234,7 +234,7 @@ enum | |||||||
|     MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG = 32, |     MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG = 32, | ||||||
|     MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION = 64, |     MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION = 64, | ||||||
|     MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_LOCAL_DIR_IS_MASKED = 8192, |     MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_LOCAL_DIR_IS_MASKED = 8192, | ||||||
|     MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8 = 1<<11 |     MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8 = 1 << 11 | ||||||
| }; | }; | ||||||
|  |  | ||||||
| typedef struct | typedef struct | ||||||
| @@ -1304,7 +1304,7 @@ static mz_bool mz_zip_locate_file_binary_search(mz_zip_archive *pZip, const char | |||||||
| int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags) | int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags) | ||||||
| { | { | ||||||
|     mz_uint32 index; |     mz_uint32 index; | ||||||
|     if(!mz_zip_reader_locate_file_v2(pZip, pName, pComment, flags, &index)) |     if (!mz_zip_reader_locate_file_v2(pZip, pName, pComment, flags, &index)) | ||||||
|         return -1; |         return -1; | ||||||
|     else |     else | ||||||
|         return (int)index; |         return (int)index; | ||||||
| @@ -2703,7 +2703,7 @@ static mz_bool mz_zip_writer_add_to_central_dir(mz_zip_archive *pZip, const char | |||||||
|                                                 mz_uint64 uncomp_size, mz_uint64 comp_size, mz_uint32 uncomp_crc32, |                                                 mz_uint64 uncomp_size, mz_uint64 comp_size, mz_uint32 uncomp_crc32, | ||||||
|                                                 mz_uint16 method, mz_uint16 bit_flags, mz_uint16 dos_time, mz_uint16 dos_date, |                                                 mz_uint16 method, mz_uint16 bit_flags, mz_uint16 dos_time, mz_uint16 dos_date, | ||||||
|                                                 mz_uint64 local_header_ofs, mz_uint32 ext_attributes, |                                                 mz_uint64 local_header_ofs, mz_uint32 ext_attributes, | ||||||
| 											    const char* user_extra_data, mz_uint user_extra_data_len) |                                                 const char *user_extra_data, mz_uint user_extra_data_len) | ||||||
| { | { | ||||||
|     mz_zip_internal_state *pState = pZip->m_pState; |     mz_zip_internal_state *pState = pZip->m_pState; | ||||||
|     mz_uint32 central_dir_ofs = (mz_uint32)pState->m_central_dir.m_size; |     mz_uint32 central_dir_ofs = (mz_uint32)pState->m_central_dir.m_size; | ||||||
| @@ -2788,7 +2788,7 @@ mz_bool mz_zip_writer_add_mem_ex(mz_zip_archive *pZip, const char *pArchive_name | |||||||
|  |  | ||||||
| mz_bool mz_zip_writer_add_mem_ex_v2(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, | mz_bool mz_zip_writer_add_mem_ex_v2(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, | ||||||
|                                     mz_uint level_and_flags, mz_uint64 uncomp_size, mz_uint32 uncomp_crc32, MZ_TIME_T *last_modified, |                                     mz_uint level_and_flags, mz_uint64 uncomp_size, mz_uint32 uncomp_crc32, MZ_TIME_T *last_modified, | ||||||
| 	const char* user_extra_data, mz_uint user_extra_data_len, const char* user_extra_data_central, mz_uint user_extra_data_central_len) |                                     const char *user_extra_data, mz_uint user_extra_data_len, const char *user_extra_data_central, mz_uint user_extra_data_central_len) | ||||||
| { | { | ||||||
|     mz_uint16 method = 0, dos_time = 0, dos_date = 0; |     mz_uint16 method = 0, dos_time = 0, dos_date = 0; | ||||||
|     mz_uint level, ext_attributes = 0, num_alignment_padding_bytes; |     mz_uint level, ext_attributes = 0, num_alignment_padding_bytes; | ||||||
| @@ -2803,10 +2803,10 @@ 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_uint8 extra_data[MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE]; | ||||||
|     mz_uint16 bit_flags = 0; |     mz_uint16 bit_flags = 0; | ||||||
|  |  | ||||||
| 	if(uncomp_size || ( buf_size && !(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA) ) ) |     if (uncomp_size || (buf_size && !(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA))) | ||||||
|         bit_flags |= MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR; |         bit_flags |= MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR; | ||||||
|  |  | ||||||
|     if (level_and_flags & MZ_ZIP_FLAG_UTF8_FILENAME ) |     if (level_and_flags & MZ_ZIP_FLAG_UTF8_FILENAME) | ||||||
|         bit_flags |= MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8; |         bit_flags |= MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8; | ||||||
|  |  | ||||||
|     if ((int)level_and_flags < 0) |     if ((int)level_and_flags < 0) | ||||||
| @@ -3032,7 +3032,7 @@ mz_bool mz_zip_writer_add_mem_ex_v2(mz_zip_archive *pZip, const char *pArchive_n | |||||||
|  |  | ||||||
|         MZ_WRITE_LE32(local_dir_footer + 0, MZ_ZIP_DATA_DESCRIPTOR_ID); |         MZ_WRITE_LE32(local_dir_footer + 0, MZ_ZIP_DATA_DESCRIPTOR_ID); | ||||||
|         MZ_WRITE_LE32(local_dir_footer + 4, uncomp_crc32); |         MZ_WRITE_LE32(local_dir_footer + 4, uncomp_crc32); | ||||||
| 		if (pExtra_data==NULL) |         if (pExtra_data == NULL) | ||||||
|         { |         { | ||||||
|             if ((comp_size > MZ_UINT32_MAX) || (cur_archive_file_ofs > MZ_UINT32_MAX)) |             if ((comp_size > MZ_UINT32_MAX) || (cur_archive_file_ofs > MZ_UINT32_MAX)) | ||||||
|                 return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); |                 return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); | ||||||
| @@ -3072,7 +3072,7 @@ mz_bool mz_zip_writer_add_mem_ex_v2(mz_zip_archive *pZip, const char *pArchive_n | |||||||
|  |  | ||||||
| #ifndef MINIZ_NO_STDIO | #ifndef MINIZ_NO_STDIO | ||||||
| mz_bool mz_zip_writer_add_cfile(mz_zip_archive *pZip, const char *pArchive_name, MZ_FILE *pSrc_file, mz_uint64 size_to_add, const MZ_TIME_T *pFile_time, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, | mz_bool mz_zip_writer_add_cfile(mz_zip_archive *pZip, const char *pArchive_name, MZ_FILE *pSrc_file, mz_uint64 size_to_add, const MZ_TIME_T *pFile_time, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, | ||||||
| 	const char* user_extra_data, mz_uint user_extra_data_len, const char* user_extra_data_central, mz_uint user_extra_data_central_len) |                                 const char *user_extra_data, mz_uint user_extra_data_len, const char *user_extra_data_central, mz_uint user_extra_data_central_len) | ||||||
| { | { | ||||||
|     mz_uint16 gen_flags = MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR; |     mz_uint16 gen_flags = MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR; | ||||||
|     mz_uint uncomp_crc32 = MZ_CRC32_INIT, level, num_alignment_padding_bytes; |     mz_uint uncomp_crc32 = MZ_CRC32_INIT, level, num_alignment_padding_bytes; | ||||||
| @@ -3085,7 +3085,7 @@ mz_bool mz_zip_writer_add_cfile(mz_zip_archive *pZip, const char *pArchive_name, | |||||||
|     mz_uint8 extra_data[MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE]; |     mz_uint8 extra_data[MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE]; | ||||||
|     mz_zip_internal_state *pState; |     mz_zip_internal_state *pState; | ||||||
|  |  | ||||||
|     if(level_and_flags & MZ_ZIP_FLAG_UTF8_FILENAME) |     if (level_and_flags & MZ_ZIP_FLAG_UTF8_FILENAME) | ||||||
|         gen_flags |= MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8; |         gen_flags |= MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8; | ||||||
|  |  | ||||||
|     if ((int)level_and_flags < 0) |     if ((int)level_and_flags < 0) | ||||||
| @@ -3139,7 +3139,7 @@ mz_bool mz_zip_writer_add_cfile(mz_zip_archive *pZip, const char *pArchive_name, | |||||||
|     if (!pState->m_zip64) |     if (!pState->m_zip64) | ||||||
|     { |     { | ||||||
|         /* Bail early if the archive would obviously become too large */ |         /* Bail early if the archive would obviously become too large */ | ||||||
| 		if ((pZip->m_archive_size + num_alignment_padding_bytes + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + archive_name_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + archive_name_size + comment_size + pState->m_central_dir.m_size + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE+1024) > 0xFFFFFFFF) |         if ((pZip->m_archive_size + num_alignment_padding_bytes + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + archive_name_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + archive_name_size + comment_size + pState->m_central_dir.m_size + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE + 1024) > 0xFFFFFFFF) | ||||||
|         { |         { | ||||||
|             pState->m_zip64 = MZ_TRUE; |             pState->m_zip64 = MZ_TRUE; | ||||||
|             /*return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); */ |             /*return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); */ | ||||||
| @@ -3184,7 +3184,7 @@ mz_bool mz_zip_writer_add_cfile(mz_zip_archive *pZip, const char *pArchive_name, | |||||||
|                                                                (uncomp_size >= MZ_UINT32_MAX) ? &comp_size : NULL, (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL); |                                                                (uncomp_size >= MZ_UINT32_MAX) ? &comp_size : NULL, (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL); | ||||||
|         } |         } | ||||||
|  |  | ||||||
| 		if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)archive_name_size, extra_size+ user_extra_data_len, 0, 0, 0, method, gen_flags, dos_time, dos_date)) |         if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)archive_name_size, extra_size + user_extra_data_len, 0, 0, 0, method, gen_flags, dos_time, dos_date)) | ||||||
|             return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR); |             return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR); | ||||||
|  |  | ||||||
|         if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header)) |         if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header)) | ||||||
| @@ -3326,7 +3326,7 @@ mz_bool mz_zip_writer_add_cfile(mz_zip_archive *pZip, const char *pArchive_name, | |||||||
|  |  | ||||||
|     MZ_WRITE_LE32(local_dir_footer + 0, MZ_ZIP_DATA_DESCRIPTOR_ID); |     MZ_WRITE_LE32(local_dir_footer + 0, MZ_ZIP_DATA_DESCRIPTOR_ID); | ||||||
|     MZ_WRITE_LE32(local_dir_footer + 4, uncomp_crc32); |     MZ_WRITE_LE32(local_dir_footer + 4, uncomp_crc32); | ||||||
| 	if (pExtra_data==NULL) |     if (pExtra_data == NULL) | ||||||
|     { |     { | ||||||
|         if (comp_size > MZ_UINT32_MAX) |         if (comp_size > MZ_UINT32_MAX) | ||||||
|             return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); |             return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); | ||||||
| @@ -4318,4 +4318,3 @@ mz_bool mz_zip_end(mz_zip_archive *pZip) | |||||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										11
									
								
								miniz_zip.h
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								miniz_zip.h
									
									
									
									
									
								
							| @@ -353,11 +353,8 @@ mz_bool mz_zip_writer_add_mem_ex(mz_zip_archive *pZip, const char *pArchive_name | |||||||
|                                  mz_uint64 uncomp_size, mz_uint32 uncomp_crc32); |                                  mz_uint64 uncomp_size, mz_uint32 uncomp_crc32); | ||||||
|  |  | ||||||
| mz_bool mz_zip_writer_add_mem_ex_v2(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, | mz_bool mz_zip_writer_add_mem_ex_v2(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, | ||||||
| 	mz_uint64 uncomp_size, mz_uint32 uncomp_crc32, MZ_TIME_T *last_modified, const char* user_extra_data_local, mz_uint user_extra_data_local_len, |                                     mz_uint64 uncomp_size, mz_uint32 uncomp_crc32, MZ_TIME_T *last_modified, const char *user_extra_data_local, mz_uint user_extra_data_local_len, | ||||||
| 	const char* user_extra_data_central, mz_uint user_extra_data_central_len); |                                     const char *user_extra_data_central, mz_uint user_extra_data_central_len); | ||||||
| 	 |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| #ifndef MINIZ_NO_STDIO | #ifndef MINIZ_NO_STDIO | ||||||
| /* Adds the contents of a disk file to an archive. This function also records the disk file's modified time into the archive. */ | /* Adds the contents of a disk file to an archive. This function also records the disk file's modified time into the archive. */ | ||||||
| @@ -366,8 +363,8 @@ mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name, | |||||||
|  |  | ||||||
| /* Like mz_zip_writer_add_file(), except the file data is read from the specified FILE stream. */ | /* Like mz_zip_writer_add_file(), except the file data is read from the specified FILE stream. */ | ||||||
| mz_bool mz_zip_writer_add_cfile(mz_zip_archive *pZip, const char *pArchive_name, MZ_FILE *pSrc_file, mz_uint64 size_to_add, | mz_bool mz_zip_writer_add_cfile(mz_zip_archive *pZip, const char *pArchive_name, MZ_FILE *pSrc_file, mz_uint64 size_to_add, | ||||||
| 	const MZ_TIME_T *pFile_time, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, const char* user_extra_data_local, mz_uint user_extra_data_local_len, |                                 const MZ_TIME_T *pFile_time, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, const char *user_extra_data_local, mz_uint user_extra_data_local_len, | ||||||
| 	const char* user_extra_data_central, mz_uint user_extra_data_central_len); |                                 const char *user_extra_data_central, mz_uint user_extra_data_central_len); | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| /* Adds a file to an archive by fully cloning the data from another archive. */ | /* Adds a file to an archive by fully cloning the data from another archive. */ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user