No description provided.
[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-
ghost commented at 6:51 PM on January 14, 2018: none
-
Drop C headers in favour of C++-compatibility headers. ac5284db2c
- jonasschnelli added the label Refactoring on Jan 14, 2018
-
jonasschnelli commented at 7:35 PM on January 14, 2018: contributor
Thanks for contributing. Please also read https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#refactoring
-
MarcoFalke commented at 9:44 PM on January 14, 2018: member
Related pull: #11261
-
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.
-
bolekC commented at 10:09 PM on January 14, 2018: none
Any good reason why you have chosen only these 63 files for update?
-
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)
-
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. -
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.
- laanwj closed this on Mar 7, 2018
- MarcoFalke locked this on Sep 8, 2021