Skip to content

Commit 9de90bb

Browse files
committed
Do not shadow variables (gcc set)
1 parent 43e8150 commit 9de90bb

File tree

14 files changed

+45
-45
lines changed

14 files changed

+45
-45
lines changed

src/arith_uint256.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ unsigned int base_uint<BITS>::bits() const
173173
{
174174
for (int pos = WIDTH - 1; pos >= 0; pos--) {
175175
if (pn[pos]) {
176-
for (int bits = 31; bits > 0; bits--) {
177-
if (pn[pos] & 1 << bits)
178-
return 32 * pos + bits + 1;
176+
for (int nbits = 31; nbits > 0; nbits--) {
177+
if (pn[pos] & 1 << nbits)
178+
return 32 * pos + nbits + 1;
179179
}
180180
return 32 * pos + 1;
181181
}

src/bench/lockedpool.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#define BITER 5000
1414
#define MSIZE 2048
1515

16-
static void LockedPool(benchmark::State& state)
16+
static void BenchLockedPool(benchmark::State& state)
1717
{
1818
void *synth_base = reinterpret_cast<void*>(0x08000000);
1919
const size_t synth_size = 1024*1024;
@@ -43,5 +43,5 @@ static void LockedPool(benchmark::State& state)
4343
addr.clear();
4444
}
4545

46-
BENCHMARK(LockedPool);
46+
BENCHMARK(BenchLockedPool);
4747

src/chain.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,9 @@ class CDiskBlockIndex : public CBlockIndex
358358

359359
template <typename Stream, typename Operation>
360360
inline void SerializationOp(Stream& s, Operation ser_action) {
361-
int nVersion = s.GetVersion();
361+
int _nVersion = s.GetVersion();
362362
if (!(s.GetType() & SER_GETHASH))
363-
READWRITE(VARINT(nVersion));
363+
READWRITE(VARINT(_nVersion));
364364

365365
READWRITE(VARINT(nHeight));
366366
READWRITE(VARINT(nStatus));

src/script/interpreter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class MutableTransactionSignatureChecker : public TransactionSignatureChecker
171171
const CTransaction txTo;
172172

173173
public:
174-
MutableTransactionSignatureChecker(const CMutableTransaction* txToIn, unsigned int nInIn, const CAmount& amount) : TransactionSignatureChecker(&txTo, nInIn, amount), txTo(*txToIn) {}
174+
MutableTransactionSignatureChecker(const CMutableTransaction* txToIn, unsigned int nInIn, const CAmount& amountIn) : TransactionSignatureChecker(&txTo, nInIn, amountIn), txTo(*txToIn) {}
175175
};
176176

177177
bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker, SigVersion sigversion, ScriptError* error = NULL);

src/script/script.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,18 +186,18 @@ unsigned int CScript::GetSigOpCount(const CScript& scriptSig) const
186186
// get the last item that the scriptSig
187187
// pushes onto the stack:
188188
const_iterator pc = scriptSig.begin();
189-
vector<unsigned char> data;
189+
vector<unsigned char> vData;
190190
while (pc < scriptSig.end())
191191
{
192192
opcodetype opcode;
193-
if (!scriptSig.GetOp(pc, opcode, data))
193+
if (!scriptSig.GetOp(pc, opcode, vData))
194194
return 0;
195195
if (opcode > OP_16)
196196
return 0;
197197
}
198198

199199
/// ... and return its opcount:
200-
CScript subscript(data.begin(), data.end());
200+
CScript subscript(vData.begin(), vData.end());
201201
return subscript.GetSigOpCount(true);
202202
}
203203

src/script/script.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -449,16 +449,16 @@ class CScript : public CScriptBase
449449
else if (b.size() <= 0xffff)
450450
{
451451
insert(end(), OP_PUSHDATA2);
452-
uint8_t data[2];
453-
WriteLE16(data, b.size());
454-
insert(end(), data, data + sizeof(data));
452+
uint8_t _data[2];
453+
WriteLE16(_data, b.size());
454+
insert(end(), _data, _data + sizeof(_data));
455455
}
456456
else
457457
{
458458
insert(end(), OP_PUSHDATA4);
459-
uint8_t data[4];
460-
WriteLE32(data, b.size());
461-
insert(end(), data, data + sizeof(data));
459+
uint8_t _data[4];
460+
WriteLE32(_data, b.size());
461+
insert(end(), _data, _data + sizeof(_data));
462462
}
463463
insert(end(), b.begin(), b.end());
464464
return *this;

src/script/sigcache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CachingTransactionSignatureChecker : public TransactionSignatureChecker
2222
bool store;
2323

2424
public:
25-
CachingTransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn, const CAmount& amount, bool storeIn, PrecomputedTransactionData& txdataIn) : TransactionSignatureChecker(txToIn, nInIn, amount, txdataIn), store(storeIn) {}
25+
CachingTransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn, const CAmount& amountIn, bool storeIn, PrecomputedTransactionData& txdataIn) : TransactionSignatureChecker(txToIn, nInIn, amountIn, txdataIn), store(storeIn) {}
2626

2727
bool VerifySignature(const std::vector<unsigned char>& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const;
2828
};

src/script/sign.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class MutableTransactionSignatureCreator : public TransactionSignatureCreator {
4848
CTransaction tx;
4949

5050
public:
51-
MutableTransactionSignatureCreator(const CKeyStore* keystoreIn, const CMutableTransaction* txToIn, unsigned int nInIn, const CAmount& amount, int nHashTypeIn) : TransactionSignatureCreator(keystoreIn, &tx, nInIn, amount, nHashTypeIn), tx(*txToIn) {}
51+
MutableTransactionSignatureCreator(const CKeyStore* keystoreIn, const CMutableTransaction* txToIn, unsigned int nInIn, const CAmount& amountIn, int nHashTypeIn) : TransactionSignatureCreator(keystoreIn, &tx, nInIn, amountIn, nHashTypeIn), tx(*txToIn) {}
5252
};
5353

5454
/** A signature creator that just produces 72-byte empty signatures. */

src/streams.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,11 +586,11 @@ class CBufferedFile
586586
readNow = nAvail;
587587
if (readNow == 0)
588588
return false;
589-
size_t read = fread((void*)&vchBuf[pos], 1, readNow, src);
590-
if (read == 0) {
589+
size_t nBytes = fread((void*)&vchBuf[pos], 1, readNow, src);
590+
if (nBytes == 0) {
591591
throw std::ios_base::failure(feof(src) ? "CBufferedFile::Fill: end of file" : "CBufferedFile::Fill: fread failed");
592592
} else {
593-
nSrcPos += read;
593+
nSrcPos += nBytes;
594594
return true;
595595
}
596596
}

src/support/lockedpool.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ LockedPool::LockedPageArena::~LockedPageArena()
357357
/*******************************************************************************/
358358
// Implementation: LockedPoolManager
359359
//
360-
LockedPoolManager::LockedPoolManager(std::unique_ptr<LockedPageAllocator> allocator):
361-
LockedPool(std::move(allocator), &LockedPoolManager::LockingFailed)
360+
LockedPoolManager::LockedPoolManager(std::unique_ptr<LockedPageAllocator> allocator_in):
361+
LockedPool(std::move(allocator_in), &LockedPoolManager::LockingFailed)
362362
{
363363
}
364364

0 commit comments

Comments
 (0)