miniscript: explicit cast instead of comparing integers of different signs #27382

pull darosior wants to merge 1 commits into bitcoin:master from darosior:miniscript_comp_int_size changing 1 files +1 −1
  1. darosior commented at 1:42 pm on March 31, 2023: member
    Fixes #27381
  2. DrahtBot commented at 1:42 pm on March 31, 2023: contributor

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK stickies-v

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. DrahtBot added the label Descriptors on Mar 31, 2023
  4. in src/script/miniscript.h:1197 in 5d6e691cde outdated
    1193@@ -1194,7 +1194,7 @@ struct Node {
    1194                 case Fragment::OR_I:
    1195                     return subs[0] || subs[1];
    1196                 case Fragment::THRESH:
    1197-                    return std::count(subs.begin(), subs.end(), true) >= node.k;
    1198+                    return unsigned(std::count(subs.begin(), subs.end(), true)) >= node.k;
    


    stickies-v commented at 3:13 pm on March 31, 2023:

    Maybe best to avoid C-style casts?

    0                    return static_cast<uint32_t>(std::count(subs.begin(), subs.end(), true)) >= node.k;
    

    darosior commented at 3:37 pm on March 31, 2023:
    Sure, done. (I don’t think it matters in this precise case though.)
  5. miniscript: explicit cast instead of comparing integers of different signs 9a54d88c8c
  6. darosior force-pushed on Mar 31, 2023
  7. stickies-v approved
  8. stickies-v commented at 4:11 pm on March 31, 2023: contributor
    ACK 9a54d88c8cb0c5d529f388c2ce53008e1ff126dd
  9. fanquake merged this on Apr 2, 2023
  10. fanquake closed this on Apr 2, 2023

  11. sidhujag referenced this in commit cf03fcd943 on Apr 2, 2023
  12. darosior deleted the branch on Apr 2, 2023
  13. bitcoin locked this on Apr 1, 2024

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 09:12 UTC

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