[TRIVIAL] Drop C headers in favour of C++-compatibility headers. #12184

pull ghost wants to merge 1 commits into bitcoin:master from changing 63 files +75 −75
  1. ghost commented at 6:51 PM on January 14, 2018: none

    No description provided.

  2. Drop C headers in favour of C++-compatibility headers. ac5284db2c
  3. jonasschnelli added the label Refactoring on Jan 14, 2018
  4. jonasschnelli commented at 7:35 PM on January 14, 2018: contributor
  5. MarcoFalke commented at 9:44 PM on January 14, 2018: member

    Related pull: #11261

  6. ghost commented at 10:04 PM on January 14, 2018: none

    There is though some utility to using the c++ headers. For example most math functions in C have arguments as double while in C++ the arguments are both floats and double and long double.

    I actually ended up doing this while I've seen a warning in some log10 usage saying that float was used and extended to double or something along the lines. Not a big deal though.

    Another benefit of using C++ headers is that names in the standard library are quite common and when you don't use namespaces you might shot yourself in the foot.

    And contrary to comments in the pull #11261 you don't need to specify the namespace for the integer types, that would be just overkill.

    Of course it's not a priority but as I was looking at the code I just picked some low hanging fruits.

  7. bolekC commented at 10:09 PM on January 14, 2018: none

    Any good reason why you have chosen only these 63 files for update?

  8. ghost commented at 10:14 PM on January 14, 2018: none

    I should have also included header files, I now realize, this shouldn't be a problem to add.

    I skipped over univalue as when compiling it is not compiled using the -std=c++11 CXXFLAG.

    Unlike #11261 I did not replace <limits.h> with <climits> as they do not provide similar information (see http://pubs.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html)

  9. practicalswift commented at 4:23 PM on February 8, 2018: contributor

    Concept ACK (see my PR #11261). But it should be done as a scripted-diff.

  10. laanwj commented at 6:32 PM on March 7, 2018: member

    This is not worth doing, IMO. It generates a ton of code churn and just really doesn't matter.

  11. laanwj closed this on Mar 7, 2018

  12. 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-17 15:15 UTC

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