diff options
author | Steve Holme <steve_holme@hotmail.com> | 2014-03-23 12:46:54 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2014-05-22 21:01:51 +0100 |
commit | a7999da39e2788b086f5302f81128a9ad26c274b (patch) | |
tree | 6f2f5737571b13e87ced1dede1ea77b2b4649d15 /lib | |
parent | 415c982afb0b5348b1e994c2e723e43ac4d6ad84 (diff) |
tool_getparam.c: Fixed compilation warnings
There is an implicit conversion from "unsigned long" to "long"
Diffstat (limited to 'lib')
-rw-r--r-- | lib/warnless.c | 19 | ||||
-rw-r--r-- | lib/warnless.h | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/lib/warnless.c b/lib/warnless.c index 778f098f5..8c130d34c 100644 --- a/lib/warnless.c +++ b/lib/warnless.c @@ -175,6 +175,25 @@ int curlx_ultosi(unsigned long ulnum) } /* +** unsigned size_t to signed curl_off_t +*/ + +curl_off_t curlx_uztoso(size_t uznum) +{ +#ifdef __INTEL_COMPILER +# pragma warning(push) +# pragma warning(disable:810) /* conversion may lose significant bits */ +#endif + + DEBUGASSERT(uznum <= (size_t) CURL_MASK_SCOFFT); + return (curl_off_t)(uznum & (size_t) CURL_MASK_SCOFFT); + +#ifdef __INTEL_COMPILER +# pragma warning(pop) +#endif +} + +/* ** unsigned size_t to signed int */ diff --git a/lib/warnless.h b/lib/warnless.h index 33368d207..ad77d3c20 100644 --- a/lib/warnless.h +++ b/lib/warnless.h @@ -34,6 +34,8 @@ int curlx_ultosi(unsigned long ulnum); int curlx_uztosi(size_t uznum); +curl_off_t curlx_uztoso(size_t uznum); + unsigned long curlx_uztoul(size_t uznum); unsigned int curlx_uztoui(size_t uznum); |