summaryrefslogtreecommitdiff
path: root/lib/warnless.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-12-01 23:33:43 +0100
committerYang Tse <yangsita@gmail.com>2010-12-01 23:33:43 +0100
commit7e3f0bffe5d930489db80e1d65c27fe44a51f6f4 (patch)
tree77c1c1161573e324846c8ee46857810613e4dde0 /lib/warnless.c
parent5d47bf377668846d915c3d8a3f22cfdf66041512 (diff)
downloadcurl-7e3f0bffe5d930489db80e1d65c27fe44a51f6f4.tar.gz
fix compiler warning: conversion may lose significant bits
Diffstat (limited to 'lib/warnless.c')
-rw-r--r--lib/warnless.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/lib/warnless.c b/lib/warnless.c
index 4f42dd07f..471e4b2c7 100644
--- a/lib/warnless.c
+++ b/lib/warnless.c
@@ -125,3 +125,57 @@ int curlx_uztosi(size_t uznum)
# pragma warning(pop)
#endif
}
+
+/*
+** signed long to signed int
+*/
+
+int curlx_sltosi(long slnum)
+{
+#ifdef __INTEL_COMPILER
+# pragma warning(push)
+# pragma warning(disable:810) /* conversion may lose significant bits */
+#endif
+
+ return (int)(slnum & (long) CURL_MASK_SINT);
+
+#ifdef __INTEL_COMPILER
+# pragma warning(pop)
+#endif
+}
+
+/*
+** signed long to unsigned int
+*/
+
+unsigned int curlx_sltoui(long slnum)
+{
+#ifdef __INTEL_COMPILER
+# pragma warning(push)
+# pragma warning(disable:810) /* conversion may lose significant bits */
+#endif
+
+ return (unsigned int)(slnum & (long) CURL_MASK_UINT);
+
+#ifdef __INTEL_COMPILER
+# pragma warning(pop)
+#endif
+}
+
+/*
+** signed long to unsigned short
+*/
+
+unsigned short curlx_sltous(long slnum)
+{
+#ifdef __INTEL_COMPILER
+# pragma warning(push)
+# pragma warning(disable:810) /* conversion may lose significant bits */
+#endif
+
+ return (unsigned short)(slnum & (long) CURL_MASK_USHORT);
+
+#ifdef __INTEL_COMPILER
+# pragma warning(pop)
+#endif
+}