1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

warnless: suppress compiler warning

If size_t is 32 bits, MSVC warns:
warning C4310: cast truncates constant value
The warning is harmless as CURL_MASK_SCOFFT gets
truncated to the maximum value of size_t.
This commit is contained in:
Marcel Raad 2017-02-28 09:08:00 +01:00
parent 41388b9ba3
commit a162d8b21b
No known key found for this signature in database
GPG Key ID: B7F13D981BBF1607

View File

@ -183,12 +183,15 @@ curl_off_t curlx_uztoso(size_t uznum)
#ifdef __INTEL_COMPILER
# pragma warning(push)
# pragma warning(disable:810) /* conversion may lose significant bits */
#elif defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable:4310) /* cast truncates constant value */
#endif
DEBUGASSERT(uznum <= (size_t) CURL_MASK_SCOFFT);
return (curl_off_t)(uznum & (size_t) CURL_MASK_SCOFFT);
#ifdef __INTEL_COMPILER
#if defined(__INTEL_COMPILER) || defined(_MSC_VER)
# pragma warning(pop)
#endif
}