From 60b4dc1cfa6cb5f291b21483ac0114bdefd2cb64 Mon Sep 17 00:00:00 2001 From: thekurtovic <40248206+thekurtovic@users.noreply.github.com> Date: Thu, 16 Jan 2025 16:20:19 -0500 Subject: [PATCH] change: Static cast arg --- src/NimBLEClient.cpp | 2 +- src/NimBLERemoteCharacteristic.cpp | 2 +- src/NimBLERemoteService.cpp | 2 +- src/NimBLEUtils.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/NimBLEClient.cpp b/src/NimBLEClient.cpp index c2e53dd..6b66f99 100644 --- a/src/NimBLEClient.cpp +++ b/src/NimBLEClient.cpp @@ -633,7 +633,7 @@ NimBLERemoteService* NimBLEClient::getService(const NimBLEUUID& uuid) { NimBLERemoteService *pSvc = nullptr; NimBLEUtils::getAttr(uuid, pSvc, m_svcVec, [this](const NimBLEUUID* u, void* arg) { - return retrieveServices(u, (NimBLERemoteService*)arg); + return retrieveServices(u, static_cast(arg)); }); NIMBLE_LOGD(LOG_TAG, "<< getService: %sfound", !pSvc ? "not " : ""); diff --git a/src/NimBLERemoteCharacteristic.cpp b/src/NimBLERemoteCharacteristic.cpp index b089395..eb5fd04 100644 --- a/src/NimBLERemoteCharacteristic.cpp +++ b/src/NimBLERemoteCharacteristic.cpp @@ -141,7 +141,7 @@ NimBLERemoteDescriptor* NimBLERemoteCharacteristic::getDescriptor(const NimBLEUU NimBLERemoteDescriptor* pDsc = nullptr; NimBLEUtils::getAttr(uuid, pDsc, m_vDescriptors, [this](const NimBLEUUID* u, void* arg) { - return retrieveDescriptors(u, (NimBLERemoteDescriptor*)arg); + return retrieveDescriptors(u, static_cast(arg)); }); NIMBLE_LOGD(LOG_TAG, "<< getDescriptor: %sfound", !pDsc ? "not " : ""); diff --git a/src/NimBLERemoteService.cpp b/src/NimBLERemoteService.cpp index 6dba0f5..f62f902 100644 --- a/src/NimBLERemoteService.cpp +++ b/src/NimBLERemoteService.cpp @@ -79,7 +79,7 @@ NimBLERemoteCharacteristic* NimBLERemoteService::getCharacteristic(const NimBLEU NimBLERemoteCharacteristic* pChar = nullptr; NimBLEUtils::getAttr(uuid, pChar, m_vChars, [this](const NimBLEUUID* u, void* arg) { - return retrieveCharacteristics(u, (NimBLERemoteCharacteristic*)arg); + return retrieveCharacteristics(u, static_cast(arg)); }); NIMBLE_LOGD(LOG_TAG, "<< getCharacteristic: %sfound", !pChar ? "not " : ""); diff --git a/src/NimBLEUtils.h b/src/NimBLEUtils.h index a8c2084..dfa4b9e 100644 --- a/src/NimBLEUtils.h +++ b/src/NimBLEUtils.h @@ -57,7 +57,7 @@ class NimBLEUtils { static void taskRelease(const NimBLETaskData& taskData, int rc = 0); template - static void getAttr(const NimBLEUUID& uuid, T* attr, const std::vector vec, const std::function& getter) { + static void getAttr(const NimBLEUUID& uuid, T* attr, const std::vector& vec, const std::function& getter) { // Check if already exists. for (const auto& v : vec) { if (v->getUUID() == uuid) {