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

Commit f12d18f

Browse files
committed
Address -Wreorder and -Wunused-variable warnings.
1 parent 6292b0c commit f12d18f

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

src/test-apps/MockEvents.cpp

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
*
3+
* Copyright (c) 2018 Google LLC.
34
* Copyright (c) 2017 Nest Labs, Inc.
45
* All rights reserved.
56
*
@@ -59,6 +60,14 @@ using namespace Schema::Nest::Test::Trait::TestETrait;
5960
using namespace Schema::Nest::Test::Trait;
6061
using namespace Schema::Weave::Common;
6162

63+
#ifdef PHOENIX_RESOURCE_STRINGS
64+
#define USER_ID_INITIAL NULL
65+
static uint8_t kTestUserId[1] = { 1 };
66+
#else
67+
#define USER_ID_INITIAL 0
68+
static const user_id_t kTestUserId = 0x0123456789ULL;
69+
#endif /* PHOENIX_RESOURCE_STRINGS */
70+
6271
static const uint64_t kTestNodeId = 0x18B4300001408362ULL;
6372
static const uint64_t kTestNodeId1 = 0x18B43000002DCF71ULL;
6473

@@ -299,21 +308,22 @@ const uint64_t kbolt_lock_actor_method = nl::Weave::TLV::Con
299308
const uint64_t kbolt_lock_actor_user_id = nl::Weave::TLV::ContextTag(2);
300309

301310
BoltActuatorEventStruct::BoltActuatorEventStruct() :
302-
locked_state_last_changed_at(0),
303311
state(0),
304312
actuatorState(0),
305313
lockedState(0),
306-
bolt_lock_actor()
314+
bolt_lock_actor(),
315+
locked_state_last_changed_at(0)
307316
{
317+
return;
308318
}
309319

310320
BoltLockActorStruct::BoltLockActorStruct() :
311-
user_id(USER_ID_INITIAL),
312-
method(0)
321+
method(0),
322+
user_id(USER_ID_INITIAL)
313323
{
324+
return;
314325
}
315326

316-
317327
static WEAVE_ERROR WriteBoltActuatorStateChangeEvent(nl::Weave::TLV::TLVWriter & writer, uint8_t inDataTag, void * anAppState)
318328
{
319329
WEAVE_ERROR err = WEAVE_NO_ERROR;

src/test-apps/MockEvents.h

Lines changed: 7 additions & 9 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
*
@@ -45,17 +46,12 @@
4546
// Several event definitions, hand generated at this time
4647

4748
#define PHOENIX_RESOURCE_STRINGS
49+
4850
#ifdef PHOENIX_RESOURCE_STRINGS
4951
typedef uint8_t * user_id_t;
50-
#define USER_ID_INITIAL NULL
51-
static uint8_t kTestUserId[1] = { 1 };
5252
#else
5353
typedef uint64_t user_id_t;
54-
#define USER_ID_INITIAL 0
55-
static const user_id_t kTestUserId = 0x0123456789ULL;
56-
57-
#endif
58-
54+
#endif /* PHOENIX_RESOURCE_STRINGS */
5955

6056
/************************************************************************/
6157

@@ -233,14 +229,16 @@ enum BoltLockedState {
233229

234230
struct BoltLockActorStruct
235231
{
236-
BoltLockActorStruct();
232+
BoltLockActorStruct(void);
233+
237234
int16_t method;
238235
user_id_t user_id;
239236
};
240237

241238
struct BoltActuatorEventStruct
242239
{
243-
BoltActuatorEventStruct();
240+
BoltActuatorEventStruct(void);
241+
244242
int16_t state;
245243
int16_t actuatorState;
246244
int16_t lockedState;

0 commit comments

Comments
 (0)