Skip to content

Commit 5c240bb

Browse files
Merge dashpay#5986: trivial: remove boost::{function, lexical_cast} usage, backport bitcoin#25550, bitcoin#24624, bitcoin#24406, cleanup some gArgs usage in init
740d25c merge bitcoin#24406: Fix Wambiguous-reversed-operator compiler warnings (Kittywhiskers Van Gogh) 3265b54 merge bitcoin#24624: Avoid potential -Wdeprecated-enum-enum-conversion warnings (Kittywhiskers Van Gogh) 65585e6 merge bitcoin#25550: remove note on arm cross-compilation from build-unix.md (Kittywhiskers Van Gogh) fbc6bc8 init: use local ArgsManager variable instead of global when possible (Kittywhiskers Van Gogh) 9ae39f9 qt: drop leftover `boost::function` usage in Qt, drop header from list (Kittywhiskers Van Gogh) c47e9e7 bench: drop leftover `boost::lexical_cast` benches, drop header from list (Kittywhiskers Van Gogh) Pull request description: ## Additional Information When building Dash with `clang-16`, I use the following `CXXFLAGS`: ``` -Werror -Werror=reorder -Werror=thread-safety -Wno-unused-command-line-argument -Wno-deprecated-builtins -Wno-deprecated-volatile -Wno-ambiguous-reversed-operator -Wno-deprecated-enum-enum-conversion ``` The explanations of the `-Wno*` flags are as follows: | Argument | Reason | | -------------------------------------- | ------------------------------------------------------------ | | `-Wno-unused-command-line-argument` | Lingering use of `-static-libstdc++`, a GCC-ism that isn't recognized as a valid argument in Clang (no longer an issue thanks to dashpay#5958, thanks knst!) | | `-Wno-deprecated-builtins` | Due to usage of [deprecated builtins](https://github.com/dashpay/dash/blob/2dacfb08bdf02fdaf0740edac19435bfaa0e52d3/src/bench/nanobench.h#L104-L110) in `nanobench` that exist even in the [most current version](https://github.com/martinus/nanobench/blob/a5a50c2b33eea2ff1fcb355cacdface43eb42b25/src/include/nanobench.h#L115-L121) (see below) | | `-Wno-deprecated-volatile` | The detection code for C++20 in the CI image (based on Ubuntu `focal`) relies on deprecated volatiles (see below) | | `-Wno-ambiguous-reversed-operator` | Due to an ambiguous operator in a Dash unit test ([source](https://github.com/dashpay/dash/blob/2dacfb08bdf02fdaf0740edac19435bfaa0e52d3/src/test/fuzz/addrman.cpp#L145)) (see below) | | `-Wno-deprecated-enum-enum-conversion` | Due to key combination code in Dash Qt ([source](https://github.com/dashpay/dash/blob/2dacfb08bdf02fdaf0740edac19435bfaa0e52d3/src/qt/bitcoingui.cpp#L376)) (see below) | <details> <summary>-Wno-deprecated-builtins</summary> ``` > make Making all in src make[1]: Entering directory '/src/dash/src' make[2]: Entering directory '/src/dash/src' make[3]: Entering directory '/src/dash' make[3]: Leaving directory '/src/dash' CXX bench/bench_dash-addrman.o In file included from bench/addrman.cpp:6: In file included from ./bench/bench.h:16: ./bench/nanobench.h:952:13: error: builtin __has_trivial_copy is deprecated; use __is_trivially_copyable instead [-Werror,-Wdeprecated-builtins] return !ANKERL_NANOBENCH_IS_TRIVIALLY_COPYABLE(Decayed) || sizeof(Decayed) > sizeof(long) || std::is_pointer<Decayed>::value; ^ ./bench/nanobench.h:107:57: note: expanded from macro 'ANKERL_NANOBENCH_IS_TRIVIALLY_COPYABLE' # define ANKERL_NANOBENCH_IS_TRIVIALLY_COPYABLE(...) __has_trivial_copy(__VA_ARGS__) ^ 1 error generated. make[2]: *** [Makefile:14567: bench/bench_dash-addrman.o] Error 1 make[2]: Leaving directory '/src/dash/src' make[1]: *** [Makefile:18568: all-recursive] Error 1 make[1]: Leaving directory '/src/dash/src' make: *** [Makefile:800: all-recursive] Error 1 ``` </details> <details> <summary>-Wno-deprecated-volatile</summary> ``` > ./configure [...] [...] checking whether clang++-16 supports C++20 features with -h std=c++20... no checking whether clang++-16 supports C++20 features with -std=c++2a... no checking whether clang++-16 supports C++20 features with +std=c++2a... no checking whether clang++-16 supports C++20 features with -h std=c++2a... no configure: error: *** A compiler with support for C++20 language features is required. > cat config.log This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by Dash Core configure 21.0.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ ./configure --prefix=/src/dash/depends/x86_64-pc-linux-gnu --enable-zmq --enable-reduce-exports --disable-crash-hooks --disable-stacktraces --enable-c++20 --enable-suppress-external-warnings --enable-debug --disable-ccache --with-sanitizers=thread [...] configure:4450: checking whether clang++-16 accepts -g configure:4470: clang++-16 -c -g -I/src/dash/depends/x86_64-pc-linux-gnu/include/ -DDEBUG_LOCKORDER -DENABLE_DASH_DEBUG -DARENA_DEBUG conftest.cpp >&5 configure:4470: $? = 0 configure:4511: result: yes configure:4537: checking whether make supports the include directive configure:4552: make -f confmf.GNU && cat confinc.out this is the am__doit target configure:4555: $? = 0 configure:4574: result: yes (GNU style) configure:4599: checking dependency style of clang++-16 configure:4710: result: gcc3 configure:4756: checking whether clang++-16 supports C++20 features with -std=c++20 configure:5558: clang++-16 -std=c++20 -c -pipe -O2 -Werror -Werror=reorder -Werror=thread-safety -Wno-deprecated-builtins -I/src/dash/depends/x86_64-pc-linux-gnu/include/ -DDEBUG_LOCKORDER -DENABLE_DASH_DEBUG -DARENA_DEBUG conftest.cpp >&5 conftest.cpp:109:36: error: volatile-qualified parameter type 'volatile int' is deprecated [-Werror,-Wdeprecated-volatile] test(const int c, volatile int v) // 'volatile is deprecated in C++20' ^ 1 error generated. ``` </details> <details> <summary>-Wno-ambiguous-reversed-operator</summary> ``` > make Making all in src make[1]: Entering directory '/src/dash/src' make[2]: Entering directory '/src/dash/src' make[3]: Entering directory '/src/dash' make[3]: Leaving directory '/src/dash' [...] CXX test/fuzz/fuzz-addrman.o test/fuzz/addrman.cpp:329:22: error: ISO C++20 considers use of overloaded operator '==' (with operand types 'CAddrManDeterministic' and 'CAddrManDeterministic') to be ambiguous despite there being a unique best viable function [-Werror,-Wambiguous-reversed-operator] assert(addr_man1 == addr_man2); ~~~~~~~~~ ^ ~~~~~~~~~ /usr/include/assert.h:93:27: note: expanded from macro 'assert' (static_cast <bool> (expr) \ ^~~~ test/fuzz/addrman.cpp:145:10: note: ambiguity is between a regular call to this operator and a call with the argument order reversed bool operator==(const CAddrManDeterministic& other) ^ test/fuzz/addrman.cpp:145:10: note: mark 'operator==' as const or add a matching 'operator!=' to resolve the ambiguity 1 error generated. make[2]: *** [Makefile:15393: test/fuzz/fuzz-addrman.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[3]: Leaving directory '/src/dash/src/dashbls' make[2]: Leaving directory '/src/dash/src' make[1]: *** [Makefile:18568: all-recursive] Error 1 make[1]: Leaving directory '/src/dash/src' make: *** [Makefile:800: all-recursive] Error 1 ``` </details> <details> <summary>-Wno-deprecated-enum-enum-conversion</summary> ``` > make Making all in src make[1]: Entering directory '/src/dash/src' make[2]: Entering directory '/src/dash/src' make[3]: Entering directory '/src/dash' make[3]: Leaving directory '/src/dash' [...] CXX qt/libbitcoinqt_a-bitcoingui.o qt/bitcoingui.cpp:376:51: error: arithmetic between different enumeration types ('Qt::Modifier' and 'Qt::Key') is deprecated [-Werror,-Wdeprecated-enum-enum-conversion] quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); ~~~~~~~~ ^ ~~~~~~~~~ qt/bitcoingui.cpp:609:56: error: arithmetic between different enumeration types ('Qt::Modifier' and 'Qt::Key') is deprecated [-Werror,-Wdeprecated-enum-enum-conversion] minimize_action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M)); ~~~~~~~~ ^ ~~~~~~~~~ 2 errors generated. make[2]: *** [Makefile:12803: qt/libbitcoinqt_a-bitcoingui.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory '/src/dash/src' make[1]: *** [Makefile:18568: all-recursive] Error 1 make[1]: Leaving directory '/src/dash/src' make: *** [Makefile:800: all-recursive] Error 1 ``` </details> This pull request removes the need for the last two `-Wno*` flags, removes some leftover `boost::`{`function`, `lexical_cast`} usage and some `gArgs` usage where a local variable would be more applicable. Additionally, in some builds, there is an deprecation warning (`-Wdeprecation`) for using `[=]` and relying on its implicit capture of `this` (see below), this can be seen during GCC builds but not Clang builds and correspond to a proposal to the C++20 standard ([proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0806r2.html)). It has also been mentioned at https://en.cppreference.com/w/cpp/language/lambda, "The implicit capture of `*this` when the capture default is `=` is deprecated. _(since C++20)_". This has also been remedied as part of this PR. <details> <summary>-Wdeprecated</summary> ``` > make -j10 [...] CXX qt/libbitcoinqt_a-trafficgraphwidget.o qt/optionsdialog.cpp: In lambda function: qt/optionsdialog.cpp:195:63: warning: implicit capture of 'this' via '[=]' is deprecated in C++20 [-Wdeprecated] 195 | connect(appearance, &AppearanceWidget::appearanceChanged, [=](){ | ^ qt/optionsdialog.cpp:195:63: note: add explicit 'this' or '*this' capture qt/optionsdialog.cpp: In lambda function: qt/optionsdialog.cpp:277:55: warning: implicit capture of 'this' via '[=]' is deprecated in C++20 [-Wdeprecated] 277 | connect(ui->coinJoinEnabled, &QCheckBox::clicked, [=](bool fChecked) { | ^ qt/optionsdialog.cpp:277:55: note: add explicit 'this' or '*this' capture qt/optionsdialog.cpp: In lambda function: qt/optionsdialog.cpp:293:45: warning: implicit capture of 'this' via '[=]' is deprecated in C++20 [-Wdeprecated] 293 | connect(this, &OptionsDialog::rejected, [=]() { | ^ qt/optionsdialog.cpp:293:45: note: add explicit 'this' or '*this' capture CXX qt/libbitcoinqt_a-utilitydialog.o CXX qt/libbitcoinqt_a-addressbookpage.o [...] ``` </details> ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)** - [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)** - [x] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: PastaPastaPasta: utACK 740d25c knst: utACK 740d25c Tree-SHA512: 52793f9862192ccb556debcac2ec766c4f86e69ec4bedc2fdbaaff965ab4ac478b65b3983b1cb3a92610db85aee6f8668b0ded3494c617c5af7d8801284e461b
2 parents 0bb188a + 740d25c commit 5c240bb

