Skip to content

Commit

Permalink
Backport 11651 (#3358)
Browse files Browse the repository at this point in the history
* scripted-diff: Replace #include "" with #include <> (ryanofsky)

-BEGIN VERIFY SCRIPT-
for f in \
  src/*.cpp \
  src/*.h \
  src/bench/*.cpp \
  src/bench/*.h \
  src/compat/*.cpp \
  src/compat/*.h \
  src/consensus/*.cpp \
  src/consensus/*.h \
  src/crypto/*.cpp \
  src/crypto/*.h \
  src/crypto/ctaes/*.h \
  src/policy/*.cpp \
  src/policy/*.h \
  src/primitives/*.cpp \
  src/primitives/*.h \
  src/qt/*.cpp \
  src/qt/*.h \
  src/qt/test/*.cpp \
  src/qt/test/*.h \
  src/rpc/*.cpp \
  src/rpc/*.h \
  src/script/*.cpp \
  src/script/*.h \
  src/support/*.cpp \
  src/support/*.h \
  src/support/allocators/*.h \
  src/test/*.cpp \
  src/test/*.h \
  src/wallet/*.cpp \
  src/wallet/*.h \
  src/wallet/test/*.cpp \
  src/wallet/test/*.h \
  src/zmq/*.cpp \
  src/zmq/*.h
do
  base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f
done
-END VERIFY SCRIPT-

Signed-off-by: Pasta <pasta@dashboost.org>

* scripted-diff: Replace #include "" with #include <> (Dash Specific)

-BEGIN VERIFY SCRIPT-
for f in \
  src/bls/*.cpp \
  src/bls/*.h \
  src/evo/*.cpp \
  src/evo/*.h \
  src/governance/*.cpp \
  src/governance/*.h \
  src/llmq/*.cpp \
  src/llmq/*.h \
  src/masternode/*.cpp \
  src/masternode/*.h \
  src/privatesend/*.cpp \
  src/privatesend/*.h
do
  base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f
done
-END VERIFY SCRIPT-

Signed-off-by: Pasta <pasta@dashboost.org>

* build: Remove -I for everything but project root

Remove -I from build system for everything but the project root,
and built-in dependencies.

Signed-off-by: Pasta <pasta@dashboost.org>

# Conflicts:
#	src/Makefile.test.include

* qt: refactor: Use absolute include paths in .ui files

* qt: refactor: Changes to make include paths absolute

This makes all include paths in the GUI absolute.

Many changes are involved as every single source file in
src/qt/ assumes to be able to use relative includes.

Signed-off-by: Pasta <pasta@dashboost.org>

# Conflicts:
#	src/qt/dash.cpp
#	src/qt/optionsmodel.cpp
#	src/qt/test/rpcnestedtests.cpp

* test: refactor: Use absolute include paths for test data files

* Recommend #include<> syntax in developer notes

* refactor: Include obj/build.h instead of build.h

* END BACKPORT bitcoin#11651 Remove trailing whitespace causing travis failure

* fix backport 11651

Signed-off-by: Pasta <pasta@dashboost.org>

* More of 11651

* fix blockchain.cpp

Signed-off-by: pasta <pasta@dashboost.org>

* Add missing "qt/" in includes

* Add missing "test/" in includes

* Fix trailing whitespaces

Co-authored-by: Wladimir J. van der Laan <laanwj@gmail.com>
Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
Co-authored-by: MeshCollider <dobsonsa68@gmail.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
  • Loading branch information
5 people authored Mar 19, 2020
1 parent 05c134c commit 8a1ec93
Show file tree
Hide file tree
Showing 509 changed files with 3,075 additions and 3,068 deletions.
8 changes: 8 additions & 0 deletions doc/developer-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,14 @@ namespace {

- *Rationale*: Avoids confusion about the namespace context

- Prefer `#include <primitives/transaction.h>` bracket syntax instead of
`#include "primitives/transactions.h"`` quote syntax when possible.

- *Rationale*: Bracket syntax is less ambiguous because the preprocessor
searches a fixed list of include directories without taking location of the
source file into account. This allows quoted includes to stand out more when
the location of the source file actually is relevant.

GUI
-----

Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ else
LIBUNIVALUE = $(UNIVALUE_LIBS)
endif

BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BDB_CPPFLAGS) $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS)
BITCOIN_INCLUDES=-I$(builddir) $(BDB_CPPFLAGS) $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS)

BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
BITCOIN_INCLUDES += $(UNIVALUE_CFLAGS)
Expand Down
3 changes: 1 addition & 2 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,7 @@ RES_MOVIES = $(wildcard $(srcdir)/qt/res/movies/spinner-*.png)

BITCOIN_RC = qt/res/dash-qt-res.rc

BITCOIN_QT_INCLUDES = -I$(builddir)/qt -I$(srcdir)/qt -I$(srcdir)/qt/forms \
-I$(builddir)/qt/forms -DQT_NO_KEYWORDS
BITCOIN_QT_INCLUDES = -DQT_NO_KEYWORDS

qt_libdashqt_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
$(QT_INCLUDES) $(QT_DBUS_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS)
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ BITCOIN_TESTS += \
endif

test_test_dash_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
test_test_dash_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS) $(EVENT_CFLAGS)
test_test_dash_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(TESTDEFS) $(EVENT_CFLAGS)
test_test_dash_LDADD =
if ENABLE_WALLET
test_test_dash_LDADD += $(LIBBITCOIN_WALLET)
Expand Down
22 changes: 11 additions & 11 deletions src/addrdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "addrdb.h"

#include "addrman.h"
#include "chainparams.h"
#include "clientversion.h"
#include "fs.h"
#include "hash.h"
#include "random.h"
#include "streams.h"
#include "tinyformat.h"
#include "util.h"
#include <addrdb.h>

#include <addrman.h>
#include <chainparams.h>
#include <clientversion.h>
#include <fs.h>
#include <hash.h>
#include <random.h>
#include <streams.h>
#include <tinyformat.h>
#include <util.h>

namespace {

Expand Down
4 changes: 2 additions & 2 deletions src/addrdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#ifndef BITCOIN_ADDRDB_H
#define BITCOIN_ADDRDB_H

#include "fs.h"
#include "serialize.h"
#include <fs.h>
#include <serialize.h>

#include <string>
#include <map>
Expand Down
4 changes: 2 additions & 2 deletions src/addressindex.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#ifndef BITCOIN_ADDRESSINDEX_H
#define BITCOIN_ADDRESSINDEX_H

#include "uint256.h"
#include "amount.h"
#include <uint256.h>
#include <amount.h>

struct CMempoolAddressDelta
{
Expand Down
8 changes: 4 additions & 4 deletions src/addrman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "addrman.h"
#include <addrman.h>

#include "hash.h"
#include "serialize.h"
#include "streams.h"
#include <hash.h>
#include <serialize.h>
#include <streams.h>

int CAddrInfo::GetTriedBucket(const uint256& nKey) const
{
Expand Down
12 changes: 6 additions & 6 deletions src/addrman.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
#ifndef BITCOIN_ADDRMAN_H
#define BITCOIN_ADDRMAN_H

#include "netaddress.h"
#include "protocol.h"
#include "random.h"
#include "sync.h"
#include "timedata.h"
#include "util.h"
#include <netaddress.h>
#include <protocol.h>
#include <random.h>
#include <sync.h>
#include <timedata.h>
#include <util.h>

#include <map>
#include <set>
Expand Down
8 changes: 4 additions & 4 deletions src/arith_uint256.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "arith_uint256.h"
#include <arith_uint256.h>

#include "uint256.h"
#include "utilstrencodings.h"
#include "crypto/common.h"
#include <uint256.h>
#include <utilstrencodings.h>
#include <crypto/common.h>

#include <stdio.h>
#include <string.h>
Expand Down
6 changes: 3 additions & 3 deletions src/base58.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "base58.h"
#include <base58.h>

#include "hash.h"
#include "uint256.h"
#include <hash.h>
#include <uint256.h>

#include <assert.h>
#include <stdint.h>
Expand Down
12 changes: 6 additions & 6 deletions src/base58.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
#ifndef BITCOIN_BASE58_H
#define BITCOIN_BASE58_H

#include "chainparams.h"
#include "key.h"
#include "pubkey.h"
#include "script/script.h"
#include "script/standard.h"
#include "support/allocators/zeroafterfree.h"
#include <chainparams.h>
#include <key.h>
#include <pubkey.h>
#include <script/script.h>
#include <script/standard.h>
#include <support/allocators/zeroafterfree.h>

#include <string>
#include <vector>
Expand Down
4 changes: 2 additions & 2 deletions src/batchedlogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "batchedlogger.h"
#include "util.h"
#include <batchedlogger.h>
#include <util.h>

CBatchedLogger::CBatchedLogger(uint64_t _category, const std::string& _header) :
accept(LogAcceptCategory(_category)), header(_header)
Expand Down
2 changes: 1 addition & 1 deletion src/batchedlogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef DASH_BATCHEDLOGGER_H
#define DASH_BATCHEDLOGGER_H

#include "tinyformat.h"
#include <tinyformat.h>

class CBatchedLogger
{
Expand Down
6 changes: 3 additions & 3 deletions src/bench/Examples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "bench.h"
#include "validation.h"
#include "utiltime.h"
#include <bench/bench.h>
#include <validation.h>
#include <utiltime.h>

// Sanity test: this should loop ten times, and
// min/max/average should be close to 100ms.
Expand Down
6 changes: 3 additions & 3 deletions src/bench/base58.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "bench.h"
#include <bench/bench.h>

#include "validation.h"
#include "base58.h"
#include <validation.h>
#include <base58.h>

#include <array>
#include <vector>
Expand Down
4 changes: 2 additions & 2 deletions src/bench/bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "bench.h"
#include "perf.h"
#include <bench/bench.h>
#include <bench/perf.h>

#include <assert.h>
#include <iostream>
Expand Down
16 changes: 8 additions & 8 deletions src/bench/bench_dash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "bench.h"
#include <bench/bench.h>

#include "crypto/sha256.h"
#include "key.h"
#include "stacktraces.h"
#include "validation.h"
#include "util.h"
#include "random.h"
#include <crypto/sha256.h>
#include <key.h>
#include <stacktraces.h>
#include <validation.h>
#include <util.h>
#include <random.h>

#include "bls/bls.h"
#include <bls/bls.h>

void InitBLSTests();
void CleanupBLSTests();
Expand Down
8 changes: 4 additions & 4 deletions src/bench/bls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "bench.h"
#include "random.h"
#include "bls/bls_worker.h"
#include "utiltime.h"
#include <bench/bench.h>
#include <random.h>
#include <bls/bls_worker.h>
#include <utiltime.h>

#include <iostream>

Expand Down
6 changes: 3 additions & 3 deletions src/bench/bls_dkg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "bench.h"
#include "random.h"
#include "bls/bls_worker.h"
#include <bench/bench.h>
#include <random.h>
#include <bls/bls_worker.h>

extern CBLSWorker blsWorker;

Expand Down
8 changes: 4 additions & 4 deletions src/bench/ccoins_caching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "bench.h"
#include "coins.h"
#include "policy/policy.h"
#include "wallet/crypter.h"
#include <bench/bench.h>
#include <coins.h>
#include <policy/policy.h>
#include <wallet/crypter.h>

#include <vector>

Expand Down
12 changes: 6 additions & 6 deletions src/bench/checkblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "bench.h"
#include <bench/bench.h>

#include "chainparams.h"
#include "validation.h"
#include "streams.h"
#include "consensus/validation.h"
#include <chainparams.h>
#include <validation.h>
#include <streams.h>
#include <consensus/validation.h>

#include "bench/data/block813851.raw.h"
#include <bench/data/block813851.raw.h>

// These are the two major time-sinks which happen after we have fully received
// a block off the wire, but before we can relay the block on to peers using
Expand Down
12 changes: 6 additions & 6 deletions src/bench/checkqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "bench.h"
#include "util.h"
#include "validation.h"
#include "checkqueue.h"
#include "prevector.h"
#include <bench/bench.h>
#include <util.h>
#include <validation.h>
#include <checkqueue.h>
#include <prevector.h>
#include <vector>
#include <boost/thread/thread.hpp>
#include "random.h"
#include <random.h>


// This Benchmark tests the CheckQueue with the lightest
Expand Down
4 changes: 2 additions & 2 deletions src/bench/coin_selection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "bench.h"
#include "wallet/wallet.h"
#include <bench/bench.h>
#include <wallet/wallet.h>

#include <set>

Expand Down
20 changes: 10 additions & 10 deletions src/bench/crypto_hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@

#include <iostream>

#include "bench.h"
#include "bloom.h"
#include "hash.h"
#include "random.h"
#include "uint256.h"
#include "utiltime.h"
#include "crypto/ripemd160.h"
#include "crypto/sha1.h"
#include "crypto/sha256.h"
#include "crypto/sha512.h"
#include <bench/bench.h>
#include <bloom.h>
#include <hash.h>
#include <random.h>
#include <uint256.h>
#include <utiltime.h>
#include <crypto/ripemd160.h>
#include <crypto/sha1.h>
#include <crypto/sha256.h>
#include <crypto/sha512.h>

/* Number of bytes to hash per iteration */
static const uint64_t BUFFER_SIZE = 1000*1000;
Expand Down
4 changes: 2 additions & 2 deletions src/bench/ecdsa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "bench.h"
#include <bench/bench.h>

#include "key.h"
#include <key.h>

static void ECDSASign(benchmark::State& state)
{
Expand Down
Loading

0 comments on commit 8a1ec93

Please sign in to comment.