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
1 changed files with 4 additions and 1 deletions

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
}