File tree

11 files changed

+24
-81
lines changed

11 files changed

+24
-81
lines changed

doc/build-unix.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -313,27 +313,3 @@ or building and depending on a local version of Berkeley DB 4.8. The readily ava
313313
`--with-incompatible-bdb` according to the [PKGBUILD](https://projects.archlinux.org/svntogit/community.git/tree/bitcoin/trunk/PKGBUILD).
314314
As mentioned above, when maintaining portability of the wallet between the standard Dash Core distributions and independently built
315315
node software is desired, Berkeley DB 4.8 must be used.
316-
317-
318-
ARM Cross-compilation
319-
-------------------
320-
These steps can be performed on, for example, an Ubuntu VM. The depends system
321-
will also work on other Linux distributions, however the commands for
322-
installing the toolchain will be different.
323-
324-
Make sure you install the build requirements mentioned above.
325-
Then, install the toolchain and curl:
326-
327-
sudo apt-get install g++-arm-linux-gnueabihf curl
328-
329-
To build executables for ARM:
330-
331-
cd depends
332-
make HOST=arm-linux-gnueabihf NO_QT=1
333-
cd ..
334-
./autogen.sh
335-
CONFIG_SITE=$PWD/depends/arm-linux-gnueabihf/share/config.site ./configure --enable-reduce-exports LDFLAGS=-static-libstdc++
336-
make
337-
338-
339-
For further documentation on the depends system see [README.md](../depends/README.md) in the depends directory.

src/bench/string_cast.cpp

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include <util/strencodings.h>
88
#include <util/string.h>
99

10-
#include <boost/lexical_cast.hpp>
1110
#include <string>
1211

1312
template <typename T>
@@ -25,21 +24,6 @@ static void int_atoi(benchmark::Bench& bench)
2524
});
2625
}
2726

