Skip to content

Commit b77dfdc

Browse files
committed
Typesafe strprintf/error/LogPrint functions
Switch to tinyformat-based formatting. Tinyformat is a typesafe drop-in replacement for C99 printf functions: https://github.com/c42f/tinyformat
1 parent 53e9d3a commit b77dfdc

File tree

6 files changed

+1063
-102
lines changed

6 files changed

+1063
-102
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ case $host in
189189
AC_MSG_ERROR("windres not found")
190190
fi
191191

192-
CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -D__USE_MINGW_ANSI_STDIO"
192+
CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB"
193193
LEVELDB_TARGET_FLAGS="TARGET_OS=OS_WINDOWS_CROSSCOMPILE"
194194
if test "x$CXXFLAGS_overridden" = "xno"; then
195195
CXXFLAGS="$CXXFLAGS -w"

src/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ BITCOIN_CORE_H = \
6060
serialize.h \
6161
sync.h \
6262
threadsafety.h \
63+
tinyformat.h \
6364
txdb.h \
6465
txmempool.h \
6566
ui_interface.h \

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1884,7 +1884,7 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew)
18841884
pindex = pindex->pprev;
18851885
}
18861886
if (nUpgraded > 0)
1887-
LogPrintf("SetBestChain: %d of last 100 blocks above version %d\n", nUpgraded, CBlock::CURRENT_VERSION);
1887+
LogPrintf("SetBestChain: %d of last 100 blocks above version %d\n", nUpgraded, (int)CBlock::CURRENT_VERSION);
18881888
if (nUpgraded > 100/2)
18891889
// strMiscWarning is read by GetWarnings(), called by Qt and the JSON-RPC code to warn the user:
18901890
strMiscWarning = _("Warning: This version is obsolete, upgrade required!");

0 commit comments

Comments
 (0)