convert C-style (void) parameter lists to C++ style () #14214

pull arvidn wants to merge 1 commits into bitcoin:master from arvidn:void-refactor changing 16 files +27 −27
  1. arvidn commented at 6:29 PM on September 13, 2018: none

    In C, an empty parameter list, (), means the function takes any arguments, and (void) means the function does not take any parameters. In C++, an empty parameter list means the function does not take any parameters.

    So, C++ still supports (void) parameter lists with the same semantics, why change to ()?

    1. removing the redundant void improves signal-to-noise ratio of the code
    2. using (void) exposes a rare inconsistency in that a template taking a template (T) parameter list, cannot be instantiated with T=void
  2. convert C-style (void) parameter lists to C++ style () 3ccfa34b32
  3. promag commented at 6:58 PM on September 13, 2018: member

    Interesting. utACK 3ccfa34.

  4. practicalswift commented at 8:06 PM on September 13, 2018: contributor

    utACK 3ccfa34b32b7ed9d7bef05baa36827b4b262197e

    Nice cleanup!

  5. DrahtBot commented at 9:26 PM on September 13, 2018: member

    <!--e57a25ab6845829454e8d69fc972939a-->Note to reviewers: This pull request conflicts with the following ones:

    • #14267 (gui: Mark Qt methods as override where appropriate by Empact)
    • #14224 (Add -fsanitize=integer Travis job. Document intentional and unintentional unsigned integer overflows (wraparounds) using annotations. by practicalswift)
    • #13864 (validation: Document where we are intentionally ignoring bool return values from validation related functions by practicalswift)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  6. MarcoFalke commented at 9:33 PM on September 13, 2018: member

    I compiled with clang and the code change doesn't change a single bit of the bitcoind binary. (Didn't check test_bitcoin and bitcoin-qt)

  7. MarcoFalke added the label Refactoring on Sep 13, 2018
  8. ken2812221 commented at 1:29 AM on September 14, 2018: contributor

    utACK 3ccfa34

  9. l2a5b1 commented at 11:24 AM on September 15, 2018: contributor

    utACK 3ccfa34

    Nice cleanup indeed.

    NL.25: Don’t use void as an argument type "It’s verbose and only needed where C compatibility matters."

    As a nit, maybe replace the void () instances with void() in scheduler.

  10. MarcoFalke merged this on Sep 20, 2018
  11. MarcoFalke closed this on Sep 20, 2018

  12. MarcoFalke referenced this in commit 2796c6e5ec on Sep 20, 2018
  13. arvidn deleted the branch on Sep 21, 2018
  14. dartdart26 referenced this in commit 46700fa87f on Dec 6, 2018
  15. Munkybooty referenced this in commit 80a1a3b860 on Jul 9, 2021
  16. Munkybooty referenced this in commit b65cfbf695 on Jul 9, 2021
  17. Munkybooty referenced this in commit 44cea721cd on Jul 11, 2021
  18. Munkybooty referenced this in commit 456c5dc76c on Jul 12, 2021
  19. Munkybooty referenced this in commit b1398584c4 on Jul 12, 2021
  20. MarcoFalke 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-22 06:15 UTC

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