summaryrefslogtreecommitdiff
path: root/lib/warnless.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2012-03-16 19:06:34 +0100
committerYang Tse <yangsita@gmail.com>2012-03-16 19:06:34 +0100
commit8af4b657d0f44bd6f2b1d672666c046e53af0e0c (patch)
treee65809f4fb6fe2e4bde8449849025d39883efc83 /lib/warnless.c
parent97386c3c84251ca6a185916b28e61c100a901c1a (diff)
downloadcurl-8af4b657d0f44bd6f2b1d672666c046e53af0e0c.tar.gz
fix some compiler warnings
Diffstat (limited to 'lib/warnless.c')
-rw-r--r--lib/warnless.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/warnless.c b/lib/warnless.c
index acdcb26ea..5fbc23400 100644
--- a/lib/warnless.c
+++ b/lib/warnless.c
@@ -287,6 +287,25 @@ size_t curlx_sotouz(curl_off_t sonum)
}
/*
+** 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
*/