Skip to content

Commit e1bc066

Browse files
authored
nodiscard ChipError Batch project-chip#2: example apps A-F (project-chip#41860)
* Batch project-chip#2 nodiscard errors: example apps A-F * Fix clang tidy
1 parent 3a34ff9 commit e1bc066

File tree

93 files changed

+755
-693
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+755
-693
lines changed

examples/air-purifier-app/air-purifier-common/src/air-purifier-manager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ void AirPurifierManager::Init()
2727
{
2828
FanControl::SetDefaultDelegate(mEndpointId, this);
2929

30-
activatedCarbonFilterInstance.Init();
31-
hepaFilterInstance.Init();
30+
TEMPORARY_RETURN_IGNORED activatedCarbonFilterInstance.Init();
31+
TEMPORARY_RETURN_IGNORED hepaFilterInstance.Init();
3232
mAirQualitySensorManager.Init();
3333
mTemperatureSensorManager.Init();
3434
mHumiditySensorManager.Init();

examples/air-purifier-app/air-purifier-common/src/air-quality-sensor-manager.cpp

Lines changed: 103 additions & 101 deletions
Large diffs are not rendered by default.

examples/air-purifier-app/air-purifier-common/src/filter-delegates.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,23 +80,23 @@ CHIP_ERROR ImmutableReplacementProductListManager::Next(ReplacementProductStruct
8080
{
8181
case 0: {
8282
item.SetProductIdentifierType(ResourceMonitoring::ProductIdentifierTypeEnum::kUpc);
83-
item.SetProductIdentifierValue(CharSpan::fromCharString("111112222233"));
83+
TEMPORARY_RETURN_IGNORED item.SetProductIdentifierValue(CharSpan::fromCharString("111112222233"));
8484
break;
8585
case 1:
8686
item.SetProductIdentifierType(ResourceMonitoring::ProductIdentifierTypeEnum::kGtin8);
87-
item.SetProductIdentifierValue(CharSpan::fromCharString("gtin8xxx"));
87+
TEMPORARY_RETURN_IGNORED item.SetProductIdentifierValue(CharSpan::fromCharString("gtin8xxx"));
8888
break;
8989
case 2:
9090
item.SetProductIdentifierType(ResourceMonitoring::ProductIdentifierTypeEnum::kEan);
91-
item.SetProductIdentifierValue(CharSpan::fromCharString("4444455555666"));
91+
TEMPORARY_RETURN_IGNORED item.SetProductIdentifierValue(CharSpan::fromCharString("4444455555666"));
9292
break;
9393
case 3:
9494
item.SetProductIdentifierType(ResourceMonitoring::ProductIdentifierTypeEnum::kGtin14);
95-
item.SetProductIdentifierValue(CharSpan::fromCharString("gtin14xxxxxxxx"));
95+
TEMPORARY_RETURN_IGNORED item.SetProductIdentifierValue(CharSpan::fromCharString("gtin14xxxxxxxx"));
9696
break;
9797
case 4:
9898
item.SetProductIdentifierType(ResourceMonitoring::ProductIdentifierTypeEnum::kOem);
99-
item.SetProductIdentifierValue(CharSpan::fromCharString("oem20xxxxxxxxxxxxxxx"));
99+
TEMPORARY_RETURN_IGNORED item.SetProductIdentifierValue(CharSpan::fromCharString("oem20xxxxxxxxxxxxxxx"));
100100
break;
101101
default:
102102
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;

examples/air-purifier-app/linux/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ void ApplicationInit()
5050
EndpointId(TEMPERATURE_SENSOR_ENDPOINT), EndpointId(RELATIVE_HUMIDITY_SENSOR_ENDPOINT),
5151
EndpointId(THERMOSTAT_ENDPOINT));
5252

53-
SetParentEndpointForEndpoint(AIR_QUALITY_SENSOR_ENDPOINT, AIR_PURIFIER_ENDPOINT);
54-
SetParentEndpointForEndpoint(TEMPERATURE_SENSOR_ENDPOINT, AIR_PURIFIER_ENDPOINT);
55-
SetParentEndpointForEndpoint(RELATIVE_HUMIDITY_SENSOR_ENDPOINT, AIR_PURIFIER_ENDPOINT);
56-
SetParentEndpointForEndpoint(THERMOSTAT_ENDPOINT, AIR_PURIFIER_ENDPOINT);
53+
SuccessOrDie(SetParentEndpointForEndpoint(AIR_QUALITY_SENSOR_ENDPOINT, AIR_PURIFIER_ENDPOINT));
54+
SuccessOrDie(SetParentEndpointForEndpoint(TEMPERATURE_SENSOR_ENDPOINT, AIR_PURIFIER_ENDPOINT));
55+
SuccessOrDie(SetParentEndpointForEndpoint(RELATIVE_HUMIDITY_SENSOR_ENDPOINT, AIR_PURIFIER_ENDPOINT));
56+
SuccessOrDie(SetParentEndpointForEndpoint(THERMOSTAT_ENDPOINT, AIR_PURIFIER_ENDPOINT));
5757
}
5858

5959
void ApplicationShutdown()

examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void emberAfAirQualityClusterInitCallback(chip::EndpointId endpointId)
4343
chip::BitMask<Feature, uint32_t> airQualityFeatures(Feature::kModerate, Feature::kFair, Feature::kVeryPoor,
4444
Feature::kExtremelyPoor);
4545
gAirQualityCluster = new Instance(1, airQualityFeatures);
46-
gAirQualityCluster->Init();
46+
TEMPORARY_RETURN_IGNORED gAirQualityCluster->Init();
4747
}
4848

4949
void emberAfAirQualityClusterShutdownCallback(chip::EndpointId endpointId)

examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,16 @@ static void BoundDeviceChangedHandler(const Binding::TableEntry & binding, chip:
9494
if (sSwitchOnOffState)
9595
{
9696
Clusters::OnOff::Commands::On::Type onCommand;
97-
Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(),
98-
binding.remote, onCommand, onSuccess, onFailure);
97+
TEMPORARY_RETURN_IGNORED Controller::InvokeCommandRequest(peer_device->GetExchangeManager(),
98+
peer_device->GetSecureSession().Value(), binding.remote,
99+
onCommand, onSuccess, onFailure);
99100
}
100101
else
101102
{
102103
Clusters::OnOff::Commands::Off::Type offCommand;
103-
Controller::InvokeCommandRequest(peer_device->GetExchangeManager(), peer_device->GetSecureSession().Value(),
104-
binding.remote, offCommand, onSuccess, onFailure);
104+
TEMPORARY_RETURN_IGNORED Controller::InvokeCommandRequest(peer_device->GetExchangeManager(),
105+
peer_device->GetSecureSession().Value(), binding.remote,
106+
offCommand, onSuccess, onFailure);
105107
}
106108
}
107109
}
@@ -114,7 +116,7 @@ static void BoundDeviceContextReleaseHandler(void * context)
114116
static void InitBindingHandlerInternal(intptr_t arg)
115117
{
116118
auto & server = chip::Server::GetInstance();
117-
Binding::Manager::GetInstance().Init(
119+
TEMPORARY_RETURN_IGNORED Binding::Manager::GetInstance().Init(
118120
{ &server.GetFabricTable(), server.GetCASESessionManager(), &server.GetPersistentStorage() });
119121
Binding::Manager::GetInstance().RegisterBoundDeviceChangedHandler(BoundDeviceChangedHandler);
120122
Binding::Manager::GetInstance().RegisterBoundDeviceContextReleaseHandler(BoundDeviceContextReleaseHandler);
@@ -126,7 +128,7 @@ CHIP_ERROR InitBindingHandlers()
126128
// so it requires the Server instance to be correctly initialized. Post the init function to
127129
// the event queue so that everything is ready when initialization is conducted.
128130
// TODO: Fix initialization order issue in Matter server.
129-
chip::DeviceLayer::PlatformMgr().ScheduleWork(InitBindingHandlerInternal);
131+
TEMPORARY_RETURN_IGNORED chip::DeviceLayer::PlatformMgr().ScheduleWork(InitBindingHandlerInternal);
130132
#if defined(ENABLE_CHIP_SHELL)
131133
RegisterSwitchCommands();
132134
#endif

examples/all-clusters-app/all-clusters-common/src/boolcfg-stub.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ bool HandleBooleanStateConfigurationTestEventTrigger(uint64_t eventTrigger)
3232
{
3333
case BooleanStateConfigurationTrigger::kSensorTrigger:
3434
ChipLogProgress(Support, "[BooleanStateConfiguration-Test-Event] => Trigger sensor");
35-
SetAllEnabledAlarmsActive(1);
35+
TEMPORARY_RETURN_IGNORED SetAllEnabledAlarmsActive(1);
3636
break;
3737

3838
case BooleanStateConfigurationTrigger::kSensorUntrigger:
3939
ChipLogProgress(Support, "[BooleanStateConfiguration-Test-Event] => Untrigger sensor");
40-
ClearAllAlarms(1);
40+
TEMPORARY_RETURN_IGNORED ClearAllAlarms(1);
4141
break;
4242

4343
default:

examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void emberAfActionsClusterInitCallback(EndpointId endpoint)
146146
sActionsDelegateImpl = std::make_unique<Actions::ActionsDelegateImpl>();
147147
sActionsServer = std::make_unique<Actions::ActionsServer>(endpoint, *sActionsDelegateImpl.get());
148148

149-
sActionsServer->Init();
149+
TEMPORARY_RETURN_IGNORED sActionsServer->Init();
150150
}
151151

152152
void emberAfActionsClusterShutdownCallback(EndpointId endpoint)

examples/all-clusters-app/all-clusters-common/src/camera-av-settings-user-level-management-stub.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Status AVSettingsUserLevelManagementDelegate::MPTZSetPosition(Optional<int16_t>
8080
// the callback. The server itself will persist the new values.
8181
//
8282
mCallback = callback;
83-
DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds16(2), onTimerExpiry, this);
83+
TEMPORARY_RETURN_IGNORED DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds16(2), onTimerExpiry, this);
8484

8585
return Status::Success;
8686
}
@@ -93,7 +93,7 @@ Status AVSettingsUserLevelManagementDelegate::MPTZRelativeMove(Optional<int16_t>
9393
// the callback. The server itself will persist the new values.
9494
//
9595
mCallback = callback;
96-
DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds16(2), onTimerExpiry, this);
96+
TEMPORARY_RETURN_IGNORED DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds16(2), onTimerExpiry, this);
9797

