curl-library
[PATCH 1/3] curl_threads: Fix Windows 64-bit pointer warning
From: Melissa Mears <myriachan_at_cox.net>
Date: Tue, 3 Dec 2013 14:03:07 -0800
Date: Tue, 3 Dec 2013 14:03:07 -0800
Visual Studio generally warns when casting a 32-bit integer to pointer
type, because it presumes that you may have truncated a pointer in a
way that is nonportable to 64-bit builds. Here, the sign-extension of
-1 to pointer size is correct and matches the specification of
_beginthreadex, so we just cast to intptr_t to suppress the warning.
(intptr_t is tagged with the __w64 keyword to tell Visual Studio that
it is a type that expands to 64 bits in Win64, so it should not warn
about casts between pointers and intptr_t.)
---
lib/curl_threads.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/curl_threads.c b/lib/curl_threads.c
index c9e91f6..3282efa 100644
--- a/lib/curl_threads.c
+++ b/lib/curl_threads.c
@@ -104,7 +104,7 @@ curl_thread_t Curl_thread_create(unsigned int (CURL_STDCALL *func) (void*),
#else
curl_thread_t t;
t = (curl_thread_t)_beginthreadex(NULL, 0, func, arg, 0, NULL);
- if((t == 0) || (t == (curl_thread_t)-1L))
+ if((t == 0) || (t == (curl_thread_t)(intptr_t)-1L))
return curl_thread_t_null;
return t;
#endif
--
1.7.1
------=_Part_7185602_2084823767.1386116568140
Content-Type: application/octet-stream;
name=0002-pop3-Make-POP3_TYPE_ANY-unsigned-to-fix-warning.patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename=0002-pop3-Make-POP3_TYPE_ANY-unsigned-to-fix-warning.patch
Received on 2001-09-17