Get rid of some useless-cast 270/head
authorsvost <ya.nowa@yandex.ru>
Sun, 31 Jan 2016 16:24:33 +0000 (19:24 +0300)
committersvost <ya.nowa@yandex.ru>
Sun, 31 Jan 2016 16:24:33 +0000 (19:24 +0300)
src/kernel.cpp
src/main.cpp
src/net.cpp
src/rpcwallet.cpp
src/script.h
src/serialize.h
src/wallet.cpp

index a8f4f5d..ea2b43e 100644 (file)
@@ -162,13 +162,13 @@ static bool SelectBlockFromCandidates(vector<pair<int64_t, uint256> >& 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"))
index f6adb17..bf91707 100644 (file)
@@ -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);
     }
 
 
index 26b8174..22a74a7 100644 (file)
@@ -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;
index 260cc57..60ef03e 100644 (file)
@@ -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;
index ff289a5..745f848 100644 (file)
@@ -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)
     {
index 7eb17c8..03187b9 100644 (file)
@@ -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);
index 5595052..d31b2e0 100644 (file)
@@ -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)