diff --git a/src/platform/Linux/ConnectivityManagerImpl.cpp b/src/platform/Linux/ConnectivityManagerImpl.cpp index 2a57a99d507976..a25747f16e64d2 100644 --- a/src/platform/Linux/ConnectivityManagerImpl.cpp +++ b/src/platform/Linux/ConnectivityManagerImpl.cpp @@ -1676,9 +1676,13 @@ bool ConnectivityManagerImpl::_GetBssInfo(const gchar * bssPath, NetworkCommissi return false; } + // NOLINTNEXTLINE(bugprone-casting-through-void) WpaFiW1Wpa_supplicant1BSSProxy * bssProxy = WPA_FI_W1_WPA_SUPPLICANT1_BSS_PROXY(bss.get()); + // NOLINTNEXTLINE(bugprone-casting-through-void) GAutoPtr ssid(g_dbus_proxy_get_cached_property(G_DBUS_PROXY(bssProxy), "SSID")); + + // NOLINTNEXTLINE(bugprone-casting-through-void) GAutoPtr bssid(g_dbus_proxy_get_cached_property(G_DBUS_PROXY(bssProxy), "BSSID")); // Network scan is performed in the background, so the BSS @@ -1789,7 +1793,10 @@ bool ConnectivityManagerImpl::_GetBssInfo(const gchar * bssPath, NetworkCommissi return res; }; auto GetNetworkSecurityType = [IsNetworkWPAPSK, IsNetworkWPA2PSK](WpaFiW1Wpa_supplicant1BSSProxy * proxy) -> uint8_t { + // NOLINTNEXTLINE(bugprone-casting-through-void) GAutoPtr wpa(g_dbus_proxy_get_cached_property(G_DBUS_PROXY(proxy), "WPA")); + + // NOLINTNEXTLINE(bugprone-casting-through-void) GAutoPtr rsn(g_dbus_proxy_get_cached_property(G_DBUS_PROXY(proxy), "RSN")); uint8_t res = IsNetworkWPAPSK(wpa.get()) | IsNetworkWPA2PSK(rsn.get()); diff --git a/src/platform/Linux/ThreadStackManagerImpl.cpp b/src/platform/Linux/ThreadStackManagerImpl.cpp index 5fd865df5485ad..c4dfa30beca805 100644 --- a/src/platform/Linux/ThreadStackManagerImpl.cpp +++ b/src/platform/Linux/ThreadStackManagerImpl.cpp @@ -270,6 +270,8 @@ CHIP_ERROR ThreadStackManagerImpl::_GetThreadProvision(Thread::OperationalDatase { GAutoPtr err; + + // NOLINTNEXTLINE(bugprone-casting-through-void) GAutoPtr response(g_dbus_proxy_call_sync(G_DBUS_PROXY(mProxy.get()), "org.freedesktop.DBus.Properties.Get", g_variant_new("(ss)", "io.openthread.BorderRouter", "ActiveDatasetTlvs"), G_DBUS_CALL_FLAGS_NONE, -1, nullptr, &err.GetReceiver())); @@ -326,6 +328,8 @@ bool ThreadStackManagerImpl::_IsThreadEnabled() VerifyOrReturnError(mProxy, false); GAutoPtr err; + + // NOLINTNEXTLINE(bugprone-casting-through-void) GAutoPtr response(g_dbus_proxy_call_sync(G_DBUS_PROXY(mProxy.get()), "org.freedesktop.DBus.Properties.Get", g_variant_new("(ss)", "io.openthread.BorderRouter", "DeviceRole"), G_DBUS_CALL_FLAGS_NONE, -1, nullptr, &err.GetReceiver())); diff --git a/src/platform/Linux/bluez/AdapterIterator.cpp b/src/platform/Linux/bluez/AdapterIterator.cpp index 5510ceae996ce2..617b08d16c414a 100644 --- a/src/platform/Linux/bluez/AdapterIterator.cpp +++ b/src/platform/Linux/bluez/AdapterIterator.cpp @@ -77,6 +77,7 @@ bool AdapterIterator::Advance() while (mCurrentListItem != nullptr) { + // NOLINTNEXTLINE(bugprone-casting-through-void) BluezAdapter1 * adapter = bluez_object_get_adapter1(BLUEZ_OBJECT(mCurrentListItem->data)); if (adapter == nullptr) { @@ -98,6 +99,7 @@ uint32_t AdapterIterator::GetIndex() const { // PATH is of the for BLUEZ_PATH / hci, i.e. like '/org/bluez/hci0' // Index represents the number after hci + // NOLINTNEXTLINE(bugprone-casting-through-void) const char * path = g_dbus_proxy_get_object_path(G_DBUS_PROXY(mCurrentAdapter.get())); unsigned index = 0; diff --git a/src/platform/Linux/bluez/BluezAdvertisement.cpp b/src/platform/Linux/bluez/BluezAdvertisement.cpp index 06f831bff8b58f..59aed5fe4474d5 100644 --- a/src/platform/Linux/bluez/BluezAdvertisement.cpp +++ b/src/platform/Linux/bluez/BluezAdvertisement.cpp @@ -81,6 +81,7 @@ BluezLEAdvertisement1 * BluezAdvertisement::CreateLEAdvertisement() }), this); + // NOLINTNEXTLINE(bugprone-casting-through-void) g_dbus_object_manager_server_export(mRoot.get(), G_DBUS_OBJECT_SKELETON(object)); g_object_unref(object); @@ -118,6 +119,7 @@ CHIP_ERROR BluezAdvertisement::Init(const BluezEndpoint & aEndpoint, const char mRoot.reset(reinterpret_cast(g_object_ref(aEndpoint.GetGattApplicationObjectManager()))); mAdapter.reset(reinterpret_cast(g_object_ref(aEndpoint.GetAdapter()))); + // NOLINTNEXTLINE(bugprone-casting-through-void) g_object_get(G_OBJECT(mRoot.get()), "object-path", &rootPath.GetReceiver(), nullptr); g_snprintf(mAdvPath, sizeof(mAdvPath), "%s/advertising", rootPath.get()); g_strlcpy(mAdvUUID, aAdvUUID, sizeof(mAdvUUID)); @@ -224,6 +226,7 @@ void BluezAdvertisement::Shutdown() void BluezAdvertisement::StartDone(GObject * aObject, GAsyncResult * aResult) { + // NOLINTNEXTLINE(bugprone-casting-through-void) BluezLEAdvertisingManager1 * advMgr = BLUEZ_LEADVERTISING_MANAGER1(aObject); GAutoPtr error; gboolean success = FALSE; @@ -249,9 +252,11 @@ CHIP_ERROR BluezAdvertisement::StartImpl() VerifyOrExit(!mIsAdvertising, ChipLogError(DeviceLayer, "FAIL: Advertising has already been enabled in %s", __func__)); VerifyOrExit(mAdapter.get() != nullptr, ChipLogError(DeviceLayer, "FAIL: NULL mAdapter in %s", __func__)); + // NOLINTNEXTLINE(bugprone-casting-through-void) adapterObject = g_dbus_interface_get_object(G_DBUS_INTERFACE(mAdapter.get())); VerifyOrExit(adapterObject != nullptr, ChipLogError(DeviceLayer, "FAIL: NULL adapterObject in %s", __func__)); + // NOLINTNEXTLINE(bugprone-casting-through-void) advMgr.reset(bluez_object_get_leadvertising_manager1(BLUEZ_OBJECT(adapterObject))); VerifyOrExit(advMgr.get() != nullptr, ChipLogError(DeviceLayer, "FAIL: NULL advMgr in %s", __func__)); @@ -282,6 +287,7 @@ CHIP_ERROR BluezAdvertisement::Start() void BluezAdvertisement::StopDone(GObject * aObject, GAsyncResult * aResult) { + // NOLINTNEXTLINE(bugprone-casting-through-void) BluezLEAdvertisingManager1 * advMgr = BLUEZ_LEADVERTISING_MANAGER1(aObject); GAutoPtr error; gboolean success = FALSE; @@ -305,9 +311,11 @@ CHIP_ERROR BluezAdvertisement::StopImpl() VerifyOrExit(mIsAdvertising, ChipLogError(DeviceLayer, "FAIL: Advertising has already been disabled in %s", __func__)); VerifyOrExit(mAdapter.get() != nullptr, ChipLogError(DeviceLayer, "FAIL: NULL mAdapter in %s", __func__)); + // NOLINTNEXTLINE(bugprone-casting-through-void) adapterObject = g_dbus_interface_get_object(G_DBUS_INTERFACE(mAdapter.get())); VerifyOrExit(adapterObject != nullptr, ChipLogError(DeviceLayer, "FAIL: NULL adapterObject in %s", __func__)); + // NOLINTNEXTLINE(bugprone-casting-through-void) advMgr.reset(bluez_object_get_leadvertising_manager1(BLUEZ_OBJECT(adapterObject))); VerifyOrExit(advMgr.get() != nullptr, ChipLogError(DeviceLayer, "FAIL: NULL advMgr in %s", __func__)); diff --git a/src/platform/Linux/bluez/BluezConnection.cpp b/src/platform/Linux/bluez/BluezConnection.cpp index d2db5edc005eba..78a875805627a0 100644 --- a/src/platform/Linux/bluez/BluezConnection.cpp +++ b/src/platform/Linux/bluez/BluezConnection.cpp @@ -45,14 +45,17 @@ namespace { gboolean BluezIsServiceOnDevice(BluezGattService1 * aService, BluezDevice1 * aDevice) { const auto * servicePath = bluez_gatt_service1_get_device(aService); - const auto * devicePath = g_dbus_proxy_get_object_path(G_DBUS_PROXY(aDevice)); + // NOLINTNEXTLINE(bugprone-casting-through-void) + const auto * devicePath = g_dbus_proxy_get_object_path(G_DBUS_PROXY(aDevice)); return strcmp(servicePath, devicePath) == 0 ? TRUE : FALSE; } gboolean BluezIsCharOnService(BluezGattCharacteristic1 * aChar, BluezGattService1 * aService) { - const auto * charPath = bluez_gatt_characteristic1_get_service(aChar); + const auto * charPath = bluez_gatt_characteristic1_get_service(aChar); + // NOLINTNEXTLINE(bugprone-casting-through-void) const auto * servicePath = g_dbus_proxy_get_object_path(G_DBUS_PROXY(aService)); + ChipLogDetail(DeviceLayer, "Char %s on service %s", charPath, servicePath); return strcmp(charPath, servicePath) == 0 ? TRUE : FALSE; } @@ -111,6 +114,7 @@ CHIP_ERROR BluezConnection::Init(const BluezEndpoint & aEndpoint) for (l = objects; l != nullptr; l = l->next) { + // NOLINTNEXTLINE(bugprone-casting-through-void) BluezGattService1 * service = bluez_object_get_gatt_service1(BLUEZ_OBJECT(l->data)); if (service != nullptr) { @@ -128,6 +132,7 @@ CHIP_ERROR BluezConnection::Init(const BluezEndpoint & aEndpoint) for (l = objects; l != nullptr; l = l->next) { + // NOLINTNEXTLINE(bugprone-casting-through-void) BluezGattCharacteristic1 * char1 = bluez_object_get_gatt_characteristic1(BLUEZ_OBJECT(l->data)); if (char1 != nullptr) { @@ -227,6 +232,7 @@ void BluezConnection::SetupWriteHandler(int aSocketFd) g_io_channel_set_close_on_unref(channel, TRUE); g_io_channel_set_buffered(channel, FALSE); + // NOLINTNEXTLINE(*.EnumCastOutOfRange) auto watchSource = g_io_create_watch(channel, static_cast(G_IO_HUP | G_IO_IN | G_IO_ERR | G_IO_NVAL)); g_source_set_callback(watchSource, G_SOURCE_FUNC(WriteHandlerCallback), this, nullptr); @@ -248,6 +254,7 @@ void BluezConnection::SetupNotifyHandler(int aSocketFd, bool aAdditionalAdvertis g_io_channel_set_close_on_unref(channel, TRUE); g_io_channel_set_buffered(channel, FALSE); + // NOLINTNEXTLINE(*.EnumCastOutOfRange) auto watchSource = g_io_create_watch(channel, static_cast(G_IO_HUP | G_IO_ERR | G_IO_NVAL)); g_source_set_callback(watchSource, G_SOURCE_FUNC(NotifyHandlerCallback), this, nullptr); @@ -305,6 +312,7 @@ CHIP_ERROR BluezConnection::SendIndication(chip::System::PacketBufferHandle apBu void BluezConnection::SendWriteRequestDone(GObject * aObject, GAsyncResult * aResult, gpointer apConnection) { + // NOLINTNEXTLINE(bugprone-casting-through-void) BluezGattCharacteristic1 * c1 = BLUEZ_GATT_CHARACTERISTIC1(aObject); GAutoPtr error; gboolean success = bluez_gatt_characteristic1_call_write_value_finish(c1, aResult, &error.GetReceiver()); @@ -354,6 +362,7 @@ void BluezConnection::OnCharacteristicChanged(GDBusProxy * aInterface, GVariant void BluezConnection::SubscribeCharacteristicDone(GObject * aObject, GAsyncResult * aResult, gpointer apConnection) { + // NOLINTNEXTLINE(bugprone-casting-through-void) BluezGattCharacteristic1 * c2 = BLUEZ_GATT_CHARACTERISTIC1(aObject); GAutoPtr error; gboolean success = bluez_gatt_characteristic1_call_write_value_finish(c2, aResult, &error.GetReceiver()); @@ -367,6 +376,8 @@ CHIP_ERROR BluezConnection::SubscribeCharacteristicImpl(BluezConnection * connec { BluezGattCharacteristic1 * c2 = nullptr; VerifyOrExit(connection->mpC2 != nullptr, ChipLogError(DeviceLayer, "C2 is NULL in %s", __func__)); + + // NOLINTNEXTLINE(bugprone-casting-through-void) c2 = BLUEZ_GATT_CHARACTERISTIC1(connection->mpC2); // Get notifications on the TX characteristic change (e.g. indication is received) @@ -386,6 +397,7 @@ CHIP_ERROR BluezConnection::SubscribeCharacteristic() void BluezConnection::UnsubscribeCharacteristicDone(GObject * aObject, GAsyncResult * aResult, gpointer apConnection) { + // NOLINTNEXTLINE(bugprone-casting-through-void) BluezGattCharacteristic1 * c2 = BLUEZ_GATT_CHARACTERISTIC1(aObject); GAutoPtr error; gboolean success = bluez_gatt_characteristic1_call_write_value_finish(c2, aResult, &error.GetReceiver()); diff --git a/src/platform/Linux/bluez/BluezEndpoint.cpp b/src/platform/Linux/bluez/BluezEndpoint.cpp index 2fdd1e1788af6b..2e3a2501c461c8 100644 --- a/src/platform/Linux/bluez/BluezEndpoint.cpp +++ b/src/platform/Linux/bluez/BluezEndpoint.cpp @@ -229,12 +229,14 @@ static gboolean BluezCharacteristicConfirmError(BluezGattCharacteristic1 * aChar static gboolean BluezIsDeviceOnAdapter(BluezDevice1 * aDevice, BluezAdapter1 * aAdapter) { + // NOLINTNEXTLINE(bugprone-casting-through-void) return strcmp(bluez_device1_get_adapter(aDevice), g_dbus_proxy_get_object_path(G_DBUS_PROXY(aAdapter))) == 0 ? TRUE : FALSE; } BluezGattCharacteristic1 * BluezEndpoint::CreateGattCharacteristic(BluezGattService1 * aService, const char * aCharName, const char * aUUID, const char * const * aFlags) { + // NOLINTNEXTLINE(bugprone-casting-through-void) const char * servicePath = g_dbus_object_get_object_path(g_dbus_interface_get_object(G_DBUS_INTERFACE(aService))); GAutoPtr charPath(g_strdup_printf("%s/%s", servicePath, aCharName)); BluezObjectSkeleton * object; @@ -253,6 +255,8 @@ BluezGattCharacteristic1 * BluezEndpoint::CreateGattCharacteristic(BluezGattServ bluez_gatt_characteristic1_set_value(characteristic, value); bluez_object_skeleton_set_gatt_characteristic1(object, characteristic); + + // NOLINTNEXTLINE(bugprone-casting-through-void) g_dbus_object_manager_server_export(mpRoot, G_DBUS_OBJECT_SKELETON(object)); g_object_unref(object); @@ -262,6 +266,8 @@ BluezGattCharacteristic1 * BluezEndpoint::CreateGattCharacteristic(BluezGattServ void BluezEndpoint::RegisterGattApplicationDone(GObject * aObject, GAsyncResult * aResult) { GAutoPtr error; + + // NOLINTNEXTLINE(bugprone-casting-through-void) BluezGattManager1 * gattMgr = BLUEZ_GATT_MANAGER1(aObject); gboolean success = bluez_gatt_manager1_call_register_application_finish(gattMgr, aResult, &error.GetReceiver()); @@ -284,9 +290,11 @@ CHIP_ERROR BluezEndpoint::RegisterGattApplicationImpl() VerifyOrExit(mAdapter.get() != nullptr, ChipLogError(DeviceLayer, "FAIL: NULL mAdapter in %s", __func__)); + // NOLINTNEXTLINE(bugprone-casting-through-void) adapterObject = g_dbus_interface_get_object(G_DBUS_INTERFACE(mAdapter.get())); VerifyOrExit(adapterObject != nullptr, ChipLogError(DeviceLayer, "FAIL: NULL adapterObject in %s", __func__)); + // NOLINTNEXTLINE(bugprone-casting-through-void) gattMgr.reset(bluez_object_get_gatt_manager1(BLUEZ_OBJECT(adapterObject))); VerifyOrExit(gattMgr.get() != nullptr, ChipLogError(DeviceLayer, "FAIL: NULL gattMgr in %s", __func__)); @@ -307,6 +315,7 @@ CHIP_ERROR BluezEndpoint::RegisterGattApplicationImpl() /// Update the table of open BLE connections whenever a new device is spotted or its attributes have changed. void BluezEndpoint::UpdateConnectionTable(BluezDevice1 * apDevice) { + // NOLINTNEXTLINE(bugprone-casting-through-void) const char * objectPath = g_dbus_proxy_get_object_path(G_DBUS_PROXY(apDevice)); BluezConnection * connection = GetBluezConnection(objectPath); @@ -347,6 +356,7 @@ void BluezEndpoint::BluezSignalInterfacePropertiesChanged(GDBusObjectManagerClie VerifyOrReturn(mAdapter.get() != nullptr, ChipLogError(DeviceLayer, "FAIL: NULL mAdapter in %s", __func__)); VerifyOrReturn(strcmp(g_dbus_proxy_get_interface_name(aInterface), DEVICE_INTERFACE) == 0, ); + // NOLINTNEXTLINE(bugprone-casting-through-void) BluezDevice1 * device = BLUEZ_DEVICE1(aInterface); VerifyOrReturn(BluezIsDeviceOnAdapter(device, mAdapter.get())); @@ -361,16 +371,19 @@ void BluezEndpoint::HandleNewDevice(BluezDevice1 * device) // When a device is connected for first time, this function will be triggered. // The future connections for the same device will trigger ``Connect'' property change. // TODO: Factor common code in the two function. - BluezConnection * conn; - VerifyOrExit(bluez_device1_get_connected(device), ChipLogError(DeviceLayer, "FAIL: device is not connected")); + BluezConnection * conn = nullptr; + // NOLINTBEGIN(bugprone-casting-through-void) + VerifyOrExit(bluez_device1_get_connected(device), ChipLogError(DeviceLayer, "FAIL: device is not connected")); conn = GetBluezConnection(g_dbus_proxy_get_object_path(G_DBUS_PROXY(device))); VerifyOrExit(conn == nullptr, ChipLogError(DeviceLayer, "FAIL: connection already tracked: conn: %p new device: %s", conn, g_dbus_proxy_get_object_path(G_DBUS_PROXY(device)))); - conn = chip::Platform::New(*this, device); - mpPeerDevicePath = g_strdup(g_dbus_proxy_get_object_path(G_DBUS_PROXY(device))); + conn = chip::Platform::New(*this, device); + mpPeerDevicePath = g_strdup(g_dbus_proxy_get_object_path(G_DBUS_PROXY(device))); + // NOLINTEND(bugprone-casting-through-void) + mConnMap[mpPeerDevicePath] = conn; ChipLogDetail(DeviceLayer, "BLE device connected: conn %p, device %s, path %s", conn, conn->GetPeerAddress(), mpPeerDevicePath); @@ -383,6 +396,7 @@ void BluezEndpoint::BluezSignalOnObjectAdded(GDBusObjectManager * aManager, GDBu { // TODO: right now we do not handle addition/removal of adapters // Primary focus here is to handle addition of a device + // NOLINTNEXTLINE(bugprone-casting-through-void) GAutoPtr device(bluez_object_get_device1(BLUEZ_OBJECT(aObject))); VerifyOrReturn(device.get() != nullptr); @@ -415,6 +429,8 @@ BluezGattService1 * BluezEndpoint::CreateGattService(const char * aUUID) // includes -- unclear whether required. Might be filled in later bluez_object_skeleton_set_gatt_service1(object, service); + + // NOLINTNEXTLINE(bugprone-casting-through-void) g_dbus_object_manager_server_export(mpRoot, G_DBUS_OBJECT_SKELETON(object)); g_object_unref(object); @@ -429,11 +445,13 @@ void BluezEndpoint::SetupAdapter() GList * objects = g_dbus_object_manager_get_objects(mpObjMgr); for (auto l = objects; l != nullptr && mAdapter.get() == nullptr; l = l->next) { + // NOLINTNEXTLINE(bugprone-casting-through-void) GAutoPtr adapter(bluez_object_get_adapter1(BLUEZ_OBJECT(l->data))); if (adapter.get() != nullptr) { if (mpAdapterAddr == nullptr) // no adapter address provided, bind to the hci indicated by nodeid { + // NOLINTNEXTLINE(bugprone-casting-through-void) if (strcmp(g_dbus_proxy_get_object_path(G_DBUS_PROXY(adapter.get())), expectedPath) == 0) { mAdapter.reset(static_cast(g_object_ref(adapter.get()))); diff --git a/src/platform/Linux/bluez/BluezObjectIterator.h b/src/platform/Linux/bluez/BluezObjectIterator.h index ae5e01c6b9e34d..55eb6f7c2aae42 100644 --- a/src/platform/Linux/bluez/BluezObjectIterator.h +++ b/src/platform/Linux/bluez/BluezObjectIterator.h @@ -41,8 +41,17 @@ class BluezObjectIterator BluezObjectIterator() = default; explicit BluezObjectIterator(GList * position) : mPosition(position) {} - reference operator*() const { return *BLUEZ_OBJECT(mPosition->data); } - pointer operator->() const { return BLUEZ_OBJECT(mPosition->data); } + reference operator*() const + { + // NOLINTNEXTLINE(bugprone-casting-through-void) + return *BLUEZ_OBJECT(mPosition->data); + } + + pointer operator->() const + { + // NOLINTNEXTLINE(bugprone-casting-through-void) + return BLUEZ_OBJECT(mPosition->data); + } bool operator==(const BluezObjectIterator & other) const { return mPosition == other.mPosition; } bool operator!=(const BluezObjectIterator & other) const { return mPosition != other.mPosition; } diff --git a/src/platform/Linux/bluez/ChipDeviceScanner.cpp b/src/platform/Linux/bluez/ChipDeviceScanner.cpp index 0d248058c3d1a0..772380cedc9d11 100644 --- a/src/platform/Linux/bluez/ChipDeviceScanner.cpp +++ b/src/platform/Linux/bluez/ChipDeviceScanner.cpp @@ -215,6 +215,7 @@ CHIP_ERROR ChipDeviceScanner::MainLoopStopScan(ChipDeviceScanner * self) void ChipDeviceScanner::SignalObjectAdded(GDBusObjectManager * manager, GDBusObject * object, ChipDeviceScanner * self) { + // NOLINTNEXTLINE(bugprone-casting-through-void) GAutoPtr device(bluez_object_get_device1(BLUEZ_OBJECT(object))); VerifyOrReturn(device.get() != nullptr); @@ -225,6 +226,7 @@ void ChipDeviceScanner::SignalInterfaceChanged(GDBusObjectManagerClient * manage GDBusProxy * aInterface, GVariant * aChangedProperties, const gchar * const * aInvalidatedProps, ChipDeviceScanner * self) { + // NOLINTNEXTLINE(bugprone-casting-through-void) GAutoPtr device(bluez_object_get_device1(BLUEZ_OBJECT(object))); VerifyOrReturn(device.get() != nullptr); @@ -233,6 +235,7 @@ void ChipDeviceScanner::SignalInterfaceChanged(GDBusObjectManagerClient * manage void ChipDeviceScanner::ReportDevice(BluezDevice1 & device) { + // NOLINTNEXTLINE(bugprone-casting-through-void) if (strcmp(bluez_device1_get_adapter(&device), g_dbus_proxy_get_object_path(G_DBUS_PROXY(mAdapter.get()))) != 0) { return; @@ -251,6 +254,7 @@ void ChipDeviceScanner::ReportDevice(BluezDevice1 & device) void ChipDeviceScanner::RemoveDevice(BluezDevice1 & device) { + // NOLINTNEXTLINE(bugprone-casting-through-void) if (strcmp(bluez_device1_get_adapter(&device), g_dbus_proxy_get_object_path(G_DBUS_PROXY(mAdapter.get()))) != 0) { return; @@ -263,6 +267,7 @@ void ChipDeviceScanner::RemoveDevice(BluezDevice1 & device) return; } + // NOLINTNEXTLINE(bugprone-casting-through-void) const auto devicePath = g_dbus_proxy_get_object_path(G_DBUS_PROXY(&device)); GAutoPtr error;