Skip to content

Commit

Permalink
Fix two compiler warnings (clang 11.0.0)
Browse files Browse the repository at this point in the history
Found during testing of !122 using clang 11.

Checked by builds on clang 11.0.0, clang 7.0.1-8 (debian10) and gcc 8.3.0
that these fixes cause no regression in build or unit tests
(ninja -v check)
  • Loading branch information
ftrader authored and sickpig committed Apr 11, 2020
1 parent d665351 commit 38e9fde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions src/primitives/transaction.h
Expand Up @@ -346,12 +346,7 @@ static inline CTransactionRef MakeTransactionRef(Tx &&txIn) {
struct PrecomputedTransactionData {
uint256 hashPrevouts, hashSequence, hashOutputs;

PrecomputedTransactionData()
: hashPrevouts(), hashSequence(), hashOutputs() {}

PrecomputedTransactionData(const PrecomputedTransactionData &txdata)
: hashPrevouts(txdata.hashPrevouts), hashSequence(txdata.hashSequence),
hashOutputs(txdata.hashOutputs) {}
PrecomputedTransactionData() = default;

template <class T> explicit PrecomputedTransactionData(const T &tx);
};
Expand Down
4 changes: 2 additions & 2 deletions src/qt/guiutil.cpp
Expand Up @@ -915,8 +915,8 @@ QString formatServicesStr(quint64 mask) {
}

QString formatPingTime(double dPingTime) {
return (dPingTime == std::numeric_limits<int64_t>::max() / 1e6 ||
dPingTime == 0)
return (dPingTime >= double(std::numeric_limits<int64_t>::max()) / 1e6 ||
dPingTime <= 0.)
? QObject::tr("N/A")
: QString(QObject::tr("%1 ms"))
.arg(QString::number((int)(dPingTime * 1000), 10));
Expand Down

0 comments on commit 38e9fde

Please sign in to comment.