]> granicus.if.org Git - curl/commitdiff
compiler warning: fix
authorYang Tse <yangsita@gmail.com>
Thu, 26 May 2011 13:44:53 +0000 (15:44 +0200)
committerYang Tse <yangsita@gmail.com>
Thu, 26 May 2011 13:44:53 +0000 (15:44 +0200)
Fix compiler warning: conversion may lose significant bits

lib/connect.c
lib/curl_addrinfo.c
lib/socks_gssapi.c
lib/socks_sspi.c
lib/warnless.c
lib/warnless.h

index 2dcf122c1b4e7f91849bfcef0a9e6b5bf65a25eb..369ba053e5dcb85baafcfa115c89be058a2fc1a9 100644 (file)
@@ -89,6 +89,7 @@
 #include "inet_pton.h"
 #include "sslgen.h" /* for Curl_ssl_check_cxn() */
 #include "progress.h"
+#include "warnless.h"
 
 /* The last #include file should be: */
 #include "memdebug.h"
index 023a00678c6b15b31668b915a0fca1164fefea0e..074bf17dc6dd98b1c4777f46f6f7fd412835217e 100644 (file)
@@ -50,6 +50,7 @@
 
 #include "curl_addrinfo.h"
 #include "inet_pton.h"
+#include "warnless.h"
 
 #define _MPRINTF_REPLACE /* use our functions only */
 #include <curl/mprintf.h>
index f0d503c919ab7f3b1bd45980e2f98019cd996370..653306cce8578a1bea5ef66d1ad350e4fba02360 100644 (file)
@@ -42,8 +42,7 @@
 #include "connect.h"
 #include "timeval.h"
 #include "socks.h"
-
-static gss_ctx_id_t     gss_context = GSS_C_NO_CONTEXT;
+#include "warnless.h"
 
 #define _MPRINTF_REPLACE /* use our functions only */
 #include <curl/mprintf.h>
@@ -52,6 +51,8 @@ static gss_ctx_id_t     gss_context = GSS_C_NO_CONTEXT;
 /* The last #include file should be: */
 #include "memdebug.h"
 
+static gss_ctx_id_t gss_context = GSS_C_NO_CONTEXT;
+
 /*
  * Helper gssapi error functions.
  */
index 2532eda23c7b0bdb1cec3e9c84cad81c26c7b65c..6d42af3a5bf97660a786ae80e1106679318ced0d 100644 (file)
@@ -37,6 +37,7 @@
 #include "timeval.h"
 #include "socks.h"
 #include "curl_sspi.h"
+#include "warnless.h"
 
 #define _MPRINTF_REPLACE /* use the internal *printf() functions */
 #include <curl/mprintf.h>
index 89abd14bcce364e0870622a8bca0c34d4a904b83..0f7814b274ec4fe41bd0b901843ed063607004f1 100644 (file)
@@ -280,4 +280,20 @@ void curlx_FD_ZERO(fd_set *fdset)
   #pragma warning(pop)
 }
 
+unsigned short curlx_htons(unsigned short usnum)
+{
+  #pragma warning(push)
+  #pragma warning(disable:810) /* conversion may lose significant bits */
+  return htons(usnum);
+  #pragma warning(pop)
+}
+
+unsigned short curlx_ntohs(unsigned short usnum)
+{
+  #pragma warning(push)
+  #pragma warning(disable:810) /* conversion may lose significant bits */
+  return ntohs(usnum);
+  #pragma warning(pop)
+}
+
 #endif /* __INTEL_COMPILER && __unix__ */
index dfa16ef290e81a136623397cda22e8abd6816007..9ac59ac29bb139e7920678f345ec4a802e748501 100644 (file)
@@ -46,6 +46,10 @@ void curlx_FD_SET(int fd, fd_set *fdset);
 
 void curlx_FD_ZERO(fd_set *fdset);
 
+unsigned short curlx_htons(unsigned short usnum);
+
+unsigned short curlx_ntohs(unsigned short usnum);
+
 #ifndef BUILDING_WARNLESS_C
 #  undef  FD_ISSET
 #  define FD_ISSET(a,b) curlx_FD_ISSET((a),(b))
@@ -53,6 +57,10 @@ void curlx_FD_ZERO(fd_set *fdset);
 #  define FD_SET(a,b)   curlx_FD_SET((a),(b))
 #  undef  FD_ZERO
 #  define FD_ZERO(a)    curlx_FD_ZERO((a))
+#  undef  htons
+#  define htons(a)      curlx_htons((a))
+#  undef  ntohs
+#  define ntohs(a)      curlx_ntohs((a))
 #endif
 
 #endif /* __INTEL_COMPILER && __unix__ */