Use static_cast instead of C-style casts for non-fundamental types
Summary:
A C-style cast is equivalent to try casting in the following order:
- const_cast(...)
- static_cast(...)
- const_cast(static_cast(...))
- reinterpret_cast(...)
- const_cast(reinterpret_cast(...))
By using static_cast<T>(...) explicitly we avoid the possibility
of an unintentional and dangerous reinterpret_cast. Furthermore
static_cast<T>(...) allows for easier grepping of casts. Please enter the commit message for your changes. Lines starting
Backport of Core PR10498
https://github.com/bitcoin/bitcoin/pull/10498
Completes T555
Test Plan:
make check
test_runner.py
Reviewers: jasonbcox, deadalnix, Fabien, O1 Bitcoin ABC, #bitcoin_abc
Reviewed By: jasonbcox, O1 Bitcoin ABC, #bitcoin_abc
Subscribers: schancel
Differential Revision: https://reviews.bitcoinabc.org/D2765