Eliminate variable shadowing warnings with MSVC (#17)

This commit is contained in:
Mat M 2016-09-04 06:30:57 -04:00 committed by Merry
parent 7f9a0c3c38
commit 858796a029
5 changed files with 16 additions and 7 deletions

View file

@ -26,7 +26,16 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules)
# Compiler flags
if (MSVC)
add_compile_options(/W3 /MP /Zi /Zo /EHsc /WX)
add_compile_options(/W3
/w34456 # Declaration of 'var' hides previous local declaration
/w34457 # Declaration of 'var' hides function parameter
/w34458 # Declaration of 'var' hides class member
/w34459 # Declaration of 'var' hides global definition
/MP
/Zi
/Zo
/EHsc
/WX)
add_compile_options(/DNOMINMAX)
else()
add_compile_options(-Wall

View file

@ -227,9 +227,9 @@ void BlockOfCode::nop(size_t size) {
}
}
void BlockOfCode::SetCodePtr(CodePtr ptr) {
void BlockOfCode::SetCodePtr(CodePtr code_ptr) {
// The "size" defines where top_, the insertion point, is.
size_t required_size = reinterpret_cast<const u8*>(ptr) - getCode();
size_t required_size = reinterpret_cast<const u8*>(code_ptr) - getCode();
setSize(required_size);
}

View file

@ -127,7 +127,7 @@ public:
void int3() { db(0xCC); }
void nop(size_t size = 1);
void SetCodePtr(CodePtr ptr);
void SetCodePtr(CodePtr code_ptr);
void EnsurePatchLocationSize(CodePtr begin, size_t size);
#ifdef _WIN32

View file

@ -46,8 +46,8 @@ Arm::LocationDescriptor Block::ConditionFailedLocation() const {
return cond_failed.get();
}
void Block::SetConditionFailedLocation(Arm::LocationDescriptor location) {
cond_failed = location;
void Block::SetConditionFailedLocation(Arm::LocationDescriptor fail_location) {
cond_failed = fail_location;
}
size_t& Block::ConditionFailedCycleCount() {

View file

@ -87,7 +87,7 @@ public:
/// Gets the location of the block to execute if the predicated condition fails.
Arm::LocationDescriptor ConditionFailedLocation() const;
/// Sets the location of the block to execute if the predicated condition fails.
void SetConditionFailedLocation(Arm::LocationDescriptor location);
void SetConditionFailedLocation(Arm::LocationDescriptor fail_location);
/// Determines whether or not a prediated condition failure block is present.
bool HasConditionFailedLocation() const;