nss: fix MinGW compiler warnings #1393

Merged
merged 1 commit into from Apr 18, 2017

Projects

None yet

4 participants

@MarcelRaad
Member
MarcelRaad commented Apr 6, 2017 edited

This fixes 3 warnings issued by MinGW:

  1. PR_ImportTCPSocket actually has a paramter of type PROsfd instead of
    PRInt32, which is 64 bits on Windows. Fixed this by including the
    corresponding header file instead of redeclaring the function, which is
    supported even though it is in the private include folder. [1]
  2. In 64-bit mode, size_t is 64 bits while CK_ULONG is 32 bits, so an explicit
    narrowing cast is needed.
  3. Curl_timeleft returns time_t instead of long since commit
    21aa32d.

[1] https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_ImportTCPSocket

@MarcelRaad, thanks for your PR! By analyzing the history of the files in this pull request, we identified @kdudka, @bagder and @captain-caveman2k to be potential reviewers.

@bagder bagder added the build label Apr 8, 2017
@bagder bagder requested a review from kdudka Apr 15, 2017
@kdudka
kdudka approved these changes Apr 18, 2017 View changes

Looks good to me. Thanks!

@MarcelRaad MarcelRaad nss: fix MinGW compiler warnings
This fixes 3 warnings issued by MinGW:
1. PR_ImportTCPSocket actually has a paramter of type PROsfd instead of
PRInt32, which is 64 bits on Windows. Fixed this by including the
corresponding header file instead of redeclaring the function, which is
supported even though it is in the private include folder. [1]
2. In 64-bit mode, size_t is 64 bits while CK_ULONG is 32 bits, so an explicit
narrowing cast is needed.
3. Curl_timeleft returns time_t instead of long since commit
21aa32d.

[1] https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_ImportTCPSocket

Closes curl#1393
a4ff8a1
Member

Thanks for the review Kamil!

@MarcelRaad MarcelRaad merged commit a4ff8a1 into curl:master Apr 18, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@MarcelRaad MarcelRaad deleted the MarcelRaad:nss_warnings branch Apr 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment