Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ryanofsky/bitcoin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: pr/bfmt.4-rebase
Choose a base ref
...
head repository: ryanofsky/bitcoin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: pr/bfmt.5
Choose a head ref
  • 6 commits
  • 16 files changed
  • 2 contributors

Commits on Nov 15, 2024

  1. refactor: Avoid concatenation of format strings

    Instead just concatenate already formatted strings. This allows untranslated
    format strings to be checked at compile time now, and translated format strings
    to be checked at compile time in bitcoin#31061.
    ryanofsky committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    9120245 View commit details
    Browse the repository at this point in the history
  2. refactor: Pick translated string after format

    This passes the return value of _() directly to strprintf so the format
    string can be checked at compile time in bitcoin#31061.
    MarcoFalke committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    b8bf7bf View commit details
    Browse the repository at this point in the history
  3. refactor: Tidy fixups

    Requested by clang-tidy:
    
    src/wallet/salvage.cpp:119:18: error: use emplace_back instead of push_back [modernize-use-emplace,-warnings-as-errors]
       119 |         warnings.push_back(Untranslated("Salvage: Database salvage found errors, all data may not be recoverable."));
           |                  ^~~~~~~~~~
           |                  emplace_back(
    MarcoFalke committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    d0695fe View commit details
    Browse the repository at this point in the history
  4. refactor: Don't embed translated string in untranslated string.

    This could produce an english error message containing non-english string
    fragments if PopulateAndValidateSnapshot started returning any translated
    strings in the future. This change is also needed to make the next
    scripted-diff commit work.
    ryanofsky committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    d392068 View commit details
    Browse the repository at this point in the history
  5. refactor: Use + instead of strformat to concatenate translated & untr…

    …anslated strings
    
    This change is needed to let the scripted-diff commit following this compile.
    
    It should also make code a little more obvious and easy to read.
    ryanofsky committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    75643fd View commit details
    Browse the repository at this point in the history
  6. scripted-diff: Replace strprintf(Untranslated) with Untranslated(strp…

    …rintf)
    
    This makes code more consistent and makes it easier to add compile-time checking to
    enforce that format strings contain the right specifiers, because it stops
    using Untranslated() to create the format string, so the Untranslated()
    function will not need to get involved in formatting.
    
    -BEGIN VERIFY SCRIPT-
    quote='"[^"]+"'
    quotes="(?:$quote|\\s)*"
    nonparens="[^()]*"
    single_level_paren="\($nonparens\)"
    double_level_paren="\($nonparens\($nonparens\)$nonparens\)"
    exprs="(?:$double_level_paren|$single_level_paren|$nonparens)*"
    git grep -l 'Untranslated' | xargs perl -0777 -i -pe "s/strprintf\((\\W*)Untranslated\(($quotes)\)($exprs)(\))/Untranslated(\1strprintf(\2\3))/gs"
    -END VERIFY SCRIPT-
    ryanofsky committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    85df2fb View commit details
    Browse the repository at this point in the history
Loading