mirror of
				https://github.com/eledio-devices/thirdparty-miniz.git
				synced 2025-10-31 00:32:38 +01:00 
			
		
		
		
	Add padding to structures so it continues to work if features differ
This commit is contained in:
		| @@ -36,7 +36,8 @@ typedef int mz_bool; | |||||||
| #ifdef MINIZ_NO_TIME | #ifdef MINIZ_NO_TIME | ||||||
| typedef struct mz_dummy_time_t_tag | typedef struct mz_dummy_time_t_tag | ||||||
| { | { | ||||||
|     int m_dummy; |     mz_uint32 m_dummy1; | ||||||
|  |     mz_uint32 m_dummy2; | ||||||
| } mz_dummy_time_t; | } mz_dummy_time_t; | ||||||
| #define MZ_TIME_T mz_dummy_time_t | #define MZ_TIME_T mz_dummy_time_t | ||||||
| #else | #else | ||||||
|   | |||||||
							
								
								
									
										19
									
								
								miniz_zip.h
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								miniz_zip.h
									
									
									
									
									
								
							| @@ -32,10 +32,6 @@ typedef struct | |||||||
|     mz_uint16 m_bit_flag; |     mz_uint16 m_bit_flag; | ||||||
|     mz_uint16 m_method; |     mz_uint16 m_method; | ||||||
|  |  | ||||||
| #ifndef MINIZ_NO_TIME |  | ||||||
|     MZ_TIME_T m_time; |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
|     /* CRC-32 of uncompressed data. */ |     /* CRC-32 of uncompressed data. */ | ||||||
|     mz_uint32 m_crc32; |     mz_uint32 m_crc32; | ||||||
|  |  | ||||||
| @@ -72,6 +68,11 @@ typedef struct | |||||||
|     /* Guaranteed to be zero terminated, may be truncated to fit. */ |     /* Guaranteed to be zero terminated, may be truncated to fit. */ | ||||||
|     char m_comment[MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE]; |     char m_comment[MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE]; | ||||||
|  |  | ||||||
|  | #ifdef MINIZ_NO_TIME | ||||||
|  |     MZ_TIME_T m_padding; | ||||||
|  | #else | ||||||
|  |     MZ_TIME_T m_time; | ||||||
|  | #endif | ||||||
| } mz_zip_archive_file_stat; | } mz_zip_archive_file_stat; | ||||||
|  |  | ||||||
| typedef size_t (*mz_file_read_func)(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n); | typedef size_t (*mz_file_read_func)(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n); | ||||||
| @@ -183,9 +184,7 @@ typedef struct | |||||||
|     mz_uint flags; |     mz_uint flags; | ||||||
|  |  | ||||||
|     int status; |     int status; | ||||||
| #ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS |  | ||||||
|     mz_uint file_crc32; |  | ||||||
| #endif |  | ||||||
|     mz_uint64 read_buf_size, read_buf_ofs, read_buf_avail, comp_remaining, out_buf_ofs, cur_file_ofs; |     mz_uint64 read_buf_size, read_buf_ofs, read_buf_avail, comp_remaining, out_buf_ofs, cur_file_ofs; | ||||||
|     mz_zip_archive_file_stat file_stat; |     mz_zip_archive_file_stat file_stat; | ||||||
|     void *pRead_buf; |     void *pRead_buf; | ||||||
| @@ -195,6 +194,12 @@ typedef struct | |||||||
|  |  | ||||||
|     tinfl_decompressor inflator; |     tinfl_decompressor inflator; | ||||||
|  |  | ||||||
|  | #ifdef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS | ||||||
|  |     mz_uint padding; | ||||||
|  | #else | ||||||
|  |     mz_uint file_crc32; | ||||||
|  | #endif | ||||||
|  |  | ||||||
| } mz_zip_reader_extract_iter_state; | } mz_zip_reader_extract_iter_state; | ||||||
|  |  | ||||||
| /* -------- ZIP reading */ | /* -------- ZIP reading */ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user