mirror of
				https://github.com/eledio-devices/thirdparty-miniz.git
				synced 2025-10-31 00:32:38 +01:00 
			
		
		
		
	Fix "Comparison result always 0" warnings with OpenWatcom
This commit is contained in:
		| @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) | ||||
|   file_loc = ftell(pInfile); | ||||
|   fseek(pInfile, 0, SEEK_SET); | ||||
|  | ||||
|   if ((file_loc < 0) || (file_loc > INT_MAX)) | ||||
|   if ((file_loc < 0) || ((mz_uint64)file_loc > INT_MAX)) | ||||
|   { | ||||
|      // This is not a limitation of miniz or tinfl, but this example. | ||||
|      printf("File is too large to be processed by this example.\n"); | ||||
|   | ||||
| @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) | ||||
|   file_loc = ftell(pInfile); | ||||
|   fseek(pInfile, 0, SEEK_SET); | ||||
|  | ||||
|   if ((file_loc < 0) || (file_loc > INT_MAX)) | ||||
|   if ((file_loc < 0) || ((mz_uint64)file_loc > INT_MAX)) | ||||
|   { | ||||
|      // This is not a limitation of miniz or tinfl, but this example. | ||||
|      printf("File is too large to be processed by this example.\n"); | ||||
|   | ||||
| @@ -132,7 +132,7 @@ int main(int argc, char *argv[]) | ||||
|    file_loc = ftell(pInfile); | ||||
|    fseek(pInfile, 0, SEEK_SET); | ||||
|  | ||||
|    if ((file_loc < 0) || (file_loc > INT_MAX)) | ||||
|    if ((file_loc < 0) || ((mz_uint64)file_loc > INT_MAX)) | ||||
|    { | ||||
|       // This is not a limitation of miniz or tinfl, but this example. | ||||
|       printf("File is too large to be processed by this example.\n"); | ||||
|   | ||||
							
								
								
									
										4
									
								
								miniz.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								miniz.c
									
									
									
									
									
								
							| @@ -320,7 +320,7 @@ int mz_compress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char | ||||
|     memset(&stream, 0, sizeof(stream)); | ||||
|  | ||||
|     /* In case mz_ulong is 64-bits (argh I hate longs). */ | ||||
|     if ((source_len | *pDest_len) > 0xFFFFFFFFU) | ||||
|     if ((mz_uint64)(source_len | *pDest_len) > 0xFFFFFFFFU) | ||||
|         return MZ_PARAM_ERROR; | ||||
|  | ||||
|     stream.next_in = pSource; | ||||
| @@ -559,7 +559,7 @@ int mz_uncompress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned cha | ||||
|     memset(&stream, 0, sizeof(stream)); | ||||
|  | ||||
|     /* In case mz_ulong is 64-bits (argh I hate longs). */ | ||||
|     if ((*pSource_len | *pDest_len) > 0xFFFFFFFFU) | ||||
|     if ((mz_uint64)(*pSource_len | *pDest_len) > 0xFFFFFFFFU) | ||||
|         return MZ_PARAM_ERROR; | ||||
|  | ||||
|     stream.next_in = pSource; | ||||
|   | ||||
| @@ -3194,7 +3194,7 @@ mz_bool mz_zip_writer_add_mem_ex_v2(mz_zip_archive *pZip, const char *pArchive_n | ||||
|             pState->m_zip64 = MZ_TRUE; | ||||
|             /*return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES); */ | ||||
|         } | ||||
|         if ((buf_size > 0xFFFFFFFF) || (uncomp_size > 0xFFFFFFFF)) | ||||
|         if (((mz_uint64)buf_size > 0xFFFFFFFF) || (uncomp_size > 0xFFFFFFFF)) | ||||
|         { | ||||
|             pState->m_zip64 = MZ_TRUE; | ||||
|             /*return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); */ | ||||
| @@ -4299,7 +4299,7 @@ mz_bool mz_zip_writer_finalize_archive(mz_zip_archive *pZip) | ||||
|  | ||||
|     if (pState->m_zip64) | ||||
|     { | ||||
|         if ((pZip->m_total_files > MZ_UINT32_MAX) || (pState->m_central_dir.m_size >= MZ_UINT32_MAX)) | ||||
|         if (((mz_uint64)pZip->m_total_files > MZ_UINT32_MAX) || (pState->m_central_dir.m_size >= MZ_UINT32_MAX)) | ||||
|             return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES); | ||||
|     } | ||||
|     else | ||||
|   | ||||
		Reference in New Issue
	
	Block a user