From: svost Date: Sun, 31 Jan 2016 16:24:33 +0000 (+0300) Subject: Get rid of some useless-cast X-Git-Tag: nvc-v0.5.6~96^2 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=40a76f11c7056c53f71bfc60419ba7354016f55f Get rid of some useless-cast --- diff --git a/src/kernel.cpp b/src/kernel.cpp index a8f4f5d..ea2b43e 100644 --- a/src/kernel.cpp +++ b/src/kernel.cpp @@ -162,13 +162,13 @@ static bool SelectBlockFromCandidates(vector >& vSortedBy if (fSelected && hashSelection < hashBest) { hashBest = hashSelection; - *pindexSelected = (const CBlockIndex*) pindex; + *pindexSelected = pindex; } else if (!fSelected) { fSelected = true; hashBest = hashSelection; - *pindexSelected = (const CBlockIndex*) pindex; + *pindexSelected = pindex; } } if (fDebug && GetBoolArg("-printstakemodifier")) diff --git a/src/main.cpp b/src/main.cpp index f6adb17..bf91707 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3672,7 +3672,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) if (!GetBoolArg("-allowreceivebyip")) { - pfrom->PushMessage("reply", hashReply, (int)2, string("")); + pfrom->PushMessage("reply", hashReply, 2, string("")); return true; } @@ -3688,7 +3688,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) // Send back approval of order and pubkey to use CScript scriptPubKey; scriptPubKey << mapReuseKey[pfrom->addr] << OP_CHECKSIG; - pfrom->PushMessage("reply", hashReply, (int)0, scriptPubKey); + pfrom->PushMessage("reply", hashReply, 0, scriptPubKey); } diff --git a/src/net.cpp b/src/net.cpp index 26b8174..22a74a7 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -201,7 +201,7 @@ void static AdvertizeLocal() if (pnode->fSuccessfullyConnected) { CAddress addrLocal = GetLocalAddress(&pnode->addr); - if (addrLocal.IsRoutable() && (CService)addrLocal != (CService)pnode->addrLocal) + if (addrLocal.IsRoutable() && (CService)addrLocal != pnode->addrLocal) { pnode->PushAddress(addrLocal); pnode->addrLocal = addrLocal; diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 260cc57..60ef03e 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -467,7 +467,7 @@ Value getreceivedbyaddress(const Array& params, bool fHelp) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid NovaCoin address"); scriptPubKey.SetDestination(address.Get()); if (!IsMine(*pwalletMain,scriptPubKey)) - return (double)0.0; + return 0.0; // Minimum confirmations int nMinDepth = 1; diff --git a/src/script.h b/src/script.h index ff289a5..745f848 100644 --- a/src/script.h +++ b/src/script.h @@ -486,7 +486,7 @@ public: if (opcode == OP_0) return 0; assert(opcode >= OP_1 && opcode <= OP_16); - return (int)opcode - (int)(OP_1 - 1); + return (opcode - (OP_1 - 1)); } static opcodetype EncodeOP_N(int n) { diff --git a/src/serialize.h b/src/serialize.h index 7eb17c8..03187b9 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -1357,7 +1357,7 @@ public: unsigned int pos = (unsigned int)(nReadPos % vchBuf.size()); size_t nNow = nSize; if (nNow + pos > vchBuf.size()) - nNow = (size_t)(vchBuf.size() - pos); + nNow = vchBuf.size() - pos; if (nNow + nReadPos > nSrcPos) nNow = (size_t)(nSrcPos - nReadPos); memcpy(pch, &vchBuf[pos], nNow); diff --git a/src/wallet.cpp b/src/wallet.cpp index 5595052..d31b2e0 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1688,7 +1688,7 @@ bool CWallet::CreateTransaction(CScript scriptPubKey, int64_t nValue, CWalletTx& void CWallet::GetStakeWeightFromValue(const int64_t& nTime, const int64_t& nValue, uint64_t& nWeight) { - int64_t nTimeWeight = GetWeight(nTime, (int64_t)GetTime()); + int64_t nTimeWeight = GetWeight(nTime, GetTime()); // If time weight is lower or equal to zero then weight is zero. if (nTimeWeight <= 0)