From 048438345aed2acbb044e107946a804bc2d02363 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 19 Feb 2010 18:02:38 +0000 Subject: fix compiler warning --- lib/Makefile.Watcom | 3 ++- lib/Makefile.inc | 6 ++++-- lib/Makefile.riscos | 5 ++++- lib/Makefile.vc6 | 1 + lib/makefile.amiga | 3 ++- lib/warnless.c | 40 ++++++++++++++++++++++++++++++++++++++++ lib/warnless.h | 28 ++++++++++++++++++++++++++++ 7 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 lib/warnless.c create mode 100644 lib/warnless.h (limited to 'lib') diff --git a/lib/Makefile.Watcom b/lib/Makefile.Watcom index 05eb41810..544e7a234 100644 --- a/lib/Makefile.Watcom +++ b/lib/Makefile.Watcom @@ -52,7 +52,8 @@ CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c & inet_ntop.c parsedate.c select.c gtls.c sslgen.c tftp.c splay.c & strdup.c socks.c ssh.c nss.c qssl.c rawstr.c curl_addrinfo.c & socks_gssapi.c socks_sspi.c curl_sspi.c slist.c nonblock.c & - curl_memrchr.c imap.c pop3.c smtp.c pingpong.c rtsp.c curl_threads.c + curl_memrchr.c imap.c pop3.c smtp.c pingpong.c rtsp.c curl_threads.c & + warnless.c OBJS = $(CSOURCES:.c=.obj) OBJS = $OBJ_DIR\$(OBJS: = $OBJ_DIR\) diff --git a/lib/Makefile.inc b/lib/Makefile.inc index 90d6fec81..9803c8c17 100644 --- a/lib/Makefile.inc +++ b/lib/Makefile.inc @@ -11,7 +11,8 @@ CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c \ inet_ntop.c parsedate.c select.c gtls.c sslgen.c tftp.c splay.c \ strdup.c socks.c ssh.c nss.c qssl.c rawstr.c curl_addrinfo.c \ socks_gssapi.c socks_sspi.c curl_sspi.c slist.c nonblock.c \ - curl_memrchr.c imap.c pop3.c smtp.c pingpong.c rtsp.c curl_threads.c + curl_memrchr.c imap.c pop3.c smtp.c pingpong.c rtsp.c curl_threads.c \ + warnless.c HHEADERS = arpa_telnet.h netrc.h file.h timeval.h qssl.h hostip.h \ progress.h formdata.h cookie.h http.h sendf.h ftp.h url.h dict.h \ @@ -23,4 +24,5 @@ HHEADERS = arpa_telnet.h netrc.h file.h timeval.h qssl.h hostip.h \ transfer.h select.h easyif.h multiif.h parsedate.h sslgen.h gtls.h \ tftp.h sockaddr.h splay.h strdup.h setup_once.h socks.h ssh.h nssg.h \ curl_base64.h rawstr.h curl_addrinfo.h curl_sspi.h slist.h nonblock.h \ - curl_memrchr.h imap.h pop3.h smtp.h pingpong.h rtsp.h curl_threads.h + curl_memrchr.h imap.h pop3.h smtp.h pingpong.h rtsp.h curl_threads.h \ + warnless.h diff --git a/lib/Makefile.riscos b/lib/Makefile.riscos index 57475e4d0..f7b071f34 100644 --- a/lib/Makefile.riscos +++ b/lib/Makefile.riscos @@ -15,7 +15,7 @@ objs = o.base64 o.connect o.cookie o.dict \ o.transfer o.url o.version o.strtoofft o.sslgen o.gtls \ o.rawstr o.curl_addrinfo o.slist o.nonblock o.curl_rand \ o.curl_memrchr o.imap o.pop3 o.smtp o.pingpong o.rtsp \ - o.curl_threads + o.curl_threads o.warnless # Compile options: @@ -191,3 +191,6 @@ o.url: c.url o.version: c.version gcc $(compileropts) -c -o version.o c.version + +o.warnless: c.warnless + gcc $(compileropts) -c -o warnless.o c.warnless diff --git a/lib/Makefile.vc6 b/lib/Makefile.vc6 index 442595596..2262444e3 100644 --- a/lib/Makefile.vc6 +++ b/lib/Makefile.vc6 @@ -517,6 +517,7 @@ X_OBJS= \ $(DIROBJ)\transfer.obj \ $(DIROBJ)\url.obj \ $(DIROBJ)\version.obj \ + $(DIROBJ)\warnless.obj \ $(RESOURCE) all : $(TARGET) diff --git a/lib/makefile.amiga b/lib/makefile.amiga index 7d1b062c7..4d63e04a0 100644 --- a/lib/makefile.amiga +++ b/lib/makefile.amiga @@ -22,7 +22,8 @@ OBJS = amigaos.c \ inet_ntop.c parsedate.c select.c gtls.c sslgen.c tftp.c splay.c \ strdup.c socks.c ssh.c nss.c qssl.c rawstr.c curl_addrinfo.c \ socks_gssapi.c socks_sspi.c curl_sspi.c slist.c nonblock.c \ - curl_memrchr.c imap.c pop3.c smtp.c pingpong.c rtsp.c curl_threads.c + curl_memrchr.c imap.c pop3.c smtp.c pingpong.c rtsp.c curl_threads.c \ + warnless.c all: $(OBJS:.c=.o) ar cru libcurl.a $(OBJS:.c=.o) diff --git a/lib/warnless.c b/lib/warnless.c new file mode 100644 index 000000000..83a1c68ab --- /dev/null +++ b/lib/warnless.c @@ -0,0 +1,40 @@ +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://curl.haxx.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * $Id$ + ***************************************************************************/ + +#include "setup.h" + +#include "warnless.h" + +unsigned short Curl_ultous(unsigned long ulnum) +{ +#ifdef __INTEL_COMPILER +# pragma warning(push) +# pragma warning(disable:810) /* conversion may lose significant bits */ +#endif + + return (unsigned short)(ulnum & 0xFFFFUL); + +#ifdef __INTEL_COMPILER +# pragma warning(pop) +#endif +} diff --git a/lib/warnless.h b/lib/warnless.h new file mode 100644 index 000000000..cd257d3ed --- /dev/null +++ b/lib/warnless.h @@ -0,0 +1,28 @@ +#ifndef HEADER_CURL_WARNLESS_H +#define HEADER_CURL_WARNLESS_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://curl.haxx.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * $Id$ + ***************************************************************************/ + +unsigned short Curl_ultous(unsigned long ulnum); + +#endif /* HEADER_CURL_WARNLESS_H */ -- cgit v1.2.3