Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit 12a8872

Browse files
committed
Address -Wint-in-bool-context warnings.
1 parent 99d624c commit 12a8872

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/lib/profiles/data-management/Current/MessageDef.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
*
3+
* Copyright (c) 2018 Google LLC.
34
* Copyright (c) 2016-2017 Nest Labs, Inc.
45
* All rights reserved.
56
*
@@ -47,6 +48,10 @@
4748

4849
#include <stdio.h>
4950

51+
using namespace ::nl;
52+
using namespace ::nl::Weave;
53+
using namespace ::nl::Weave::TLV;
54+
5055
#ifndef MIN
5156
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
5257
#endif
@@ -2741,13 +2746,19 @@ WEAVE_ERROR StatusList::Parser::CheckSchemaValidity(void) const
27412746

27422747
while (WEAVE_NO_ERROR == (err = reader.Next()))
27432748
{
2749+
TLVType type;
2750+
uint64_t tag;
2751+
27442752
// TODO: The spec says the StatusList should be an array of arrays, but in
27452753
// the current implementation it's an array of structures. The array of
27462754
// arrays is less intuitive but more space efficient.
2747-
VerifyOrExit(nl::Weave::TLV::AnonymousTag == reader.GetTag(), err = WEAVE_ERROR_INVALID_TLV_TAG);
27482755

2749-
VerifyOrExit((nl::Weave::TLV::kTLVType_Structure == reader.GetType() ||
2750-
nl::Weave::TLV::kTLVType_Array), err = WEAVE_ERROR_WRONG_TLV_TYPE);
2756+
tag = reader.GetTag();
2757+
VerifyOrExit(nl::Weave::TLV::AnonymousTag == tag, err = WEAVE_ERROR_INVALID_TLV_TAG);
2758+
2759+
type = reader.GetType();
2760+
VerifyOrExit((nl::Weave::TLV::kTLVType_Structure == type ||
2761+
nl::Weave::TLV::kTLVType_Array == type), err = WEAVE_ERROR_WRONG_TLV_TYPE);
27512762

27522763
{
27532764
StatusElement::Parser status;

0 commit comments

Comments
 (0)