warnless.c: fix compiler warnings

This commit is contained in:
Yang Tse 2012-12-15 20:31:42 +01:00
parent 87e8691e7c
commit f6af9d9886

View File

@ -204,7 +204,9 @@ unsigned long curlx_uztoul(size_t uznum)
# pragma warning(disable:810) /* conversion may lose significant bits */
#endif
#if (CURL_SIZEOF_LONG < SIZEOF_SIZE_T)
DEBUGASSERT(uznum <= (size_t) CURL_MASK_ULONG);
#endif
return (unsigned long)(uznum & (size_t) CURL_MASK_ULONG);
#ifdef __INTEL_COMPILER
@ -223,7 +225,9 @@ unsigned int curlx_uztoui(size_t uznum)
# pragma warning(disable:810) /* conversion may lose significant bits */
#endif
#if (SIZEOF_INT < SIZEOF_SIZE_T)
DEBUGASSERT(uznum <= (size_t) CURL_MASK_UINT);
#endif
return (unsigned int)(uznum & (size_t) CURL_MASK_UINT);
#ifdef __INTEL_COMPILER
@ -243,7 +247,9 @@ int curlx_sltosi(long slnum)
#endif
DEBUGASSERT(slnum >= 0);
#if (SIZEOF_INT < CURL_SIZEOF_LONG)
DEBUGASSERT((unsigned long) slnum <= (unsigned long) CURL_MASK_SINT);
#endif
return (int)(slnum & (long) CURL_MASK_SINT);
#ifdef __INTEL_COMPILER
@ -263,7 +269,9 @@ unsigned int curlx_sltoui(long slnum)
#endif
DEBUGASSERT(slnum >= 0);
#if (SIZEOF_INT < CURL_SIZEOF_LONG)
DEBUGASSERT((unsigned long) slnum <= (unsigned long) CURL_MASK_UINT);
#endif
return (unsigned int)(slnum & (long) CURL_MASK_UINT);
#ifdef __INTEL_COMPILER
@ -341,7 +349,9 @@ int curlx_sztosi(ssize_t sznum)
#endif
DEBUGASSERT(sznum >= 0);
#if (SIZEOF_INT < SIZEOF_SIZE_T)
DEBUGASSERT((size_t) sznum <= (size_t) CURL_MASK_SINT);
#endif
return (int)(sznum & (ssize_t) CURL_MASK_SINT);
#ifdef __INTEL_COMPILER