From e1a6729df7f11e33f6dc0939b18995a57c8bf3d8 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Wed, 27 Nov 2019 05:46:03 -0300 Subject: [PATCH] Enable -Wshadow and silence warnings --- CMakeLists.txt | 1 + src/literal_number.cpp | 4 ++-- src/literal_string.cpp | 4 ++-- src/op.cpp | 4 ++-- src/operand.cpp | 2 +- src/sirit.cpp | 2 +- src/stream.cpp | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a7935d5..047041f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,6 +73,7 @@ else() -Wno-missing-braces -Wconversion -Wsign-conversion + -Wshadow -Werror) endif() diff --git a/src/literal_number.cpp b/src/literal_number.cpp index f418be4..3dd8668 100644 --- a/src/literal_number.cpp +++ b/src/literal_number.cpp @@ -9,8 +9,8 @@ namespace Sirit { -LiteralNumber::LiteralNumber(u64 raw, bool is_32) - : Operand{OperandType::Number}, raw{raw}, is_32{is_32} {} +LiteralNumber::LiteralNumber(u64 raw_, bool is_32_) + : Operand{OperandType::Number}, raw{raw_}, is_32{is_32_} {} LiteralNumber::~LiteralNumber() = default; diff --git a/src/literal_string.cpp b/src/literal_string.cpp index bc8e6e1..b201228 100644 --- a/src/literal_string.cpp +++ b/src/literal_string.cpp @@ -10,8 +10,8 @@ namespace Sirit { -LiteralString::LiteralString(std::string string) - : Operand{OperandType::String}, string{std::move(string)} {} +LiteralString::LiteralString(std::string string_) + : Operand{OperandType::String}, string{std::move(string_)} {} LiteralString::~LiteralString() = default; diff --git a/src/op.cpp b/src/op.cpp index 6319584..c75a355 100644 --- a/src/op.cpp +++ b/src/op.cpp @@ -16,8 +16,8 @@ namespace Sirit { -Op::Op(spv::Op opcode, std::optional id, Id result_type) - : Operand{OperandType::Op}, opcode(opcode), result_type(result_type), id(id) {} +Op::Op(spv::Op opcode_, std::optional id_, Id result_type_) + : Operand{OperandType::Op}, opcode{opcode_}, result_type{result_type_}, id{id_} {} Op::~Op() = default; diff --git a/src/operand.cpp b/src/operand.cpp index 196c64f..69e4409 100644 --- a/src/operand.cpp +++ b/src/operand.cpp @@ -9,7 +9,7 @@ namespace Sirit { -Operand::Operand(OperandType operand_type) : operand_type{operand_type} {} +Operand::Operand(OperandType operand_type_) : operand_type{operand_type_} {} Operand::~Operand() = default; diff --git a/src/sirit.cpp b/src/sirit.cpp index 2fb8580..473830c 100644 --- a/src/sirit.cpp +++ b/src/sirit.cpp @@ -20,7 +20,7 @@ static void WriteSet(Stream& stream, const T& set) { } } -Module::Module(u32 version) : version(version) {} +Module::Module(u32 version_) : version{version_} {} Module::~Module() = default; diff --git a/src/stream.cpp b/src/stream.cpp index 7a60faf..32bafbd 100644 --- a/src/stream.cpp +++ b/src/stream.cpp @@ -8,7 +8,7 @@ namespace Sirit { -Stream::Stream(std::vector& words) : words(words) {} +Stream::Stream(std::vector& words_) : words{words_} {} Stream::~Stream() = default;