9898
return Status::Success;
9999
}
@@ -106,7 +106,7 @@ Status AVSettingsUserLevelManagementDelegate::MPTZMoveToPreset(uint8_t aPreset,
106106
// movements, invoke the callback. The server itself will persist the new values.
107107
//
108108
mCallback = callback;
109-
DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds16(2), onTimerExpiry, this);
109+
TEMPORARY_RETURN_IGNORED DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds16(2), onTimerExpiry, this);
110110

111111
return Status::Success;
112112
}
@@ -235,12 +235,12 @@ void emberAfCameraAvSettingsUserLevelManagementClusterInitCallback(chip::Endpoin
235235

236236
gAVSettingsUserLevelManagementCluster = std::make_unique<CameraAvSettingsUserLevelMgmtServer>(
237237
kEndpointId, *gDelegate.get(), avsumFeatures, avsumAttrs, appMaxPresets);
238-
gAVSettingsUserLevelManagementCluster->Init();
238+
TEMPORARY_RETURN_IGNORED gAVSettingsUserLevelManagementCluster->Init();
239239

240240
// Set app specific limits to pan, tilt, zoom
241-
gAVSettingsUserLevelManagementCluster->SetPanMin(appPanMin);
242-
gAVSettingsUserLevelManagementCluster->SetPanMax(appPanMax);
243-
gAVSettingsUserLevelManagementCluster->SetTiltMin(appTiltMin);
244-
gAVSettingsUserLevelManagementCluster->SetTiltMax(appTiltMax);
245-
gAVSettingsUserLevelManagementCluster->SetZoomMax(appZoomMax);
241+
TEMPORARY_RETURN_IGNORED gAVSettingsUserLevelManagementCluster->SetPanMin(appPanMin);
242+
TEMPORARY_RETURN_IGNORED gAVSettingsUserLevelManagementCluster->SetPanMax(appPanMax);
243+
TEMPORARY_RETURN_IGNORED gAVSettingsUserLevelManagementCluster->SetTiltMin(appTiltMin);
244+
TEMPORARY_RETURN_IGNORED gAVSettingsUserLevelManagementCluster->SetTiltMax(appTiltMax);
245+
TEMPORARY_RETURN_IGNORED gAVSettingsUserLevelManagementCluster->SetZoomMax(appZoomMax);
246246
}

examples/all-clusters-app/all-clusters-common/src/camera-av-stream-delegate-impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ void emberAfCameraAvStreamManagementClusterInitCallback(EndpointId endpoint)
390390
sensorParams, nightVisionUsesInfrared, minViewport, rateDistortionTradeOffPoints, maxContentBufferSize, micCapabilities,
391391
spkrCapabilities, twowayTalkSupport, snapshotCapabilities, maxNetworkBandwidth, supportedStreamUsages,
392392
streamUsagePriorities);
393-
sCameraAVStreamMgmtClusterServerInstance->Init();
393+
TEMPORARY_RETURN_IGNORED sCameraAVStreamMgmtClusterServerInstance->Init();
394394
}
395395

396396
void emberAfCameraAvStreamManagementClusterShutdownCallback(EndpointId endpoint)

0 commit comments

Comments
 (0)