From 8af4b657d0f44bd6f2b1d672666c046e53af0e0c Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 16 Mar 2012 19:06:34 +0100 Subject: fix some compiler warnings --- lib/warnless.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lib/warnless.c') diff --git a/lib/warnless.c b/lib/warnless.c index acdcb26ea..5fbc23400 100644 --- a/lib/warnless.c +++ b/lib/warnless.c @@ -286,6 +286,25 @@ size_t curlx_sotouz(curl_off_t sonum) #endif } +/* +** signed ssize_t to signed int +*/ + +int curlx_sztosi(ssize_t sznum) +{ +#ifdef __INTEL_COMPILER +# pragma warning(push) +# pragma warning(disable:810) /* conversion may lose significant bits */ +#endif + + DEBUGASSERT(sznum >= 0); + return (int)(sznum & (ssize_t) CURL_MASK_SINT); + +#ifdef __INTEL_COMPILER +# pragma warning(pop) +#endif +} + /* ** signed int to unsigned size_t */ -- cgit v1.2.3