Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nss: fix MinGW compiler warnings #1393

Merged
merged 1 commit into from Apr 18, 2017
Merged

Conversation

MarcelRaad
Copy link
Member

@MarcelRaad MarcelRaad commented Apr 6, 2017

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

@mention-bot
Copy link

@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 April 15, 2017 21:41
Copy link
Contributor

@kdudka kdudka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks!

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
@MarcelRaad
Copy link
Member Author

Thanks for the review Kamil!

@MarcelRaad MarcelRaad merged commit a4ff8a1 into curl:master Apr 18, 2017
@MarcelRaad MarcelRaad deleted the nss_warnings branch April 18, 2017 15:32
@lock lock bot locked as resolved and limited conversation to collaborators May 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

None yet

4 participants