mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Don't use zero as null pointer constant (-Wzero-as-null-pointer-constant)
This commit is contained in:
@@ -193,7 +193,7 @@ static bool ProcessUpnp()
|
||||
std::string strDesc = PACKAGE_NAME " " + FormatFullVersion();
|
||||
|
||||
do {
|
||||
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port.c_str(), port.c_str(), lanaddr, strDesc.c_str(), "TCP", 0, "0");
|
||||
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port.c_str(), port.c_str(), lanaddr, strDesc.c_str(), "TCP", nullptr, "0");
|
||||
|
||||
if (r != UPNPCOMMAND_SUCCESS) {
|
||||
ret = false;
|
||||
@@ -206,7 +206,7 @@ static bool ProcessUpnp()
|
||||
} while (g_mapport_interrupt.sleep_for(PORT_MAPPING_REANNOUNCE_PERIOD));
|
||||
g_mapport_interrupt.reset();
|
||||
|
||||
r = UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, port.c_str(), "TCP", 0);
|
||||
r = UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, port.c_str(), "TCP", nullptr);
|
||||
LogPrintf("UPNP_DeletePortMapping() returned: %d\n", r);
|
||||
freeUPNPDevlist(devlist); devlist = nullptr;
|
||||
FreeUPNPUrls(&urls);
|
||||
|
||||
@@ -675,7 +675,7 @@ bool ConnectThroughProxy(const Proxy& proxy, const std::string& strDest, uint16_
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!Socks5(strDest, port, 0, sock)) {
|
||||
if (!Socks5(strDest, port, nullptr, sock)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ bool Intro::showIfNeeded(bool& did_show_intro, int64_t& prune_MiB)
|
||||
}
|
||||
|
||||
/* If current default data directory does not exist, let the user choose one */
|
||||
Intro intro(0, Params().AssumedBlockchainSize(), Params().AssumedChainStateSize());
|
||||
Intro intro(nullptr, Params().AssumedBlockchainSize(), Params().AssumedChainStateSize());
|
||||
intro.setDataDirectory(dataDir);
|
||||
intro.setWindowIcon(QIcon(":icons/bitcoin"));
|
||||
did_show_intro = true;
|
||||
|
||||
@@ -363,10 +363,10 @@ void RandAddStaticEnv(CSHA512& hasher)
|
||||
|
||||
#if HAVE_DECL_GETIFADDRS && HAVE_DECL_FREEIFADDRS
|
||||
// Network interfaces
|
||||
struct ifaddrs *ifad = NULL;
|
||||
struct ifaddrs *ifad = nullptr;
|
||||
getifaddrs(&ifad);
|
||||
struct ifaddrs *ifit = ifad;
|
||||
while (ifit != NULL) {
|
||||
while (ifit != nullptr) {
|
||||
hasher.Write((const unsigned char*)&ifit, sizeof(ifit));
|
||||
hasher.Write((const unsigned char*)ifit->ifa_name, strlen(ifit->ifa_name) + 1);
|
||||
hasher.Write((const unsigned char*)&ifit->ifa_flags, sizeof(ifit->ifa_flags));
|
||||
|
||||
@@ -37,7 +37,7 @@ struct secure_allocator : public std::allocator<T> {
|
||||
typedef secure_allocator<_Other> other;
|
||||
};
|
||||
|
||||
T* allocate(std::size_t n, const void* hint = 0)
|
||||
T* allocate(std::size_t n, const void* hint = nullptr)
|
||||
{
|
||||
T* allocation = static_cast<T*>(LockedPoolManager::Instance().alloc(sizeof(T) * n));
|
||||
if (!allocation) {
|
||||
|
||||
@@ -128,7 +128,7 @@ void ECRYPT_encrypt_bytes(ECRYPT_ctx* x, const u8* m, u8* c, u32 bytes)
|
||||
{
|
||||
u32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15;
|
||||
u32 j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15;
|
||||
u8* ctarget = NULL;
|
||||
u8* ctarget = nullptr;
|
||||
u8 tmp[64];
|
||||
uint32_t i;
|
||||
|
||||
|
||||
@@ -306,7 +306,7 @@ std::map<std::string,std::string> ParseTorReplyMapping(const std::string &s)
|
||||
|
||||
TorController::TorController(struct event_base* _base, const std::string& tor_control_center, const CService& target):
|
||||
base(_base),
|
||||
m_tor_control_center(tor_control_center), conn(base), reconnect(true), reconnect_ev(0),
|
||||
m_tor_control_center(tor_control_center), conn(base), reconnect(true), reconnect_ev(nullptr),
|
||||
reconnect_timeout(RECONNECT_TIMEOUT_START),
|
||||
m_target(target)
|
||||
{
|
||||
|
||||
@@ -2768,7 +2768,7 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
|
||||
} else if (wallet_creation_flags & WALLET_FLAG_DISABLE_PRIVATE_KEYS) {
|
||||
// Make it impossible to disable private keys after creation
|
||||
error = strprintf(_("Error loading %s: Private keys can only be disabled during creation"), walletFile);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
} else if (walletInstance->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)) {
|
||||
for (auto spk_man : walletInstance->GetActiveScriptPubKeyMans()) {
|
||||
if (spk_man->HavePrivateKeys()) {
|
||||
|
||||
Reference in New Issue
Block a user