diff --git a/services/distributedhardwarefwkservice/src/componentloader/component_loader.cpp b/services/distributedhardwarefwkservice/src/componentloader/component_loader.cpp index 0188d46169fe7c300c2981a26c559f8b72c7d182..a31fd0d5e44a41edecef29a7c920902a302efb6b 100644 --- a/services/distributedhardwarefwkservice/src/componentloader/component_loader.cpp +++ b/services/distributedhardwarefwkservice/src/componentloader/component_loader.cpp @@ -82,7 +82,7 @@ int32_t ComponentLoader::Init() std::vector ComponentLoader::GetAllCompTypes() { std::vector DHTypeALL; - for (std::map::iterator it = compHandlerMap_.begin(); it != compHandlerMap_.end(); it++) { + for (std::map::iterator it = compHandlerMap_.begin(); it != compHandlerMap_.end(); ++it) { DHTypeALL.push_back(it->first); } return DHTypeALL; @@ -122,7 +122,7 @@ int32_t ComponentLoader::GetCompPathAndVersion(const std::string &jsonStr, std:: std::vector vecJsnCfg = jsonCfg.at(COMPONENTSLOAD_DISTRIBUTED_COMPONENTS).get>(); DHLOGI("get distributed_components CompConfig size is %d", vecJsnCfg.size()); - for (std::vector::iterator iter = vecJsnCfg.begin(); iter != vecJsnCfg.end(); iter++) { + for (std::vector::iterator iter = vecJsnCfg.begin(); iter != vecJsnCfg.end(); ++iter) { dhtypeMap.insert(std::pair((*iter).type, (*iter))); localDHVersion_.compVersions.insert( std::pair((*iter).type, GetCompVersionFromComConfig(*iter))); @@ -179,7 +179,7 @@ void *ComponentLoader::GetHandler(const std::string &soName) void ComponentLoader::GetAllHandler(std::map &dhtypeMap) { std::map::iterator itor; - for (itor = dhtypeMap.begin(); itor != dhtypeMap.end(); itor++) { + for (itor = dhtypeMap.begin(); itor != dhtypeMap.end(); ++itor) { CompHandler comHandler; comHandler.hardwareHandler = GetHandler(itor->second.compHandlerLoc); comHandler.sinkHandler = GetHandler(itor->second.compSinkLoc); @@ -302,7 +302,7 @@ int32_t ComponentLoader::UnInit() DHTraceStart(COMPONENT_RELEASE_START); int32_t ret = DH_FWK_SUCCESS; for (std::map::iterator iter = compHandlerMap_.begin(); - iter != compHandlerMap_.end(); iter++) { + iter != compHandlerMap_.end(); ++iter) { ret += ReleaseHardwareHandler(iter->first); ret += ReleaseSource(iter->first); ret += ReleaseSink(iter->first); diff --git a/services/distributedhardwarefwkservice/src/distributed_hardware_manager.cpp b/services/distributedhardwarefwkservice/src/distributed_hardware_manager.cpp index ff4cbc922a49dfd1b35440b104c07a1e9b1983ec..fbd9a416d201fa7179a79b7ce11beb34ad2fa643 100644 --- a/services/distributedhardwarefwkservice/src/distributed_hardware_manager.cpp +++ b/services/distributedhardwarefwkservice/src/distributed_hardware_manager.cpp @@ -38,16 +38,6 @@ namespace DistributedHardware { #undef DH_LOG_TAG #define DH_LOG_TAG "DistributedHardwareManager" -#ifdef __cplusplus -#define EXTERNC extern "C" -#else -#define EXTERNC -#endif - -EXTERNC __attribute__((visibility("default"))) IDistributedHardwareManager *GetDistributedHardwareManagerInstance() -{ - return &DistributedHardwareManager::GetInstance(); -} IMPLEMENT_SINGLE_INSTANCE(DistributedHardwareManager); diff --git a/services/distributedhardwarefwkservice/src/localhardwaremanager/local_hardware_manager.cpp b/services/distributedhardwarefwkservice/src/localhardwaremanager/local_hardware_manager.cpp index 547c206caa501c12c246af7e82df684bb78fa6ac..3ab0ae501128cd1c0a37bb860da73aac6bfa230b 100644 --- a/services/distributedhardwarefwkservice/src/localhardwaremanager/local_hardware_manager.cpp +++ b/services/distributedhardwarefwkservice/src/localhardwaremanager/local_hardware_manager.cpp @@ -127,7 +127,7 @@ void LocalHardwareManager::CheckNonExistCapabilityInfo(const std::vector for (auto capabilityInfo : allLocalCapabilityInfos) { std::shared_ptr capabilityValue = capabilityInfo.second; if (capabilityValue == nullptr) { - DHLOGE("capabilityInfo value is nullptr, key: %s", capabilityValue->GetAnonymousKey().c_str()); + DHLOGE("capabilityInfo value is nullptr"); continue; } DHLOGI("The key in allLocalCapabilityInfos is %s", capabilityValue->GetAnonymousKey().c_str()); diff --git a/services/distributedhardwarefwkservice/src/publisher/publisher_item.cpp b/services/distributedhardwarefwkservice/src/publisher/publisher_item.cpp index 1ce2e5c8fdc044c13631b00cb5ba9f14f54c39ff..cc5fcb8f4e17982a0c8479091fe28b87c5e0f35b 100644 --- a/services/distributedhardwarefwkservice/src/publisher/publisher_item.cpp +++ b/services/distributedhardwarefwkservice/src/publisher/publisher_item.cpp @@ -70,4 +70,4 @@ void PublisherItem::PublishMessage(const std::string &message) } } } // DistributedHardware -} // OHOS \ No newline at end of file +} // OHOS diff --git a/services/distributedhardwarefwkservice/src/resourcemanager/capability_info_manager.cpp b/services/distributedhardwarefwkservice/src/resourcemanager/capability_info_manager.cpp index 1516268afcd63fb50fb88ea2def89f7e2b87776a..46ee957bb72da9ba2a6a43ca096b57062eebe5c3 100644 --- a/services/distributedhardwarefwkservice/src/resourcemanager/capability_info_manager.cpp +++ b/services/distributedhardwarefwkservice/src/resourcemanager/capability_info_manager.cpp @@ -266,9 +266,8 @@ std::map> CapabilityInfoManager::Qu { std::lock_guard lock(capInfoMgrMutex_); std::map> capMap; - bool isMatch = true; for (auto &info : globalCapInfoMap_) { - isMatch = true; + bool isMatch = true; for (auto &filter : filters) { if (!IsCapabilityMatchFilter(info.second, filter.first, filter.second)) { isMatch = false;