Fix "Comparison result always 0" warnings with OpenWatcom

This commit is contained in:
Cameron Cawley
2021-07-20 17:48:56 +01:00
parent 46347635c8
commit f542e6df73
5 changed files with 7 additions and 7 deletions

View File

@@ -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");

View File

@@ -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");

View File

@@ -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");

View File

@@ -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;

View File

@@ -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