28-
static void int_lexical_cast(benchmark::Bench& bench)
29-
{
30-
bench.run([&] {
31-
boost::lexical_cast<int>("1");
32-
});
33-
}
34-
35-
static void strings_1_lexical_cast(benchmark::Bench& bench)
36-
{
37-
int i{0};
38-
bench.run([&] {
39-
boost::lexical_cast<std::string>(++i);
40-
});
41-
}
42-
4327
static void strings_1_numberToString(benchmark::Bench& bench)
4428
{
4529
int i{0};
@@ -56,19 +40,6 @@ static void strings_1_tostring(benchmark::Bench& bench)
5640
});
5741
}
5842

59-
static void strings_2_multi_lexical_cast(benchmark::Bench& bench)
60-
{
61-
int i{0};
62-
bench.run([&] { static_cast<void>(
63-
boost::lexical_cast<std::string>(i) +
64-
boost::lexical_cast<std::string>(i+1) +
65-
boost::lexical_cast<std::string>(i+2) +
66-
boost::lexical_cast<std::string>(i+3) +
67-
boost::lexical_cast<std::string>(i+4));
68-
++i;
69-
});
70-
}
71-
7243
static void strings_2_multi_numberToString(benchmark::Bench& bench)
7344
{
7445
int i{0};
@@ -97,11 +68,8 @@ static void strings_2_strptintf(benchmark::Bench& bench)
9768
}
9869

