Page MenuHomePhabricator

Refactor: Replace fprintf with tfm::format
ClosedPublic

Authored by deadalnix on Apr 20 2020, 17:48.

Details

Summary
  • tinyformat: Add doc to Bitcoin Core specific strprintf
  • scripted-diff: Replace fprintf with tfm::format

-BEGIN VERIFY SCRIPT-
sed -i --regexp-extended -e 's/fprintf\(std(err|out), /tfm::format(std::c\1, /g' $(git grep -l 'fprintf(' -- ':(exclude)src/crypto' ':(exclude)src/leveldb' ':(exclude)src/univalue' ':(exclude)src/secp256k1')
-END VERIFY SCRIPT-

fixup! scripted-diff: Replace fprintf with tfm::format

  • Replace remaining fprintf with tfm::format manually

This is a backport of Core PR16205

Test Plan
grep -r ../src/ -e fprintf | grep -v leveldb | grep -v secp256k1 | grep -v univalue

Check that there are no mre unexpected callsites.

ninja all check-all
arc lint --everything

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

It is posted for reference as an alternative to D5779 .

Fabien added a subscriber: Fabien.

You may want to #include <tinyformat.h> where relevant to avoid indirect inclusion.

This revision is now accepted and ready to land.Apr 20 2020, 18:05
This revision was landed with ongoing or failed builds.Apr 20 2020, 18:08
This revision was automatically updated to reflect the committed changes.