Skip to content

Commit

Permalink
merge bitcoin#14555: Move util files to directory
Browse files Browse the repository at this point in the history
(script modified to account for Dash backports, doesn't account for rebasing)

------------- BEGIN SCRIPT ---------------
mkdir -p src/util
git mv src/util.h src/util/system.h
git mv src/util.cpp src/util/system.cpp
git mv src/utilmemory.h src/util/memory.h
git mv src/utilmoneystr.h src/util/moneystr.h
git mv src/utilmoneystr.cpp src/util/moneystr.cpp
git mv src/utilstrencodings.h src/util/strencodings.h
git mv src/utilstrencodings.cpp src/util/strencodings.cpp
git mv src/utiltime.h src/util/time.h
git mv src/utiltime.cpp src/util/time.cpp
git mv src/utilasmap.h src/util/asmap.h
git mv src/utilasmap.cpp src/util/asmap.cpp
git mv src/utilstring.h src/util/string.h
git mv src/utilstring.cpp src/util/string.cpp

gsed -i 's/<util\.h>/<util\/system\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
gsed -i 's/<utilmemory\.h>/<util\/memory\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
gsed -i 's/<utilmoneystr\.h>/<util\/moneystr\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
gsed -i 's/<utilstrencodings\.h>/<util\/strencodings\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
gsed -i 's/<utiltime\.h>/<util\/time\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
gsed -i 's/<utilasmap\.h>/<util\/asmap\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
gsed -i 's/<utilstring\.h>/<util\/string\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')

gsed -i 's/BITCOIN_UTIL_H/BITCOIN_UTIL_SYSTEM_H/g' src/util/system.h
gsed -i 's/BITCOIN_UTILMEMORY_H/BITCOIN_UTIL_MEMORY_H/g' src/util/memory.h
gsed -i 's/BITCOIN_UTILMONEYSTR_H/BITCOIN_UTIL_MONEYSTR_H/g' src/util/moneystr.h
gsed -i 's/BITCOIN_UTILSTRENCODINGS_H/BITCOIN_UTIL_STRENCODINGS_H/g' src/util/strencodings.h
gsed -i 's/BITCOIN_UTILTIME_H/BITCOIN_UTIL_TIME_H/g' src/util/time.h
gsed -i 's/BITCOIN_UTILASMAP_H/BITCOIN_UTIL_ASMAP_H/g' src/util/asmap.h
gsed -i 's/BITCOIN_UTILSTRING_H/BITCOIN_UTIL_STRING_H/g' src/util/string.h

gsed -i 's/ util\.\(h\|cpp\)/ util\/system\.\1/g' src/Makefile.am
gsed -i 's/utilmemory\.\(h\|cpp\)/util\/memory\.\1/g' src/Makefile.am
gsed -i 's/utilmoneystr\.\(h\|cpp\)/util\/moneystr\.\1/g' src/Makefile.am
gsed -i 's/utilstrencodings\.\(h\|cpp\)/util\/strencodings\.\1/g' src/Makefile.am
gsed -i 's/utiltime\.\(h\|cpp\)/util\/time\.\1/g' src/Makefile.am
gsed -i 's/utilasmap\.\(h\|cpp\)/util\/asmap\.\1/g' src/Makefile.am
gsed -i 's/utilstring\.\(h\|cpp\)/util\/string\.\1/g' src/Makefile.am

gsed -i 's/-> util ->/-> util\/system ->/' test/lint/lint-circular-dependencies.sh
gsed -i 's/src\/util\.cpp/src\/util\/system\.cpp/g' test/lint/lint-format-strings.py test/lint/lint-locale-dependence.sh
gsed -i 's/src\/utilmoneystr\.cpp/src\/util\/moneystr\.cpp/g' test/lint/lint-locale-dependence.sh
gsed -i 's/src\/utilstrencodings\.\(h\|cpp\)/src\/util\/strencodings\.\1/g' test/lint/lint-locale-dependence.sh
------------- END   SCRIPT ---------------
  • Loading branch information
kwvg committed Jun 27, 2021
1 parent 9e067f8 commit ef4dfa8
Show file tree
Hide file tree
Showing 186 changed files with 306 additions and 306 deletions.
32 changes: 16 additions & 16 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,13 @@ BITCOIN_CORE_H = \
ui_interface.h \
undo.h \
unordered_lru_cache.h \
util.h \
utilasmap.h \
utilmemory.h \
utilmoneystr.h \
utilstring.h \
utiltime.h \
utilthreadnames.h \
util/system.h \
util/asmap.h \
util/memory.h \
util/moneystr.h \
util/string.h \
util/time.h \
util/threadnames.h \
validation.h \
validationinterface.h \
versionbits.h \
Expand Down Expand Up @@ -529,8 +529,8 @@ libdash_consensus_a_SOURCES = \
tinyformat.h \
uint256.cpp \
uint256.h \
utilstrencodings.cpp \
utilstrencodings.h \
util/strencodings.cpp \
util/strencodings.h \
version.h