9970
BENCHMARK(int_atoi);
100-
BENCHMARK(int_lexical_cast);
101-
BENCHMARK(strings_1_lexical_cast);
10271
BENCHMARK(strings_1_numberToString);
10372
BENCHMARK(strings_1_tostring);
104-
BENCHMARK(strings_2_multi_lexical_cast);
10573
BENCHMARK(strings_2_multi_numberToString);
10674
BENCHMARK(strings_2_multi_tostring);
10775
BENCHMARK(strings_2_strptintf);

src/init.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ void SetupServerArgs(NodeContext& node)
592592
argsman.AddArg("-proxyrandomize", strprintf("Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)", DEFAULT_PROXYRANDOMIZE), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
593593
argsman.AddArg("-seednode=<ip>", "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);
594594
argsman.AddArg("-socketevents=<mode>", "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);
595-
gArgs.AddArg("-networkactive", "Enable all P2P network activity (default: 1). Can be changed by the setnetworkactive RPC command", ArgsManager::ALLOW_BOOL, OptionsCategory::CONNECTION);
595+
argsman.AddArg("-networkactive", "Enable all P2P network activity (default: 1). Can be changed by the setnetworkactive RPC command", ArgsManager::ALLOW_BOOL, OptionsCategory::CONNECTION);
596596
argsman.AddArg("-timeout=<n>", 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);
597597
argsman.AddArg("-torcontrol=<ip>:<port>", strprintf("Tor control port to use if onion listening enabled (default: %s)", DEFAULT_TOR_CONTROL), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
598598
argsman.AddArg("-torpassword=<pass>", "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
16631663
assert(!node.banman);
16641664
node.banman = std::make_unique<BanMan>(GetDataDir() / "banlist", &uiInterface, args.GetArg("-bantime", DEFAULT_MISBEHAVING_BANTIME));
16651665
assert(!node.connman);
1666-
node.connman = std::make_unique<CConnman>(GetRand(std::numeric_limits<uint64_t>::max()), GetRand(std::numeric_limits<uint64_t>::max()), *node.addrman, gArgs.GetBoolArg("-networkactive", true));
1666+
node.connman = std::make_unique<CConnman>(GetRand(std::numeric_limits<uint64_t>::max()), GetRand(std::numeric_limits<uint64_t>::max()), *node.addrman, args.GetBoolArg("-networkactive", true));
16671667

16681668
assert(!node.fee_estimator);
16691669
// Don't initialize fee estimation with old data if we don't relay transactions,

src/qt/bitcoingui.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include <QComboBox>
5050
#include <QDateTime>
5151
#include <QDragEnterEvent>
52+
#include <QKeySequence>
5253
#include <QListWidget>
5354
#include <QMenu>
5455
#include <QMenuBar>
@@ -373,7 +374,7 @@ void BitcoinGUI::createActions()
373374

374375
quitAction = new QAction(tr("E&xit"), this);
375376
quitAction->setStatusTip(tr("Quit application"));
376-
quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
377+
quitAction->setShortcut(QKeySequence(tr("Ctrl+Q")));
377378
quitAction->setMenuRole(QAction::QuitRole);
378379
aboutAction = new QAction(tr("&About %1").arg(PACKAGE_NAME), this);
379380
aboutAction->setStatusTip(tr("Show information about %1").arg(PACKAGE_NAME));
@@ -463,7 +464,7 @@ void BitcoinGUI::createActions()
463464
showCoinJoinHelpAction->setStatusTip(tr("Show the %1 basic information").arg(strCoinJoinName));
464465

465466
m_mask_values_action = new QAction(tr("&Discreet mode"), this);
466-
m_mask_values_action->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_D));
467+
m_mask_values_action->setShortcut(QKeySequence(tr("Ctrl+Shift+D")));
467468
m_mask_values_action->setStatusTip(tr("Mask the values in the Overview tab"));
468469
m_mask_values_action->setCheckable(true);
469470

@@ -606,7 +607,7 @@ void BitcoinGUI::createMenuBar()
606607
QMenu* window_menu = appMenuBar->addMenu(tr("&Window"));
607608

608609
QAction* minimize_action = window_menu->addAction(tr("Minimize"));
609-
minimize_action->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M));
610+
minimize_action->setShortcut(QKeySequence(tr("Ctrl+M")));
610611
connect(minimize_action, &QAction::triggered, [] {
611612
QApplication::activeWindow()->showMinimized();
612613
});

src/qt/guiutil.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#include <QGuiApplication>
5353
#include <QJsonObject>
5454
#include <QKeyEvent>
55+
#include <QKeySequence>
5556
#include <QLatin1String>
5657
#include <QLineEdit>
5758
#include <QList>
@@ -613,7 +614,7 @@ void bringToFront(QWidget* w)
613614

614615
void handleCloseWindowShortcut(QWidget* w)
615616
{
616-
QObject::connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), w), &QShortcut::activated, w, &QWidget::close);
617+
QObject::connect(new QShortcut(QKeySequence(QObject::tr("Ctrl+W")), w), &QShortcut::activated, w, &QWidget::close);
617618
}
618619

