Skip to content

Commit

Permalink
Add '-Wshadow' to the compiler flags (#3778)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple authored Nov 13, 2020
1 parent bda2945 commit 58810f3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ config("disabled_warnings") {
}

config("strict_warnings") {
cflags = [ "-Wall" ]
cflags = [
"-Wall",
"-Wshadow",
]

cflags_cc = [ "-Wnon-virtual-dtor" ]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ static uint16_t getOpenOrClosePeriod(EndpointId endpoint, bool open)
return period;
}

static void setMovingState(EndpointId endpoint, uint8_t state)
static void setMovingState(EndpointId endpoint, uint8_t newState)
{
EmberAfStatus status = emberAfWriteServerAttribute(endpoint, ZCL_BARRIER_CONTROL_CLUSTER_ID,
ZCL_BARRIER_MOVING_STATE_ATTRIBUTE_ID, &state, ZCL_ENUM8_ATTRIBUTE_TYPE);
ZCL_BARRIER_MOVING_STATE_ATTRIBUTE_ID, &newState, ZCL_ENUM8_ATTRIBUTE_TYPE);
assert(status == EMBER_ZCL_STATUS_SUCCESS);
}

Expand Down
4 changes: 2 additions & 2 deletions src/messaging/ReliableMessageContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ CHIP_ERROR ReliableMessageContext::HandleRcvdAck(uint32_t AckMsgId)
return err;
}

CHIP_ERROR ReliableMessageContext::HandleNeedsAck(uint32_t MessageId, BitFlags<uint32_t, MessageFlagValues> Flags)
CHIP_ERROR ReliableMessageContext::HandleNeedsAck(uint32_t MessageId, BitFlags<uint32_t, MessageFlagValues> MsgFlags)

{
CHIP_ERROR err = CHIP_NO_ERROR;
Expand All @@ -351,7 +351,7 @@ CHIP_ERROR ReliableMessageContext::HandleNeedsAck(uint32_t MessageId, BitFlags<u
mManager->ExpireTicks();

// If the message IS a duplicate.
if (Flags.Has(MessageFlagValues::kChipMessageFlag_DuplicateMessage))
if (MsgFlags.Has(MessageFlagValues::kChipMessageFlag_DuplicateMessage))
{
#if !defined(NDEBUG)
ChipLogProgress(ExchangeManager, "Forcing tx of solitary ack for duplicate MsgId:%08" PRIX32, MessageId);
Expand Down

0 comments on commit 58810f3

Please sign in to comment.