# common: shared between dashd, and dash-qt and non-server tools
Expand Down Expand Up @@ -588,13 +588,13 @@ libdash_util_a_SOURCES = \
support/cleanse.cpp \
sync.cpp \
threadinterrupt.cpp \
util.cpp \
utilasmap.cpp \
utilmoneystr.cpp \
utilstrencodings.cpp \
utiltime.cpp \
utilstring.cpp \
utilthreadnames.cpp \
util/system.cpp \
util/asmap.cpp \
util/moneystr.cpp \
util/strencodings.cpp \
util/time.cpp \
util/string.cpp \
util/threadnames.cpp \
$(BITCOIN_CORE_H)

if GLIBC_BACK_COMPAT
Expand Down
2 changes: 1 addition & 1 deletion src/addrdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <random.h>
#include <streams.h>
#include <tinyformat.h>
#include <util.h>
#include <util/system.h>

namespace {

Expand Down
2 changes: 1 addition & 1 deletion src/addrman.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <sync.h>
#include <timedata.h>
#include <tinyformat.h>
#include <util.h>
#include <util/system.h>

#include <fs.h>
#include <hash.h>
Expand Down
2 changes: 1 addition & 1 deletion src/arith_uint256.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <arith_uint256.h>

#include <uint256.h>
#include <utilstrencodings.h>
#include <util/strencodings.h>
#include <crypto/common.h>

#include <stdio.h>
Expand Down
4 changes: 2 additions & 2 deletions src/base58.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include <hash.h>
#include <uint256.h>
#include <utilstrencodings.h>
#include <utilstring.h>
#include <util/strencodings.h>
#include <util/string.h>

#include <assert.h>
#include <stdint.h>
Expand Down
2 changes: 1 addition & 1 deletion src/batchedlogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <batchedlogger.h>
#include <util.h>
#include <util/system.h>

CBatchedLogger::CBatchedLogger(BCLog::LogFlags _category, const std::string& _header) :
accept(LogAcceptCategory(_category)), header(_header)
Expand Down
2 changes: 1 addition & 1 deletion src/bench/bench_dash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <key.h>
#include <stacktraces.h>
#include <validation.h>
#include <util.h>
#include <util/system.h>
#include <random.h>

#include <boost/lexical_cast.hpp>
Expand Down
2 changes: 1 addition & 1 deletion src/bench/bls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <bench/bench.h>
#include <random.h>
#include <bls/bls_worker.h>
#include <utiltime.h>
#include <util/time.h>

#include <iostream>

Expand Down
2 changes: 1 addition & 1 deletion src/bench/checkqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <bench/bench.h>
#include <util.h>
#include <util/system.h>
#include <validation.h>
#include <checkqueue.h>
#include <prevector.h>
Expand Down
2 changes: 1 addition & 1 deletion src/bench/crypto_hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <hash.h>
#include <random.h>
#include <uint256.h>
#include <utiltime.h>
#include <util/time.h>
#include <crypto/ripemd160.h>
#include <crypto/sha1.h>
#include <crypto/sha256.h>
Expand Down
2 changes: 1 addition & 1 deletion src/bench/examples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include <bench/bench.h>
#include <validation.h>
#include <utiltime.h>
#include <util/time.h>

// Sanity test: this should loop ten times, and
// min/max/average should be close to 100ms.
Expand Down
2 changes: 1 addition & 1 deletion src/bench/string_cast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include <bench/bench.h>
#include <tinyformat.h>
#include <utilstrencodings.h>
#include <util/strencodings.h>

#include <boost/lexical_cast.hpp>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion src/bench/util_time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include <bench/bench.h>

#include <utiltime.h>
#include <util/time.h>

static void BenchTimeDeprecated(benchmark::State& state)
{
Expand Down
2 changes: 1 addition & 1 deletion src/blockencodings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <streams.h>
#include <txmempool.h>
#include <validation.h>
#include <util.h>
#include <util/system.h>

#include <unordered_map>

Expand Down
2 changes: 1 addition & 1 deletion src/bls/bls.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <hash.h>
#include <serialize.h>
#include <uint256.h>
#include <utilstrencodings.h>
#include <util/strencodings.h>

// bls-dash uses relic, which may define DEBUG and ERROR, which leads to many warnings in some build setups
#undef ERROR
Expand Down
2 changes: 1 addition & 1 deletion src/bls/bls_worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <hash.h>
#include <serialize.h>

#include <util.h>
#include <util/system.h>

#include <memory>
#include <utility>
Expand Down
4 changes: 2 additions & 2 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include <consensus/merkle.h>

#include <tinyformat.h>
#include <util.h>
#include <utilstrencodings.h>
#include <util/system.h>
#include <util/strencodings.h>

#include <arith_uint256.h>

Expand Down
4 changes: 2 additions & 2 deletions src/chainparamsbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <chainparamsbase.h>

#include <tinyformat.h>
#include <util.h>
#include <utilmemory.h>
#include <util/system.h>
#include <util/memory.h>

#include <assert.h>

Expand Down
2 changes: 1 addition & 1 deletion src/checkqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <sync.h>
#include <tinyformat.h>
#include <utilthreadnames.h>
#include <util/threadnames.h>

#include <algorithm>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion src/coinjoin/coinjoin-client-options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include <coinjoin/coinjoin-client-options.h>

#include <util.h>
#include <util/system.h>
#include <univalue.h>

#include <cassert>
Expand Down
4 changes: 2 additions & 2 deletions src/coinjoin/coinjoin-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include <net_processing.h>
#include <script/sign.h>
#include <txmempool.h>
#include <util.h>
#include <utilmoneystr.h>
#include <util/system.h>
#include <util/moneystr.h>
#include <validation.h>
#include <version.h>
#include <wallet/coincontrol.h>
Expand Down
4 changes: 2 additions & 2 deletions src/coinjoin/coinjoin-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include <netmessagemaker.h>
#include <script/interpreter.h>
#include <txmempool.h>
#include <util.h>
#include <utilmoneystr.h>
#include <util/system.h>
#include <util/moneystr.h>
#include <validation.h>
#include <version.h>

Expand Down
4 changes: 2 additions & 2 deletions src/coinjoin/coinjoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <netmessagemaker.h>
#include <script/sign.h>
#include <txmempool.h>
#include <util.h>
#include <utilmoneystr.h>
#include <util/system.h>
#include <util/moneystr.h>
#include <validation.h>
#include <bls/bls.h>
#include <masternode/activemasternode.h>
Expand Down
2 changes: 1 addition & 1 deletion src/consensus/merkle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include <consensus/merkle.h>
#include <hash.h>
#include <utilstrencodings.h>
#include <util/strencodings.h>

/* WARNING! If you're reading this because you're learning about crypto
and/or designing a new system that will use merkle trees, keep in mind
Expand Down
2 changes: 1 addition & 1 deletion src/consensus/tx_verify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// TODO remove the following dependencies
#include <chain.h>
#include <coins.h>
#include <utilmoneystr.h>
#include <util/moneystr.h>

bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime)
{
Expand Down
4 changes: 2 additions & 2 deletions src/core_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include <serialize.h>
#include <streams.h>
#include <univalue.h>
#include <util.h>
#include <utilstrencodings.h>
#include <util/system.h>
#include <util/strencodings.h>
#include <version.h>

#include <boost/algorithm/string/classification.hpp>
Expand Down
6 changes: 3 additions & 3 deletions src/core_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#include <serialize.h>
#include <streams.h>
#include <univalue.h>
#include <util.h>
#include <utilmoneystr.h>
#include <utilstrencodings.h>
#include <util/system.h>
#include <util/moneystr.h>
#include <util/strencodings.h>

#include <spentindex.h>

Expand Down
4 changes: 2 additions & 2 deletions src/dash-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#include <rpc/client.h>
#include <rpc/protocol.h>
#include <stacktraces.h>
#include <util.h>
#include <utilstrencodings.h>
#include <util/system.h>
#include <util/strencodings.h>

#include <memory>
#include <stdio.h>
Expand Down
6 changes: 3 additions & 3 deletions src/dash-tx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#include <script/script.h>
#include <script/sign.h>
#include <univalue.h>
#include <util.h>
#include <utilmoneystr.h>
#include <utilstrencodings.h>
#include <util/system.h>
#include <util/moneystr.h>
#include <util/strencodings.h>

#include <memory>
#include <stdio.h>
Expand Down
6 changes: 3 additions & 3 deletions src/dashd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
#include <rpc/server.h>
#include <init.h>
#include <noui.h>
#include <util.h>
#include <util/system.h>
#include <httpserver.h>
#include <httprpc.h>
#include <utilstrencodings.h>
#include <utilthreadnames.h>
#include <util/strencodings.h>
#include <util/threadnames.h>
#include <walletinitinterface.h>
#include <stacktraces.h>

Expand Down
4 changes: 2 additions & 2 deletions src/dbwrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include <fs.h>
#include <serialize.h>
#include <streams.h>
#include <util.h>
#include <utilstrencodings.h>
#include <util/system.h>
#include <util/strencodings.h>
#include <version.h>

#include <typeindex>
Expand Down
2 changes: 1 addition & 1 deletion src/flat-database.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <fs.h>
#include <hash.h>
#include <streams.h>
#include <util.h>
#include <util/system.h>

/**
* Generic Dumping and Loading
Expand Down
2 changes: 1 addition & 1 deletion src/governance/governance-classes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <primitives/transaction.h>
#include <script/standard.h>
#include <timedata.h>
#include <utilstrencodings.h>
#include <util/strencodings.h>
#include <validation.h>

#include <boost/algorithm/string.hpp>
Expand Down
2 changes: 1 addition & 1 deletion src/governance/governance-validators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <key_io.h>
#include <timedata.h>
#include <tinyformat.h>
#include <utilstrencodings.h>
#include <util/strencodings.h>

#include <algorithm>

Expand Down
2 changes: 1 addition & 1 deletion src/governance/governance-vote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <masternode/masternode-sync.h>
#include <messagesigner.h>
#include <net.h>
#include <util.h>
#include <util/system.h>

#include <evo/deterministicmns.h>

Expand Down
Loading

0 comments on commit ef4dfa8

Please sign in to comment.