mirror of
https://github.com/curl/curl.git
synced 2025-02-23 15:10:03 +08:00
warnless.c: fix compiler warnings
This commit is contained in:
parent
87e8691e7c
commit
f6af9d9886
@ -204,7 +204,9 @@ unsigned long curlx_uztoul(size_t uznum)
|
|||||||
# pragma warning(disable:810) /* conversion may lose significant bits */
|
# pragma warning(disable:810) /* conversion may lose significant bits */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (CURL_SIZEOF_LONG < SIZEOF_SIZE_T)
|
||||||
DEBUGASSERT(uznum <= (size_t) CURL_MASK_ULONG);
|
DEBUGASSERT(uznum <= (size_t) CURL_MASK_ULONG);
|
||||||
|
#endif
|
||||||
return (unsigned long)(uznum & (size_t) CURL_MASK_ULONG);
|
return (unsigned long)(uznum & (size_t) CURL_MASK_ULONG);
|
||||||
|
|
||||||
#ifdef __INTEL_COMPILER
|
#ifdef __INTEL_COMPILER
|
||||||
@ -223,7 +225,9 @@ unsigned int curlx_uztoui(size_t uznum)
|
|||||||
# pragma warning(disable:810) /* conversion may lose significant bits */
|
# pragma warning(disable:810) /* conversion may lose significant bits */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (SIZEOF_INT < SIZEOF_SIZE_T)
|
||||||
DEBUGASSERT(uznum <= (size_t) CURL_MASK_UINT);
|
DEBUGASSERT(uznum <= (size_t) CURL_MASK_UINT);
|
||||||
|
#endif
|
||||||
return (unsigned int)(uznum & (size_t) CURL_MASK_UINT);
|
return (unsigned int)(uznum & (size_t) CURL_MASK_UINT);
|
||||||
|
|
||||||
#ifdef __INTEL_COMPILER
|
#ifdef __INTEL_COMPILER
|
||||||
@ -243,7 +247,9 @@ int curlx_sltosi(long slnum)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
DEBUGASSERT(slnum >= 0);
|
DEBUGASSERT(slnum >= 0);
|
||||||
|
#if (SIZEOF_INT < CURL_SIZEOF_LONG)
|
||||||
DEBUGASSERT((unsigned long) slnum <= (unsigned long) CURL_MASK_SINT);
|
DEBUGASSERT((unsigned long) slnum <= (unsigned long) CURL_MASK_SINT);
|
||||||
|
#endif
|
||||||
return (int)(slnum & (long) CURL_MASK_SINT);
|
return (int)(slnum & (long) CURL_MASK_SINT);
|
||||||
|
|
||||||
#ifdef __INTEL_COMPILER
|
#ifdef __INTEL_COMPILER
|
||||||
@ -263,7 +269,9 @@ unsigned int curlx_sltoui(long slnum)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
DEBUGASSERT(slnum >= 0);
|
DEBUGASSERT(slnum >= 0);
|
||||||
|
#if (SIZEOF_INT < CURL_SIZEOF_LONG)
|
||||||
DEBUGASSERT((unsigned long) slnum <= (unsigned long) CURL_MASK_UINT);
|
DEBUGASSERT((unsigned long) slnum <= (unsigned long) CURL_MASK_UINT);
|
||||||
|
#endif
|
||||||
return (unsigned int)(slnum & (long) CURL_MASK_UINT);
|
return (unsigned int)(slnum & (long) CURL_MASK_UINT);
|
||||||
|
|
||||||
#ifdef __INTEL_COMPILER
|
#ifdef __INTEL_COMPILER
|
||||||
@ -341,7 +349,9 @@ int curlx_sztosi(ssize_t sznum)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
DEBUGASSERT(sznum >= 0);
|
DEBUGASSERT(sznum >= 0);
|
||||||
|
#if (SIZEOF_INT < SIZEOF_SIZE_T)
|
||||||
DEBUGASSERT((size_t) sznum <= (size_t) CURL_MASK_SINT);
|
DEBUGASSERT((size_t) sznum <= (size_t) CURL_MASK_SINT);
|
||||||
|
#endif
|
||||||
return (int)(sznum & (ssize_t) CURL_MASK_SINT);
|
return (int)(sznum & (ssize_t) CURL_MASK_SINT);
|
||||||
|
|
||||||
#ifdef __INTEL_COMPILER
|
#ifdef __INTEL_COMPILER
|
||||||
|
Loading…
Reference in New Issue
Block a user