619620
void openDebugLogfile()
@@ -1618,7 +1619,7 @@ void updateButtonGroupShortcuts(QButtonGroup* buttonGroup)
16181619
int nKey = 0;
16191620
for (auto button : buttonGroup->buttons()) {
16201621
if (button->isVisible()) {
1621-
button->setShortcut(QKeySequence(modifier + Qt::Key_1 + nKey++));
1622+
button->setShortcut(QKeySequence(static_cast<int>(modifier) | static_cast<int>(Qt::Key_1) | nKey++));
16221623
} else {
16231624
button->setShortcut(QKeySequence());
16241625
}

src/qt/rpcconsole.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <QFontDatabase>
4242
#include <QDateTime>
4343
#include <QKeyEvent>
44+
#include <QKeySequence>
4445
#include <QMenu>
4546
#include <QMessageBox>
4647
#include <QScreen>
@@ -1459,11 +1460,11 @@ QString RPCConsole::tabTitle(TabTypes tab_type) const
14591460
QKeySequence RPCConsole::tabShortcut(TabTypes tab_type) const
14601461
{
14611462
switch (tab_type) {
1462-
case TabTypes::INFO: return QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_I);
1463-
case TabTypes::CONSOLE: return QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_C);
1464-
case TabTypes::GRAPH: return QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_G);
1465-
case TabTypes::PEERS: return QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_P);
1466-
case TabTypes::REPAIR: return QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_R);
1463+
case TabTypes::INFO: return QKeySequence(tr("Ctrl+Shift+I"));
1464+
case TabTypes::CONSOLE: return QKeySequence(tr("Ctrl+Shift+C"));
1465+
case TabTypes::GRAPH: return QKeySequence(tr("Ctrl+Shift+G"));
1466+
case TabTypes::PEERS: return QKeySequence(tr("Ctrl+Shift+P"));
1467+
case TabTypes::REPAIR: return QKeySequence(tr("Ctrl+Shift+R"));
14671468
} // no default case, so the compiler can warn about missing cases
14681469

