refactor: Preserve const in cast on CTransactionSignatureSerializer #21906

pull promag wants to merge 1 commits into bitcoin:master from promag:2021-05-fix-cast changing 1 files +2 −2
  1. promag commented at 6:21 pm on May 10, 2021: member
    It was casting from const unsigned char* to char*.
  2. refactor: Preserve const in cast on CTransactionSignatureSerializer c4928aa3d3
  3. DrahtBot added the label Consensus on May 10, 2021
  4. DrahtBot added the label Refactoring on May 10, 2021
  5. vasild approved
  6. vasild commented at 12:21 pm on May 11, 2021: member
    ACK c4928aa3d30a7b708ba99fc09ddc125257bfdd17
  7. theStack approved
  8. theStack commented at 12:17 pm on May 16, 2021: member
    ACK c4928aa3d30a7b708ba99fc09ddc125257bfdd17
  9. in src/script/interpreter.cpp:1306 in c4928aa3d3
    1302@@ -1303,12 +1303,12 @@ class CTransactionSignatureSerializer
    1303         it = itBegin;
    1304         while (scriptCode.GetOp(it, opcode)) {
    1305             if (opcode == OP_CODESEPARATOR) {
    1306-                s.write((char*)&itBegin[0], it-itBegin-1);
    1307+                s.write(reinterpret_cast<const char*>(&itBegin[0]), it-itBegin-1);
    


    MarcoFalke commented at 6:02 am on May 17, 2021:

    There is a safe helper CharCast and UCharCast, that can be used.

    Though, I have a patch (Bundle 2/2 of #21969) to remove char completely.


    MarcoFalke commented at 2:49 pm on June 6, 2021:
    See #22167

    MarcoFalke commented at 2:52 pm on November 4, 2021:

    See #22167

    See #23438 :sweat_smile:

  10. DrahtBot commented at 3:51 pm on June 6, 2021: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #22167 (refactor: Remove char serialize by MarcoFalke)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  11. promag commented at 6:14 pm on August 29, 2021: member
    Closing in favour of #22167.
  12. promag closed this on Aug 29, 2021

  13. promag deleted the branch on Aug 29, 2021
  14. laanwj referenced this in commit 196b459920 on Jan 27, 2022
  15. DrahtBot locked this on Nov 4, 2022

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: 2024-11-21 15:12 UTC

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