1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

compiler warning: fix

Fix compiler warning: conversion may lose significant bits
This commit is contained in:
Yang Tse 2011-05-26 15:44:53 +02:00
parent c8c8816a97
commit 3c9ff41a1f
6 changed files with 30 additions and 2 deletions

View File

@ -89,6 +89,7 @@
#include "inet_pton.h" #include "inet_pton.h"
#include "sslgen.h" /* for Curl_ssl_check_cxn() */ #include "sslgen.h" /* for Curl_ssl_check_cxn() */
#include "progress.h" #include "progress.h"
#include "warnless.h"
/* The last #include file should be: */ /* The last #include file should be: */
#include "memdebug.h" #include "memdebug.h"

View File

@ -50,6 +50,7 @@
#include "curl_addrinfo.h" #include "curl_addrinfo.h"
#include "inet_pton.h" #include "inet_pton.h"
#include "warnless.h"
#define _MPRINTF_REPLACE /* use our functions only */ #define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h> #include <curl/mprintf.h>

View File

@ -42,8 +42,7 @@
#include "connect.h" #include "connect.h"
#include "timeval.h" #include "timeval.h"
#include "socks.h" #include "socks.h"
#include "warnless.h"
static gss_ctx_id_t gss_context = GSS_C_NO_CONTEXT;
#define _MPRINTF_REPLACE /* use our functions only */ #define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h> #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: */ /* The last #include file should be: */
#include "memdebug.h" #include "memdebug.h"
static gss_ctx_id_t gss_context = GSS_C_NO_CONTEXT;
/* /*
* Helper gssapi error functions. * Helper gssapi error functions.
*/ */

View File

@ -37,6 +37,7 @@
#include "timeval.h" #include "timeval.h"
#include "socks.h" #include "socks.h"
#include "curl_sspi.h" #include "curl_sspi.h"
#include "warnless.h"
#define _MPRINTF_REPLACE /* use the internal *printf() functions */ #define _MPRINTF_REPLACE /* use the internal *printf() functions */
#include <curl/mprintf.h> #include <curl/mprintf.h>

View File

@ -280,4 +280,20 @@ void curlx_FD_ZERO(fd_set *fdset)
#pragma warning(pop) #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__ */ #endif /* __INTEL_COMPILER && __unix__ */

View File

@ -46,6 +46,10 @@ void curlx_FD_SET(int fd, fd_set *fdset);
void curlx_FD_ZERO(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 #ifndef BUILDING_WARNLESS_C
# undef FD_ISSET # undef FD_ISSET
# define FD_ISSET(a,b) curlx_FD_ISSET((a),(b)) # 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)) # define FD_SET(a,b) curlx_FD_SET((a),(b))
# undef FD_ZERO # undef FD_ZERO
# define FD_ZERO(a) curlx_FD_ZERO((a)) # 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
#endif /* __INTEL_COMPILER && __unix__ */ #endif /* __INTEL_COMPILER && __unix__ */