mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 18:20:58 +02:00
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
This commit is contained in:
@ -82,7 +82,7 @@ static int AppInitRawTx(int argc, char* argv[])
|
||||
SetupBitcoinTxArgs();
|
||||
std::string error;
|
||||
if (!gArgs.ParseParameters(argc, argv, error)) {
|
||||
fprintf(stderr, "Error parsing command line arguments: %s\n", error.c_str());
|
||||
tfm::format(std::cerr, "Error parsing command line arguments: %s\n", error.c_str());
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ static int AppInitRawTx(int argc, char* argv[])
|
||||
try {
|
||||
SelectParams(gArgs.GetChainName());
|
||||
} catch (const std::exception& e) {
|
||||
fprintf(stderr, "Error: %s\n", e.what());
|
||||
tfm::format(std::cerr, "Error: %s\n", e.what());
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
@ -104,10 +104,10 @@ static int AppInitRawTx(int argc, char* argv[])
|
||||
"\n";
|
||||
strUsage += gArgs.GetHelpMessage();
|
||||
|
||||
fprintf(stdout, "%s", strUsage.c_str());
|
||||
tfm::format(std::cout, "%s", strUsage.c_str());
|
||||
|
||||
if (argc < 2) {
|
||||
fprintf(stderr, "Error: too few parameters\n");
|
||||
tfm::format(std::cerr, "Error: too few parameters\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
@ -723,21 +723,21 @@ static void OutputTxJSON(const CTransaction& tx)
|
||||
TxToUniv(tx, uint256(), entry);
|
||||
|
||||
std::string jsonOutput = entry.write(4);
|
||||
fprintf(stdout, "%s\n", jsonOutput.c_str());
|
||||
tfm::format(std::cout, "%s\n", jsonOutput.c_str());
|
||||
}
|
||||
|
||||
static void OutputTxHash(const CTransaction& tx)
|
||||
{
|
||||
std::string strHexHash = tx.GetHash().GetHex(); // the hex-encoded transaction hash (aka the transaction id)
|
||||
|
||||
fprintf(stdout, "%s\n", strHexHash.c_str());
|
||||
tfm::format(std::cout, "%s\n", strHexHash.c_str());
|
||||
}
|
||||
|
||||
static void OutputTxHex(const CTransaction& tx)
|
||||
{
|
||||
std::string strHex = EncodeHexTx(tx);
|
||||
|
||||
fprintf(stdout, "%s\n", strHex.c_str());
|
||||
tfm::format(std::cout, "%s\n", strHex.c_str());
|
||||
}
|
||||
|
||||
static void OutputTx(const CTransaction& tx)
|
||||
|
Reference in New Issue
Block a user