Skip to content

Commit 4e8aee8

Browse files
restyled-commitshicklin
authored andcommitted
Restyled by clang-format
1 parent fea9eed commit 4e8aee8

File tree

4 files changed

+41
-33
lines changed

4 files changed

+41
-33
lines changed

examples/rvc-app/rvc-common/src/rvc-service-area-delegate.cpp

+23-23
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ bool RvcServiceAreaDelegate::IsSupportedLocationsChangeAllowed()
109109

110110
uint32_t RvcServiceAreaDelegate::GetNumberOfSupportedLocations()
111111
{
112-
return (uint32_t)mSupportedLocations.size();
112+
return (uint32_t) mSupportedLocations.size();
113113
}
114114

115115
bool RvcServiceAreaDelegate::GetSupportedLocationByIndex(uint32_t listIndex, LocationStructureWrapper & aSupportedLocation)
116116
{
117117
bool ret_value = false;
118118

119-
if (listIndex < (uint32_t)mSupportedLocations.size())
119+
if (listIndex < (uint32_t) mSupportedLocations.size())
120120
{
121121
aSupportedLocation = mSupportedLocations[listIndex];
122122
ret_value = true;
@@ -134,7 +134,7 @@ bool RvcServiceAreaDelegate::GetSupportedLocationById(uint32_t aLocationId, uint
134134
bool ret_value = false;
135135

136136
listIndex = 0;
137-
uint32_t listSize = (uint32_t)mSupportedLocations.size();
137+
uint32_t listSize = (uint32_t) mSupportedLocations.size();
138138

139139
while (listIndex < listSize)
140140
{
@@ -159,11 +159,11 @@ bool RvcServiceAreaDelegate::AddSupportedLocation(const LocationStructureWrapper
159159
// etc.
160160

161161
// Double-check list size to ensure there no memory issues.
162-
if ((uint32_t)mSupportedLocations.size() < kMaxNumSupportedLocations)
162+
if ((uint32_t) mSupportedLocations.size() < kMaxNumSupportedLocations)
163163
{
164164
// not sorting list, number of locations normally expected to be small, max 255
165165
mSupportedLocations.push_back(newLocation);
166-
listIndex = (uint32_t)mSupportedMaps.size() - 1; // new element is last in list
166+
listIndex = (uint32_t) mSupportedMaps.size() - 1; // new element is last in list
167167
ret_value = true;
168168
}
169169
else
@@ -200,7 +200,7 @@ bool RvcServiceAreaDelegate::ClearSupportedLocations()
200200
{
201201
bool ret_value = false;
202202

203-
if ((uint32_t)mSupportedLocations.size() > 0)
203+
if ((uint32_t) mSupportedLocations.size() > 0)
204204
{
205205
mSupportedLocations.clear();
206206
ret_value = true;
@@ -219,14 +219,14 @@ bool RvcServiceAreaDelegate::IsSupportedMapChangeAllowed()
219219

220220
uint32_t RvcServiceAreaDelegate::GetNumberOfSupportedMaps()
221221
{
222-
return (uint32_t)mSupportedMaps.size();
222+
return (uint32_t) mSupportedMaps.size();
223223
}
224224

225225
bool RvcServiceAreaDelegate::GetSupportedMapByIndex(uint32_t listIndex, MapStructureWrapper & aSupportedMap)
226226
{
227227
bool ret_value = false;
228228

229-
if (listIndex < (uint32_t)mSupportedMaps.size())
229+
if (listIndex < (uint32_t) mSupportedMaps.size())
230230
{
231231
aSupportedMap = mSupportedMaps[listIndex];
232232
ret_value = true;
@@ -243,7 +243,7 @@ bool RvcServiceAreaDelegate::GetSupportedMapById(uint8_t aMapId, uint32_t & list
243243
bool ret_value = false;
244244

245245
listIndex = 0;
246-
uint32_t listSize = (uint32_t)mSupportedMaps.size();
246+
uint32_t listSize = (uint32_t) mSupportedMaps.size();
247247

248248
while (listIndex < listSize)
249249
{
@@ -268,11 +268,11 @@ bool RvcServiceAreaDelegate::AddSupportedMap(const MapStructureWrapper & newMap,
268268
// etc.
269269

270270
// Double-check list size to ensure there no memory issues.
271-
if ((uint32_t)mSupportedMaps.size() < kMaxNumSupportedMaps)
271+
if ((uint32_t) mSupportedMaps.size() < kMaxNumSupportedMaps)
272272
{
273273
// not sorting list, number of locations normally expected to be small, max 255
274274
mSupportedMaps.push_back(newMap);
275-
listIndex = (uint32_t)mSupportedMaps.size() - 1; // new element is last in list
275+
listIndex = (uint32_t) mSupportedMaps.size() - 1; // new element is last in list
276276
}
277277
else
278278
{
@@ -307,7 +307,7 @@ bool RvcServiceAreaDelegate::ClearSupportedMaps()
307307
{
308308
bool ret_value = false;
309309

310-
if ((uint32_t)mSupportedMaps.size() > 0)
310+
if ((uint32_t) mSupportedMaps.size() > 0)
311311
{
312312
mSupportedMaps.clear();
313313
ret_value = true;
@@ -321,14 +321,14 @@ bool RvcServiceAreaDelegate::ClearSupportedMaps()
321321

322322
uint32_t RvcServiceAreaDelegate::GetNumberOfSelectedLocations()
323323
{
324-
return (uint32_t)mSelectedLocations.size();
324+
return (uint32_t) mSelectedLocations.size();
325325
}
326326

327327
bool RvcServiceAreaDelegate::GetSelectedLocationByIndex(uint32_t listIndex, uint32_t & aSelectedLocation)
328328
{
329329
bool ret_value = false;
330330

331-
if (listIndex < (uint32_t)mSelectedLocations.size())
331+
if (listIndex < (uint32_t) mSelectedLocations.size())
332332
{
333333
aSelectedLocation = mSelectedLocations[listIndex];
334334
ret_value = true;
@@ -345,11 +345,11 @@ bool RvcServiceAreaDelegate::AddSelectedLocation(uint32_t aLocationId, uint32_t
345345
// etc.
346346

347347
// Double-check list size to ensure there no memory issues.
348-
if ((uint32_t)mSelectedLocations.size() < kMaxNumSelectedLocations)
348+
if ((uint32_t) mSelectedLocations.size() < kMaxNumSelectedLocations)
349349
{
350350
// not sorting list, number of locations normally expected to be small, max 255
351351
mSelectedLocations.push_back(aLocationId);
352-
listIndex = (uint32_t)mSelectedLocations.size() - 1; // new element is last in list
352+
listIndex = (uint32_t) mSelectedLocations.size() - 1; // new element is last in list
353353
}
354354
else
355355
{
@@ -364,7 +364,7 @@ bool RvcServiceAreaDelegate::ClearSelectedLocations()
364364
{
365365
bool ret_value = false;
366366

367-
if ((uint32_t)mSelectedLocations.size() > 0)
367+
if ((uint32_t) mSelectedLocations.size() > 0)
368368
{
369369
mSelectedLocations.clear();
370370
ret_value = true;
@@ -378,14 +378,14 @@ bool RvcServiceAreaDelegate::ClearSelectedLocations()
378378

379379
uint32_t RvcServiceAreaDelegate::GetNumberOfProgressElements()
380380
{
381-
return (uint32_t)mProgressList.size();
381+
return (uint32_t) mProgressList.size();
382382
}
383383

384384
bool RvcServiceAreaDelegate::GetProgressElementByIndex(uint32_t listIndex, Structs::ProgressStruct::Type & aProgressElement)
385385
{
386386
bool ret_value = false;
387387

388-
if (listIndex < (uint32_t)mProgressList.size())
388+
if (listIndex < (uint32_t) mProgressList.size())
389389
{
390390
aProgressElement = mProgressList[listIndex];
391391
ret_value = true;
@@ -403,7 +403,7 @@ bool RvcServiceAreaDelegate::GetProgressElementById(uint32_t aLocationId, uint32
403403
bool ret_value = false;
404404

405405
listIndex = 0;
406-
uint32_t listSize = (uint32_t)mProgressList.size();
406+
uint32_t listSize = (uint32_t) mProgressList.size();
407407

408408
while (listIndex < listSize)
409409
{
@@ -428,11 +428,11 @@ bool RvcServiceAreaDelegate::AddProgressElement(const Structs::ProgressStruct::T
428428
// etc.
429429

430430
// Double-check list size to ensure there no memory issues.
431-
if ((uint32_t)mProgressList.size() < kMaxNumProgressElements)
431+
if ((uint32_t) mProgressList.size() < kMaxNumProgressElements)
432432
{
433433
// not sorting list, number of locations normally expected to be small, max 255
434434
mProgressList.push_back(newProgressElement);
435-
listIndex = (uint32_t)mProgressList.size() - 1; // new element is last in list
435+
listIndex = (uint32_t) mProgressList.size() - 1; // new element is last in list
436436
}
437437
else
438438
{
@@ -457,7 +457,7 @@ bool RvcServiceAreaDelegate::ClearProgress()
457457
{
458458
bool ret_value = false;
459459

460-
if ((uint32_t)mProgressList.size() > 0)
460+
if ((uint32_t) mProgressList.size() > 0)
461461
{
462462
mProgressList.clear();
463463
ret_value = true;

src/app/clusters/service-area-server/service-area-delegate.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class Delegate
5151
/**
5252
* Stop this class objects from being copied.
5353
*/
54-
Delegate(const Delegate &) = delete;
54+
Delegate(const Delegate &) = delete;
5555
Delegate & operator=(const Delegate &) = delete;
5656

5757
friend class Instance;

src/app/clusters/service-area-server/service-area-server.cpp

+16-7
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ namespace ServiceArea {
4646
// Service Area Server Instance
4747

4848
Instance::Instance(Delegate * aDelegate, EndpointId aEndpointId, BitMask<Feature> aFeature) :
49-
AttributeAccessInterface(MakeOptional(aEndpointId), Id),
50-
CommandHandlerInterface(MakeOptional(aEndpointId), Id), mDelegate(aDelegate), mEndpointId(aEndpointId),
51-
mClusterId(Id), mFeature(aFeature)
49+
AttributeAccessInterface(MakeOptional(aEndpointId), Id), CommandHandlerInterface(MakeOptional(aEndpointId), Id),
50+
mDelegate(aDelegate), mEndpointId(aEndpointId), mClusterId(Id), mFeature(aFeature)
5251
{
5352
ChipLogProgress(Zcl, "Service Area: Instance constructor");
5453
mDelegate->SetInstance(this);
@@ -508,7 +507,8 @@ bool Instance::IsUniqueSupportedLocation(const LocationStructureWrapper & aLocat
508507
LocationStructureWrapper entry;
509508
BitMask<LocationStructureWrapper::IsEqualConfig> config;
510509

511-
if (ignoreLocationId) {
510+
if (ignoreLocationId)
511+
{
512512
config.Set(LocationStructureWrapper::IsEqualConfig::kIgnoreLocationId);
513513
}
514514

@@ -925,7 +925,10 @@ bool Instance::SetProgressStatus(uint32_t aLocationId, OperationalStatusEnum opS
925925
ChipLogError(Zcl, "SetProgressStatus - progress element does not exist for location %u", aLocationId));
926926

927927
// If the status value is not changing, there in no need to modify the existing element.
928-
if (progressElement.status == opStatus) { return true; }
928+
if (progressElement.status == opStatus)
929+
{
930+
return true;
931+
}
929932

930933
// set the progress status in the local copy
931934
progressElement.status = opStatus;
@@ -959,7 +962,10 @@ bool Instance::SetProgressTotalOperationalTime(uint32_t aLocationId, const DataM
959962
ChipLogError(Zcl, "SetProgressTotalOperationalTime - progress element does not exist for location %u", aLocationId));
960963

961964
// If the time value is not changing, there is no need to modify the existing element.
962-
if (progressElement.totalOperationalTime == aTotalOperationalTime) { return true; }
965+
if (progressElement.totalOperationalTime == aTotalOperationalTime)
966+
{
967+
return true;
968+
}
963969

964970
// This attribute SHALL be null if the Status field is not set to Completed or Skipped
965971
VerifyOrExit((aTotalOperationalTime.IsNull() || (progressElement.status == OperationalStatusEnum::kCompleted) ||
@@ -994,7 +1000,10 @@ bool Instance::SetProgressEstimatedTime(uint32_t aLocationId, const DataModel::N
9941000
ChipLogError(Zcl, "SetProgressEstimatedTime - progress element does not exist for location %u", aLocationId));
9951001

9961002
// If the time value is not changing, there is no need to modify the existing element.
997-
if (progressElement.estimatedTime == aEstimatedTime) { return true; };
1003+
if (progressElement.estimatedTime == aEstimatedTime)
1004+
{
1005+
return true;
1006+
};
9981007

9991008
// set the time in the local copy
10001009
progressElement.estimatedTime.Value() = aEstimatedTime;

src/app/clusters/service-area-server/service-area-server.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,9 @@ class Instance : public AttributeAccessInterface, public CommandHandlerInterface
6363
/**
6464
* Stop this class objects from being copied.
6565
*/
66-
Instance(const Instance &) = delete;
66+
Instance(const Instance &) = delete;
6767
Instance & operator=(const Instance &) = delete;
6868

69-
7069
/**
7170
* @brief Initialise the Service Area server instance.
7271
* @return an error if the given endpoint and cluster Id have not been enabled in zap or if the

0 commit comments

Comments
 (0)