Skip to content

Commit 7d312cb

Browse files
committed
Introduce modifications to tinyformat via utilstrprintf.h
This includes changes in: 695041e - util: Update tinyformat 1b8fd35 - Make tinyformat errors raise an exception instead of assert()ing 9b6d4c5 - Move strprintf define to tinyformat.h 6e5fd00 - Move `*Version()` functions to version.h/cpp 9eaa0af - tinyformat: force USE_VARIADIC_TEMPLATES b651270 - util: Throw tinyformat::format_error on formatting error This does not include changes in: 64fb0ac - Declare single-argument (non-converting) constructors "explicit" 4d9b425 - Fix typos And drop src/tinyformat.h in favor of the subtree src/tinyformat/ Note I excluded only the tinyformat cpp from the boost checks out of an abundance of caution - these files are not actually built into bitcoin so are not at risk of pulling in unwanted dependencies, whereas the header, and other dependencies might be.
1 parent 97b6f68 commit 7d312cb

36 files changed

+81
-1103
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ jobs:
148148
- test/lint/git-subtree-check.sh src/secp256k1
149149
- test/lint/git-subtree-check.sh src/univalue
150150
- test/lint/git-subtree-check.sh src/leveldb
151+
- test/lint/git-subtree-check.sh src/tinyformat
151152
- test/lint/check-doc.py
152153
- test/lint/check-rpc-mappings.py .
153154
- test/lint/lint-all.sh

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ $(BITCOIN_CLI_BIN): FORCE
168168
$(MAKE) -C src $(@F)
169169

170170
if USE_LCOV
171-
LCOV_FILTER_PATTERN=-p "/usr/include/" -p "src/leveldb/" -p "src/bench/" -p "src/univalue" -p "src/crypto/ctaes" -p "src/secp256k1"
171+
LCOV_FILTER_PATTERN=-p "/usr/include/" -p "src/leveldb/" -p "src/bench/" -p "src/univalue" -p "src/crypto/ctaes" -p "src/secp256k1" -p "src/tinyformat"
172172

173173
baseline.info:
174174
$(LCOV) -c -i -d $(abs_builddir)/src -o $@

contrib/devtools/copyright_header.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
'src/qt/bitcoinstrings.cpp',
3232
'src/chainparamsseeds.h',
3333
# other external copyrights:
34-
'src/tinyformat.h',
34+
'src/tinyformat/tinyformat.h',
3535
'src/leveldb/util/env_win.cc',
3636
'src/crypto/ctaes/bench.c',
3737
'test/functional/test_framework/bignum.py',

doc/developer-notes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,9 @@ Current subtrees include:
698698
- src/crypto/ctaes
699699
- Upstream at https://github.com/bitcoin-core/ctaes ; actively maintained by Core contributors.
700700

701+
- src/tinyformat
702+
- Upstream at https://github.com/c42f/tinyformat ; report important PRs to Core to avoid delay.
703+
701704
- src/univalue
702705
- Upstream at https://github.com/jgarzik/univalue ; report important PRs to Core to avoid delay.
703706

src/Makefile.am

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ endif
2121

2222
BITCOIN_INCLUDES=-I$(builddir) $(BDB_CPPFLAGS) $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS)
2323

24-
BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
24+
BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include -I$(srcdir)/tinyformat
2525
BITCOIN_INCLUDES += $(UNIVALUE_CFLAGS)
2626

2727
LIBBITCOIN_SERVER=libbitcoin_server.a
@@ -181,6 +181,7 @@ BITCOIN_CORE_H = \
181181
util.h \
182182
utilmemory.h \
183183
utilmoneystr.h \
184+
utilstrprintf.h \
184185
utiltime.h \
185186
validation.h \
186187
validationinterface.h \
@@ -361,11 +362,11 @@ libbitcoin_consensus_a_SOURCES = \
361362
script/script_error.h \
362363
serialize.h \
363364
span.h \
364-
tinyformat.h \
365365
uint256.cpp \
366366
uint256.h \
367367
utilstrencodings.cpp \
368368
utilstrencodings.h \
369+
utilstrprintf.h \
369370
version.h
370371

371372
# common: shared between bitcoind, and bitcoin-qt and non-server tools
@@ -512,7 +513,7 @@ endif
512513

513514
libbitcoinconsensus_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS)
514515
libbitcoinconsensus_la_LIBADD = $(LIBSECP256K1)
515-
libbitcoinconsensus_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -DBUILD_BITCOIN_INTERNAL
516+
libbitcoinconsensus_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -I$(srcdir)/tinyformat -DBUILD_BITCOIN_INTERNAL
516517
libbitcoinconsensus_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
517518

518519
endif

src/addrdb.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#include <hash.h>
1212
#include <random.h>
1313
#include <streams.h>
14-
#include <tinyformat.h>
1514
#include <util.h>
15+
#include <utilstrprintf.h>
1616

1717
namespace {
1818

src/chain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include <arith_uint256.h>
1010
#include <consensus/params.h>
1111
#include <primitives/block.h>
12-
#include <tinyformat.h>
1312
#include <uint256.h>
13+
#include <utilstrprintf.h>
1414

1515
#include <vector>
1616

src/chainparams.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#include <chainparams.h>
77
#include <consensus/merkle.h>
88

9-
#include <tinyformat.h>
109
#include <util.h>
1110
#include <utilstrencodings.h>
11+
#include <utilstrprintf.h>
1212

1313
#include <assert.h>
1414

src/chainparamsbase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
#include <chainparamsbase.h>
77

8-
#include <tinyformat.h>
98
#include <util.h>
109
#include <utilmemory.h>
10+
#include <utilstrprintf.h>
1111

1212
#include <assert.h>
1313

src/clientversion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include <clientversion.h>
66

7-
#include <tinyformat.h>
7+
#include <utilstrprintf.h>
88

99

1010
/**

0 commit comments

Comments
 (0)