cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH] Three trivial warning fixes

From: Myria <myriachan_at_cox.net>
Date: Wed, 4 Dec 2013 21:33:57 -0800

I see your point; older compilers like Visual Studio 1998 (VC6) probably
defined the return value of _beginthreadex as "unsigned". These sort of
64-bit portability issues weren't addressed until the Win64 compiler was
developed for Visual Studio 2002/2003; this was the Itanium preview
compiler.

Perhaps this would be a better definition:
(curl_thread_t)(((char *) NULL) - 1)

Alternatively, since we're already #including <Windows.h>, this is also a
valid option, which I like the most:
(curl_thread_t)INVALID_HANDLE_VALUE

The Windows header already took care of the cast. For example, in the
newest SDK, 8.1's:
#define INVALID_HANDLE_VALUE ((HANDLE)(LONG_PTR)-1)

This macro has existed, though not with LONG_PTR, since the beginning of
Win32 in NT 3.1; it's the failure return code for CreateFileW.

-----Original Message-----
From: Steve Holme
Sent: Wednesday, December 4, 2013 12:47 PM
To: 'libcurl development'
Subject: RE: [PATCH] Three trivial warning fixes

> On Wed, 4 Dec 2013, myriachan_at_cox.net wrote:

> Rather than patch it up as myself, and take credit for it, could you
> please submit git patches against the latest version of code in the
> repository as per the following link? It will also help the other
> reviewers here as well as provide a speedy resolution ;-)
>
> OK, I've attached git versions of these patches to this email that I
> made in Linux according to those instructions.

Many thanks. I have pushed patch #2 as commit b0b5b511935669, however:

a) I'm not sure about Patch #1 myself as I don't think intptr_t is C89
compliant so I believe we would need to define that type ourselves for
systems that don't include it (like we do with size_t), however, that isn't
my area of expertise so I'm quite willing to be bow to the knowledge of
others and be proved wrong ;-)

b) I would recommend Nick takes a look at Patch #3 as he is our resident
Darwin SSL expert.

> I don't know whether I did this right, since I'm a Windows person
> who far prefers Subversion.

Yep perfect. Me too - I've used Subversion, Clearcase and good ol'
SourceSafe before (not to mention Microsoft Delta but that's showing my
age!!).

I would recommend installing TortoiseGIT (which I'm sure you'll find
familiar) and its dependency (msysgit). They can be found at:

http://code.google.com/p/tortoisegit/

http://code.google.com/p/msysgit/

> Why does the web site have instructions for the non-git case when
> that's not the form the mailing list wants?

I'm not entirely sure myself... In the 2 and half years that I have been
contributing to curl I, like yourself, submitted patches to the mailing list
to begin with but using TortoiseGIT instead and over that time I can
probably count on one hand the number of times I've seen other types of
patch ;-)

Many thanks again.

Regards

Steve

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-12-05