Don't use zero as null pointer constant (-Wzero-as-null-pointer-constant)
This commit is contained in:
1 parent
f436bfd126
commit
e53274868e
8 files changed
+10
-10
No files matched your search
+2
-2
@@ -193,7 +193,7 @@ static bool ProcessUpnp()
|
|||||||
std::string strDesc = PACKAGE_NAME " " + FormatFullVersion();
|
std::string strDesc = PACKAGE_NAME " " + FormatFullVersion();
|
||||||
|
|
||||||
do {
|
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) {
|
if (r != UPNPCOMMAND_SUCCESS) {
|
||||||
ret = false;
|
ret = false;
|
||||||
@@ -206,7 +206,7 @@ static bool ProcessUpnp()
|
|||||||
} while (g_mapport_interrupt.sleep_for(PORT_MAPPING_REANNOUNCE_PERIOD));
|
} while (g_mapport_interrupt.sleep_for(PORT_MAPPING_REANNOUNCE_PERIOD));
|
||||||
g_mapport_interrupt.reset();
|
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);
|
LogPrintf("UPNP_DeletePortMapping() returned: %d\n", r);
|
||||||
freeUPNPDevlist(devlist); devlist = nullptr;
|
freeUPNPDevlist(devlist); devlist = nullptr;
|
||||||
FreeUPNPUrls(&urls);
|
FreeUPNPUrls(&urls);
|
||||||
|
|||||||
+1
-1
@@ -675,7 +675,7 @@ bool ConnectThroughProxy(const Proxy& proxy, const std::string& strDest, uint16_
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!Socks5(strDest, port, 0, sock)) {
|
if (!Socks5(strDest, port, nullptr, sock)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -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 */
|
/* 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.setDataDirectory(dataDir);
|
||||||
intro.setWindowIcon(QIcon(":icons/bitcoin"));
|
intro.setWindowIcon(QIcon(":icons/bitcoin"));
|
||||||
did_show_intro = true;
|
did_show_intro = true;
|
||||||
|
|||||||
+2
-2
@@ -363,10 +363,10 @@ void RandAddStaticEnv(CSHA512& hasher)
|
|||||||
|
|
||||||
#if HAVE_DECL_GETIFADDRS && HAVE_DECL_FREEIFADDRS
|
#if HAVE_DECL_GETIFADDRS && HAVE_DECL_FREEIFADDRS
|
||||||
// Network interfaces
|
// Network interfaces
|
||||||
struct ifaddrs *ifad = NULL;
|
struct ifaddrs *ifad = nullptr;
|
||||||
getifaddrs(&ifad);
|
getifaddrs(&ifad);
|
||||||
struct ifaddrs *ifit = 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, sizeof(ifit));
|
||||||
hasher.Write((const unsigned char*)ifit->ifa_name, strlen(ifit->ifa_name) + 1);
|
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));
|
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;
|
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));
|
T* allocation = static_cast<T*>(LockedPoolManager::Instance().alloc(sizeof(T) * n));
|
||||||
if (!allocation) {
|
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 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;
|
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];
|
u8 tmp[64];
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -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):
|
TorController::TorController(struct event_base* _base, const std::string& tor_control_center, const CService& target):
|
||||||
base(_base),
|
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),
|
reconnect_timeout(RECONNECT_TIMEOUT_START),
|
||||||
m_target(target)
|
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) {
|
} else if (wallet_creation_flags & WALLET_FLAG_DISABLE_PRIVATE_KEYS) {
|
||||||
// Make it impossible to disable private keys after creation
|
// Make it impossible to disable private keys after creation
|
||||||
error = strprintf(_("Error loading %s: Private keys can only be disabled during creation"), walletFile);
|
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)) {
|
} else if (walletInstance->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)) {
|
||||||
for (auto spk_man : walletInstance->GetActiveScriptPubKeyMans()) {
|
for (auto spk_man : walletInstance->GetActiveScriptPubKeyMans()) {
|
||||||
if (spk_man->HavePrivateKeys()) {
|
if (spk_man->HavePrivateKeys()) {
|
||||||
|
|||||||
Reference in new issue
Block a user