Skip to content

Commit 8606290

Browse files
Don't use default ctor for ChipDeviceEvent (project-chip#36768)
* Don't use default ctor for ChipDeviceEvent * Restyled by clang-format --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 5d42d92 commit 8606290

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/lib/dnssd/Discovery_ImplPlatform.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,7 @@ void DiscoveryImplPlatform::HandleDnssdInit(void * context, CHIP_ERROR initError
452452
publisher->mState = State::kInitialized;
453453

454454
// Post an event that will start advertising
455-
DeviceLayer::ChipDeviceEvent event;
456-
event.Type = DeviceLayer::DeviceEventType::kDnssdInitialized;
455+
DeviceLayer::ChipDeviceEvent event{ .Type = DeviceLayer::DeviceEventType::kDnssdInitialized };
457456

458457
CHIP_ERROR error = DeviceLayer::PlatformMgr().PostEvent(&event);
459458
if (error != CHIP_NO_ERROR)
@@ -477,9 +476,8 @@ void DiscoveryImplPlatform::HandleDnssdError(void * context, CHIP_ERROR error)
477476
// Restore dnssd state before restart, also needs to call ChipDnssdShutdown()
478477
publisher->Shutdown();
479478

480-
DeviceLayer::ChipDeviceEvent event;
481-
event.Type = DeviceLayer::DeviceEventType::kDnssdRestartNeeded;
482-
error = DeviceLayer::PlatformMgr().PostEvent(&event);
479+
DeviceLayer::ChipDeviceEvent event{ .Type = DeviceLayer::DeviceEventType::kDnssdRestartNeeded };
480+
error = DeviceLayer::PlatformMgr().PostEvent(&event);
483481

484482
if (error != CHIP_NO_ERROR)
485483
{

src/protocols/secure_channel/PairingSession.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ void PairingSession::Finish()
8181
if (err == CHIP_NO_ERROR)
8282
{
8383
VerifyOrDie(mSecureSessionHolder);
84-
DeviceLayer::ChipDeviceEvent event;
85-
event.Type = DeviceLayer::DeviceEventType::kSecureSessionEstablished;
84+
DeviceLayer::ChipDeviceEvent event{ .Type = DeviceLayer::DeviceEventType::kSecureSessionEstablished };
8685
event.SecureSessionEstablished.TransportType = to_underlying(address.GetTransportType());
8786
event.SecureSessionEstablished.SecureSessionType =
8887
to_underlying(mSecureSessionHolder->AsSecureSession()->GetSecureSessionType());

0 commit comments

Comments
 (0)