PastaPastaPasta
commented at 6:02 PM on December 20, 2021:
contributor
See #23810 for more context. This is broken out from that PR, as it is less breaking, and should be trivial to review and merge.
EDIT: Long term, the intention is to remove all C-style casts, as they can dangerously introduce reinterpret_casts. This is one step which removes a number of trivially removable C-style casts
DrahtBot added the label Consensus on Dec 20, 2021
DrahtBot added the label P2P on Dec 20, 2021
DrahtBot added the label Refactoring on Dec 20, 2021
DrahtBot added the label Utils/log/libs on Dec 20, 2021
DrahtBot added the label Validation on Dec 20, 2021
DrahtBot added the label Wallet on Dec 20, 2021
DrahtBot
commented at 3:04 AM on December 21, 2021:
contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
No conflicts as of last run.
maflcko removed the label Wallet on Dec 21, 2021
maflcko removed the label P2P on Dec 21, 2021
maflcko removed the label Validation on Dec 21, 2021
maflcko removed the label Consensus on Dec 21, 2021
maflcko removed the label Utils/log/libs on Dec 21, 2021
maflcko
commented at 9:23 AM on December 21, 2021:
member
Concept ACK. I think this is fine to do because:
C++11 braced init is safer, since it has more compile time checks
This patch has no conflicts as of now
bitcoind is not changed by this patch. I checked clang++ -O2 and g++ -O2 on my system.
Instead of linking to a pull request for context, I think OP can be improved to give a clear motivation. I think this patch is by itself worthwhile and should be considered independent of the other pull request.
However, I can also see a point about not changing existing code for style reasons, unless it is touched.
shaavan approved
shaavan
commented at 10:18 AM on December 21, 2021:
contributor
ACK9db89e1efa4332109eb1cb53e153844797a60350
I agree with the reason given by @MarcoFalke in the above comment.
C++11 braced init is safer since it has more compile-time checks
This patch has no conflicts as of now
I have reviewed the code, and I think all the appropriate changes are correctly made in this PR.
However, I can also see a point about not changing existing code for style reasons unless it is touched.
It makes sense. But these style changes will need to be done sooner or later. And since there are not many conflicts (as of now) for this PR, I think these changes can be safely integrated into the codebase.
maflcko
commented at 1:16 PM on December 21, 2021:
member
I took another look here and it seems the changes are incomplete. For example, there are a lot of occurrences in the RPC layer:
If the changes are made complete here, it will probably be a change too large and not worth it, so I'll downgrade my ACK to a -0.
PastaPastaPasta renamed this: refactor: use braced init for integer constants instead of c style casts refactor: use braced init for integer literals instead of c style casts on Dec 21, 2021
PastaPastaPasta
commented at 4:24 PM on December 21, 2021:
contributor
I took another look here and it seems the changes are incomplete. For example, there are a lot of occurrences in the RPC layer:
If the changes are made complete here, it will probably be a change too large and not worth it, so I'll downgrade my ACK to a -0.
@MarcoFalke the purpose of this PR is to not be complete :D If it was complete, it would simply be #23810.
The scope of this PR as I understand it (although original title was misleading), was to only apply this to integer literals (I originally said "integer constants").
I could expand the scope to all integer constants, but that would potentially be too breaking (according to what you've said). Let's maybe do that in the future.
PastaPastaPasta
commented at 6:46 PM on December 28, 2021:
contributor
@MarcoFalke Did my scope clarification (PR only intended to touch integer literals) clarify your concerns? It seems to me this PR only would cause conflicts in two other PRs, so there being lot's of conflicts isn't a concern, and it shouldn't change the binary.
PastaPastaPasta
commented at 2:35 AM on January 10, 2022:
contributor
@MarcoFalke if possible, I'd like to continue moving forward with this. Did you have any concerns I haven't addressed?
DrahtBot added the label Needs rebase on Jan 27, 2022
PastaPastaPasta force-pushed on Jan 28, 2022
PastaPastaPasta
commented at 4:57 AM on January 28, 2022:
contributor
I have rebased this PR now that #23438 has been merged.
@ajtowns@achow101, this PR will cause a few minor and easily resolvable conflicts in your PR (#24032, #23304). Do either of you have an objection to this PR being merged, and hence requiring a rebase in your PRs?
ajtowns
commented at 6:23 AM on January 28, 2022:
contributor
24032 will need a rebase after #23508 is merged anyway
DrahtBot removed the label Needs rebase on Jan 28, 2022
DrahtBot added the label Needs rebase on Mar 2, 2022
PastaPastaPasta force-pushed on Mar 7, 2022
DrahtBot removed the label Needs rebase on Mar 7, 2022
DrahtBot added the label Needs rebase on May 12, 2022
PastaPastaPasta force-pushed on May 13, 2022
DrahtBot removed the label Needs rebase on May 13, 2022
DrahtBot added the label Needs rebase on Jun 9, 2022
PastaPastaPasta force-pushed on Jun 9, 2022
DrahtBot removed the label Needs rebase on Jun 9, 2022
DrahtBot added the label Needs rebase on Jul 27, 2022
glozow
commented at 10:01 AM on September 26, 2022:
member
PastaPastaPasta
commented at 10:02 AM on September 26, 2022:
contributor
I'd love for it to get merged. And would be happy to rebase it. But it seems like most maintainers here don't actually want to review / merge it sadly.
PastaPastaPasta force-pushed on Sep 29, 2022
PastaPastaPasta
commented at 7:38 PM on September 29, 2022:
contributor
Rebased :) Hopefully we can get a few reviews on this simple PR. I have liked seeing in my continued rebases as we are refactoring places where ints were previously used and are now using dedicated types that actually mean something.
DrahtBot removed the label Needs rebase on Sep 29, 2022
DrahtBot added the label Needs rebase on Jan 4, 2023
refactor: use braced init for integer constants instead of c style castsf2fc03ec85
PastaPastaPasta force-pushed on Jan 4, 2023
DrahtBot removed the label Needs rebase on Jan 4, 2023
aureleoules approved
aureleoules
commented at 10:22 AM on January 4, 2023:
member
ACKf2fc03ec856d7d19a20c482514350cced38f9504
Verified no values are being changed.
maflcko
commented at 4:29 PM on January 5, 2023:
member
Checked that f2fc03ec856d7d19a20c482514350cced38f9504 does not change the binary on my system with my compiler
maflcko merged this on Jan 5, 2023
maflcko closed this on Jan 5, 2023
sidhujag referenced this in commit 864cda4aa1 on Jan 6, 2023
PastaPastaPasta deleted the branch on Feb 19, 2023
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-15 00:14 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me