Files
bitcoin/src
fanquake f57e724a80 Merge bitcoin/bitcoin#28127: refactor: Remove C-style const-violating cast, Use reinterpret_cast
fa9108f85a refactor: Use reinterpret_cast where appropriate (MarcoFalke)
3333f950d4 refactor: Avoid casting away constness (MarcoFalke)
fa6394dd10 refactor: Remove unused C-style casts (MarcoFalke)

Pull request description:

  Using a C-style cast to convert pointer types to a byte-like pointer type has many issues:

  * It may accidentally and silently throw away `const`.
  * It forces reviewers to check that it doesn't accidentally throw away `const`.

  For example, on current master a `const char*` is cast to `unsigned char*` (without `const`), see d23fda0584/src/span.h (L273) . This can lead to UB, and the only reason why it didn't lead to UB is because the return type added back the `const`. (Obviously this would break if the return type was deduced via `auto`)

  Fix all issues by adding back the `const` and using `reinterpret_cast` where appropriate.

ACKs for top commit:
  darosior:
    re-utACK fa9108f85a
  hebasto:
    re-ACK fa9108f85a.
  john-moffett:
    ACK fa9108f85a

Tree-SHA512: 87f6e4b574f9bd96d4e0f2a0631fd0a9dc6096e5d4f1b95042fe9f197afc2fe9a24e333aeb34fed11feefcdb184a238fe1ea5aff10d580bb18d76bfe48b76a10
2023-07-26 16:03:39 +01:00
..
2023-06-29 16:14:07 -06:00
2023-05-26 15:47:55 -07:00
2023-03-23 12:55:18 +01:00
2022-12-24 23:49:50 +00:00
2023-06-16 10:38:19 +01:00
2023-01-05 09:05:14 +00:00
2023-06-16 10:38:19 +01:00
2023-03-23 19:38:38 +01:00
2023-03-23 19:38:38 +01:00
2023-03-23 12:55:18 +01:00
2022-12-24 23:49:50 +00:00
2023-03-23 12:55:18 +01:00
2023-06-16 10:38:19 +01:00
2023-07-17 13:27:46 +02:00
2022-12-24 23:49:50 +00:00
2022-12-24 23:49:50 +00:00
2022-12-24 23:49:50 +00:00
2023-01-12 13:42:44 +00:00
2023-06-16 10:38:19 +01:00
2023-06-30 12:09:45 +02:00
2023-01-25 09:33:26 +01:00
2023-06-16 10:38:19 +01:00
2023-03-23 12:55:18 +01:00