14691470
assert(false);

src/qt/trafficgraphwidget.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
#include <qt/trafficgraphdata.h>
99

10-
#include <boost/function.hpp>
11-
1210
#include <QWidget>
1311
#include <QQueue>
1412

@@ -37,7 +35,7 @@ public Q_SLOTS:
3735
void clear();
3836

3937
private:
40-
typedef boost::function<float(const TrafficSample&)> SampleChooser;
38+
typedef std::function<float(const TrafficSample&)> SampleChooser;
4139
void paintPath(QPainterPath &path, const TrafficGraphData::SampleQueue &queue, SampleChooser chooser);
4240

4341
QTimer *timer;

src/qt/transactionview.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ QWidget *TransactionView::createDateRangeWidget()
612612
QSettings settings;
613613

614614
dateRangeWidget = new QFrame();
615-
dateRangeWidget->setFrameStyle(QFrame::Panel | QFrame::Raised);
615+
dateRangeWidget->setFrameStyle(static_cast<int>(QFrame::Panel) | static_cast<int>(QFrame::Raised));
616616
dateRangeWidget->setContentsMargins(1,1,1,1);
617617
QHBoxLayout *layout = new QHBoxLayout(dateRangeWidget);
618618
layout->setContentsMargins(0,0,0,0);

src/test/fuzz/addrman.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class CAddrManDeterministic : public CAddrMan
142142
* - vvNew entries refer to the same addresses
143143
* - vvTried entries refer to the same addresses
144144
*/
145-
bool operator==(const CAddrManDeterministic& other)
145+
bool operator==(const CAddrManDeterministic& other) const
146146
{
147147
LOCK2(cs, other.cs);
148148

src/test/serialize_tests.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ class CSerializeMethodsTestSingle
3838
READWRITE(obj.txval);
3939
}
4040

41-
bool operator==(const CSerializeMethodsTestSingle& rhs)
41+
bool operator==(const CSerializeMethodsTestSingle& rhs) const
4242
{
43-
return intval == rhs.intval && \
44-
boolval == rhs.boolval && \
45-
stringval == rhs.stringval && \
46-
strcmp(charstrval, rhs.charstrval) == 0 && \
47-
*txval == *rhs.txval;
43+
return intval == rhs.intval &&
44+
boolval == rhs.boolval &&
45+
stringval == rhs.stringval &&
46+
strcmp(charstrval, rhs.charstrval) == 0 &&
47+
*txval == *rhs.txval;
4848
}
4949
};
5050

0 commit comments

Comments
 (0)