mirror of
https://github.com/QuasarApp/QuasarAppCoin.git
synced 2025-05-12 17:39:38 +00:00
Remove 'boost::optional'-related gcc warnings
This commit is contained in:
parent
72ca72e637
commit
2d483142a7
@ -5,12 +5,21 @@
|
|||||||
#ifndef BITCOIN_OPTIONAL_H
|
#ifndef BITCOIN_OPTIONAL_H
|
||||||
#define BITCOIN_OPTIONAL_H
|
#define BITCOIN_OPTIONAL_H
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
|
||||||
//! Substitute for C++17 std::optional
|
//! Substitute for C++17 std::optional
|
||||||
template <typename T>
|
template <typename T>
|
||||||
using Optional = boost::optional<T>;
|
using Optional = boost::optional<T>;
|
||||||
|
|
||||||
|
//! Substitute for C++17 std::make_optional
|
||||||
|
template <typename T>
|
||||||
|
Optional<T> MakeOptional(bool condition, T&& value)
|
||||||
|
{
|
||||||
|
return boost::make_optional(condition, std::forward<T>(value));
|
||||||
|
}
|
||||||
|
|
||||||
//! Substitute for C++17 std::nullopt
|
//! Substitute for C++17 std::nullopt
|
||||||
static auto& nullopt = boost::none;
|
static auto& nullopt = boost::none;
|
||||||
|
|
||||||
|
@ -1591,7 +1591,8 @@ static UniValue listsinceblock(const JSONRPCRequest& request)
|
|||||||
auto locked_chain = pwallet->chain().lock();
|
auto locked_chain = pwallet->chain().lock();
|
||||||
LOCK(pwallet->cs_wallet);
|
LOCK(pwallet->cs_wallet);
|
||||||
|
|
||||||
Optional<int> height; // Height of the specified block or the common ancestor, if the block provided was in a deactivated chain.
|
// The way the 'height' is initialized is just a workaround for the gcc bug #47679 since version 4.6.0.
|
||||||
|
Optional<int> height = MakeOptional(false, int()); // Height of the specified block or the common ancestor, if the block provided was in a deactivated chain.
|
||||||
Optional<int> altheight; // Height of the specified block, even if it's in a deactivated chain.
|
Optional<int> altheight; // Height of the specified block, even if it's in a deactivated chain.
|
||||||
int target_confirms = 1;
|
int target_confirms = 1;
|
||||||
isminefilter filter = ISMINE_SPENDABLE;
|
isminefilter filter = ISMINE_SPENDABLE;
|
||||||
|
@ -1642,7 +1642,8 @@ CWallet::ScanResult CWallet::ScanForWalletTransactions(const uint256& start_bloc
|
|||||||
fAbortRescan = false;
|
fAbortRescan = false;
|
||||||
ShowProgress(strprintf("%s " + _("Rescanning..."), GetDisplayName()), 0); // show rescan progress in GUI as dialog or on splashscreen, if -rescan on startup
|
ShowProgress(strprintf("%s " + _("Rescanning..."), GetDisplayName()), 0); // show rescan progress in GUI as dialog or on splashscreen, if -rescan on startup
|
||||||
uint256 tip_hash;
|
uint256 tip_hash;
|
||||||
Optional<int> block_height;
|
// The way the 'block_height' is initialized is just a workaround for the gcc bug #47679 since version 4.6.0.
|
||||||
|
Optional<int> block_height = MakeOptional(false, int());
|
||||||
double progress_begin;
|
double progress_begin;
|
||||||
double progress_end;
|
double progress_end;
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user