From c47e9e78eda31365ef9df310df8d173028c7b346 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Sat, 13 Apr 2024 08:21:18 +0000 Subject: [PATCH 1/6] bench: drop leftover `boost::lexical_cast` benches, drop header from list `boost::lexical_cast` isn't used anywhere in Dash Core, the sole remaining use being in a benchmark, despite it no longer being used in Dash Core. Let's drop the benchmark and drop `boost/lexical_cast.hpp` from allowed Boost headers --- src/bench/string_cast.cpp | 32 -------------------------------- test/lint/lint-includes.sh | 1 - 2 files changed, 33 deletions(-) diff --git a/src/bench/string_cast.cpp b/src/bench/string_cast.cpp index 8f08d12103..bc59d79dbc 100644 --- a/src/bench/string_cast.cpp +++ b/src/bench/string_cast.cpp @@ -7,7 +7,6 @@ #include #include -#include #include template @@ -25,21 +24,6 @@ static void int_atoi(benchmark::Bench& bench) }); } -static void int_lexical_cast(benchmark::Bench& bench) -{ - bench.run([&] { - boost::lexical_cast("1"); - }); -} - -static void strings_1_lexical_cast(benchmark::Bench& bench) -{ - int i{0}; - bench.run([&] { - boost::lexical_cast(++i); - }); -} - static void strings_1_numberToString(benchmark::Bench& bench) { int i{0}; @@ -56,19 +40,6 @@ static void strings_1_tostring(benchmark::Bench& bench) }); } -static void strings_2_multi_lexical_cast(benchmark::Bench& bench) -{ - int i{0}; - bench.run([&] { static_cast( - boost::lexical_cast(i) + - boost::lexical_cast(i+1) + - boost::lexical_cast(i+2) + - boost::lexical_cast(i+3) + - boost::lexical_cast(i+4)); - ++i; - }); -} - static void strings_2_multi_numberToString(benchmark::Bench& bench) { int i{0}; @@ -97,11 +68,8 @@ static void strings_2_strptintf(benchmark::Bench& bench) } BENCHMARK(int_atoi); -BENCHMARK(int_lexical_cast); -BENCHMARK(strings_1_lexical_cast); BENCHMARK(strings_1_numberToString); BENCHMARK(strings_1_tostring); -BENCHMARK(strings_2_multi_lexical_cast); BENCHMARK(strings_2_multi_numberToString); BENCHMARK(strings_2_multi_tostring); BENCHMARK(strings_2_strptintf); diff --git a/test/lint/lint-includes.sh b/test/lint/lint-includes.sh index e3f13c624f..57962a2ab2 100755 --- a/test/lint/lint-includes.sh +++ b/test/lint/lint-includes.sh @@ -53,7 +53,6 @@ EXPECTED_BOOST_INCLUDES=( boost/filesystem.hpp boost/filesystem/fstream.hpp boost/function.hpp - boost/lexical_cast.hpp boost/multi_index/hashed_index.hpp boost/multi_index/ordered_index.hpp boost/multi_index/sequenced_index.hpp From 9ae39f9ba7bdbf4725e5e3312b78b5fe42d1d7ff Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Thu, 18 Apr 2024 11:48:10 +0000 Subject: [PATCH 2/6] qt: drop leftover `boost::function` usage in Qt, drop header from list --- src/qt/trafficgraphwidget.h | 4 +--- test/lint/lint-includes.sh | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/qt/trafficgraphwidget.h b/src/qt/trafficgraphwidget.h index 351f3f712c..8767270364 100644 --- a/src/qt/trafficgraphwidget.h +++ b/src/qt/trafficgraphwidget.h @@ -7,8 +7,6 @@ #include -#include - #include #include @@ -37,7 +35,7 @@ public Q_SLOTS: void clear(); private: - typedef boost::function SampleChooser; + typedef std::function SampleChooser; void paintPath(QPainterPath &path, const TrafficGraphData::SampleQueue &queue, SampleChooser chooser); QTimer *timer; diff --git a/test/lint/lint-includes.sh b/test/lint/lint-includes.sh index 57962a2ab2..41f9fa8d45 100755 --- a/test/lint/lint-includes.sh +++ b/test/lint/lint-includes.sh @@ -52,7 +52,6 @@ EXPECTED_BOOST_INCLUDES=( boost/date_time/posix_time/posix_time.hpp boost/filesystem.hpp boost/filesystem/fstream.hpp - boost/function.hpp boost/multi_index/hashed_index.hpp boost/multi_index/ordered_index.hpp boost/multi_index/sequenced_index.hpp From fbc6bc88cf32ca0932578031582d9772cdf8a9bc Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Thu, 18 Apr 2024 12:49:01 +0000 Subject: [PATCH 3/6] init: use local ArgsManager variable instead of global when possible We don't touch `CleanupBlockRevFiles` as the function is moved to blockstorage in bitcoin#21727, where it would need access to the global. GetBlocksDirPath() is non-const and invocations of that aren't included either. --- src/init.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 25c5bdaa6c..ac051755a1 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -592,7 +592,7 @@ void SetupServerArgs(NodeContext& node) argsman.AddArg("-proxyrandomize", strprintf("Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)", DEFAULT_PROXYRANDOMIZE), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); argsman.AddArg("-seednode=", "Connect to a node to retrieve peer addresses, and disconnect. This option can be specified multiple times to connect to multiple nodes.", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); argsman.AddArg("-socketevents=", "Socket events mode, which must be one of 'select', 'poll', 'epoll' or 'kqueue', depending on your system (default: Linux - 'epoll', FreeBSD/Apple - 'kqueue', Windows - 'select')", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); - gArgs.AddArg("-networkactive", "Enable all P2P network activity (default: 1). Can be changed by the setnetworkactive RPC command", ArgsManager::ALLOW_BOOL, OptionsCategory::CONNECTION); + argsman.AddArg("-networkactive", "Enable all P2P network activity (default: 1). Can be changed by the setnetworkactive RPC command", ArgsManager::ALLOW_BOOL, OptionsCategory::CONNECTION); argsman.AddArg("-timeout=", strprintf("Specify socket connection timeout in milliseconds. If an initial attempt to connect is unsuccessful after this amount of time, drop it (minimum: 1, default: %d)", DEFAULT_CONNECT_TIMEOUT), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); argsman.AddArg("-torcontrol=:", strprintf("Tor control port to use if onion listening enabled (default: %s)", DEFAULT_TOR_CONTROL), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); argsman.AddArg("-torpassword=", "Tor control port password (default: empty)", ArgsManager::ALLOW_ANY | ArgsManager::SENSITIVE, OptionsCategory::CONNECTION); @@ -1663,7 +1663,7 @@ bool AppInitMain(const CoreContext& context, NodeContext& node, interfaces::Bloc assert(!node.banman); node.banman = std::make_unique(GetDataDir() / "banlist", &uiInterface, args.GetArg("-bantime", DEFAULT_MISBEHAVING_BANTIME)); assert(!node.connman); - node.connman = std::make_unique(GetRand(std::numeric_limits::max()), GetRand(std::numeric_limits::max()), *node.addrman, gArgs.GetBoolArg("-networkactive", true)); + node.connman = std::make_unique(GetRand(std::numeric_limits::max()), GetRand(std::numeric_limits::max()), *node.addrman, args.GetBoolArg("-networkactive", true)); assert(!node.fee_estimator); // Don't initialize fee estimation with old data if we don't relay transactions, From 65585e68e653bc66e1d35c29609334e005b0c113 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Tue, 5 Jul 2022 14:09:36 -0400 Subject: [PATCH 4/6] merge bitcoin#25550: remove note on arm cross-compilation from build-unix.md --- doc/build-unix.md | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/doc/build-unix.md b/doc/build-unix.md index 21dea362bc..624c3a7d45 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -313,27 +313,3 @@ or building and depending on a local version of Berkeley DB 4.8. The readily ava `--with-incompatible-bdb` according to the [PKGBUILD](https://projects.archlinux.org/svntogit/community.git/tree/bitcoin/trunk/PKGBUILD). As mentioned above, when maintaining portability of the wallet between the standard Dash Core distributions and independently built node software is desired, Berkeley DB 4.8 must be used. - - -ARM Cross-compilation -------------------- -These steps can be performed on, for example, an Ubuntu VM. The depends system -will also work on other Linux distributions, however the commands for -installing the toolchain will be different. - -Make sure you install the build requirements mentioned above. -Then, install the toolchain and curl: - - sudo apt-get install g++-arm-linux-gnueabihf curl - -To build executables for ARM: - - cd depends - make HOST=arm-linux-gnueabihf NO_QT=1 - cd .. - ./autogen.sh - CONFIG_SITE=$PWD/depends/arm-linux-gnueabihf/share/config.site ./configure --enable-reduce-exports LDFLAGS=-static-libstdc++ - make - - -For further documentation on the depends system see [README.md](../depends/README.md) in the depends directory. From 3265b54a2f656995addb45892bb9a88ecb75dbfc Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Thu, 18 Apr 2024 11:27:32 +0000 Subject: [PATCH 5/6] merge bitcoin#24624: Avoid potential -Wdeprecated-enum-enum-conversion warnings --- src/qt/bitcoingui.cpp | 7 ++++--- src/qt/guiutil.cpp | 5 +++-- src/qt/rpcconsole.cpp | 11 ++++++----- src/qt/transactionview.cpp | 2 +- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index ac22dc5d6b..80dbf3b8c1 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -373,7 +374,7 @@ void BitcoinGUI::createActions() quitAction = new QAction(tr("E&xit"), this); quitAction->setStatusTip(tr("Quit application")); - quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); + quitAction->setShortcut(QKeySequence(tr("Ctrl+Q"))); quitAction->setMenuRole(QAction::QuitRole); aboutAction = new QAction(tr("&About %1").arg(PACKAGE_NAME), this); aboutAction->setStatusTip(tr("Show information about %1").arg(PACKAGE_NAME)); @@ -463,7 +464,7 @@ void BitcoinGUI::createActions() showCoinJoinHelpAction->setStatusTip(tr("Show the %1 basic information").arg(strCoinJoinName)); m_mask_values_action = new QAction(tr("&Discreet mode"), this); - m_mask_values_action->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_D)); + m_mask_values_action->setShortcut(QKeySequence(tr("Ctrl+Shift+D"))); m_mask_values_action->setStatusTip(tr("Mask the values in the Overview tab")); m_mask_values_action->setCheckable(true); @@ -606,7 +607,7 @@ void BitcoinGUI::createMenuBar() QMenu* window_menu = appMenuBar->addMenu(tr("&Window")); QAction* minimize_action = window_menu->addAction(tr("Minimize")); - minimize_action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M)); + minimize_action->setShortcut(QKeySequence(tr("Ctrl+M"))); connect(minimize_action, &QAction::triggered, [] { QApplication::activeWindow()->showMinimized(); }); diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 22a33bcc33..2fd1f32611 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -613,7 +614,7 @@ void bringToFront(QWidget* w) void handleCloseWindowShortcut(QWidget* w) { - QObject::connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), w), &QShortcut::activated, w, &QWidget::close); + QObject::connect(new QShortcut(QKeySequence(QObject::tr("Ctrl+W")), w), &QShortcut::activated, w, &QWidget::close); } void openDebugLogfile() @@ -1618,7 +1619,7 @@ void updateButtonGroupShortcuts(QButtonGroup* buttonGroup) int nKey = 0; for (auto button : buttonGroup->buttons()) { if (button->isVisible()) { - button->setShortcut(QKeySequence(modifier + Qt::Key_1 + nKey++)); + button->setShortcut(QKeySequence(static_cast(modifier) | static_cast(Qt::Key_1) | nKey++)); } else { button->setShortcut(QKeySequence()); } diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 44b51d61d0..dd7f52c56d 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -1459,11 +1460,11 @@ QString RPCConsole::tabTitle(TabTypes tab_type) const QKeySequence RPCConsole::tabShortcut(TabTypes tab_type) const { switch (tab_type) { - case TabTypes::INFO: return QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_I); - case TabTypes::CONSOLE: return QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_C); - case TabTypes::GRAPH: return QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_G); - case TabTypes::PEERS: return QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_P); - case TabTypes::REPAIR: return QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_R); + case TabTypes::INFO: return QKeySequence(tr("Ctrl+Shift+I")); + case TabTypes::CONSOLE: return QKeySequence(tr("Ctrl+Shift+C")); + case TabTypes::GRAPH: return QKeySequence(tr("Ctrl+Shift+G")); + case TabTypes::PEERS: return QKeySequence(tr("Ctrl+Shift+P")); + case TabTypes::REPAIR: return QKeySequence(tr("Ctrl+Shift+R")); } // no default case, so the compiler can warn about missing cases assert(false); diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 021020f103..bfba03eaa2 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -612,7 +612,7 @@ QWidget *TransactionView::createDateRangeWidget() QSettings settings; dateRangeWidget = new QFrame(); - dateRangeWidget->setFrameStyle(QFrame::Panel | QFrame::Raised); + dateRangeWidget->setFrameStyle(static_cast(QFrame::Panel) | static_cast(QFrame::Raised)); dateRangeWidget->setContentsMargins(1,1,1,1); QHBoxLayout *layout = new QHBoxLayout(dateRangeWidget); layout->setContentsMargins(0,0,0,0); From 740d25c0622626863c164574353043d568ff06ea Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Mon, 21 Feb 2022 16:45:50 +0100 Subject: [PATCH 6/6] merge bitcoin#24406: Fix Wambiguous-reversed-operator compiler warnings --- src/test/fuzz/addrman.cpp | 2 +- src/test/serialize_tests.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test/fuzz/addrman.cpp b/src/test/fuzz/addrman.cpp index d819444b1b..9479e5161e 100644 --- a/src/test/fuzz/addrman.cpp +++ b/src/test/fuzz/addrman.cpp @@ -142,7 +142,7 @@ public: * - vvNew entries refer to the same addresses * - vvTried entries refer to the same addresses */ - bool operator==(const CAddrManDeterministic& other) + bool operator==(const CAddrManDeterministic& other) const { LOCK2(cs, other.cs); diff --git a/src/test/serialize_tests.cpp b/src/test/serialize_tests.cpp index a91fa9297e..f430cd96e5 100644 --- a/src/test/serialize_tests.cpp +++ b/src/test/serialize_tests.cpp @@ -38,13 +38,13 @@ public: READWRITE(obj.txval); } - bool operator==(const CSerializeMethodsTestSingle& rhs) + bool operator==(const CSerializeMethodsTestSingle& rhs) const { - return intval == rhs.intval && \ - boolval == rhs.boolval && \ - stringval == rhs.stringval && \ - strcmp(charstrval, rhs.charstrval) == 0 && \ - *txval == *rhs.txval; + return intval == rhs.intval && + boolval == rhs.boolval && + stringval == rhs.stringval && + strcmp(charstrval, rhs.charstrval) == 0 && + *txval == *rhs.txval; } };