fix an incorrect if-clause in net.cpp #1225

pull Diapolo wants to merge 1 commits into bitcoin:master from Diapolo:net_cpp_if_clause changing 1 files +1 −1
  1. Diapolo commented at 9:04 PM on May 8, 2012: none
  2. laanwj commented at 9:06 PM on May 8, 2012: member

    sub-optimal? just call it incorrect :) (hSocketMax > (SOCKET) -1) is impossible to trigger.

  3. jgarzik commented at 9:08 PM on May 8, 2012: contributor

    It still needs the (SOCKET) cast to be portable to all platforms without warnings, I think

  4. laanwj commented at 9:10 PM on May 8, 2012: member

    Yes, it still needs the (SOCKET) cast, otherwise you'll be comparing a signed against an unsigned value.

  5. Diapolo commented at 9:13 PM on May 8, 2012: none

    :-P² All good ends well?

  6. laanwj commented at 6:51 AM on May 9, 2012: member

    If you don't like the magic value make it compare against INVALID_SOCKET. After all, it is a socket number. SOCKET_ERROR is a signed error value and is meant for comparing against wsaGetError() output.

    You wanted to compare against both INVALID_SOCKET and SOCKET_ERROR which is the part I disagreed with.

  7. fix an incorrect if-clause in net.cpp 3b6ed2294b
  8. Diapolo commented at 7:12 AM on May 9, 2012: none

    Updated and rebased!

  9. laanwj commented at 7:36 AM on May 9, 2012: member

    ACK

  10. jgarzik referenced this in commit d54e6e8359 on May 9, 2012
  11. jgarzik merged this on May 9, 2012
  12. jgarzik closed this on May 9, 2012

  13. coblee referenced this in commit 09a4b16264 on Jul 17, 2012
  14. suprnurd referenced this in commit 34fd8daf5a on Dec 5, 2017
  15. lateminer referenced this in commit 5ca5fbde4c on Jan 22, 2019
  16. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-20 00:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me