From c693d7d41d1a3b3bd478553a9b0124a904641c9d Mon Sep 17 00:00:00 2001 From: gecheng Date: Mon, 7 Apr 2025 21:35:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=9D=99=E6=80=81=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: gecheng --- .../distributeddataservice/rust/extension/cloud_server_impl.cpp | 2 +- services/distributeddataservice/service/cloud/sync_manager.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/distributeddataservice/rust/extension/cloud_server_impl.cpp b/services/distributeddataservice/rust/extension/cloud_server_impl.cpp index 6e9a020f4..e5413cff2 100644 --- a/services/distributeddataservice/rust/extension/cloud_server_impl.cpp +++ b/services/distributeddataservice/rust/extension/cloud_server_impl.cpp @@ -552,7 +552,7 @@ int32_t CloudServerImpl::Unsubscribe(int32_t userId, const std::mapsecond); + uint32_t subId = static_cast(std::atoi(it->second.c_str())); if (OhCloudExtVectorPush(relation, &subId, sizeof(uint32_t)) != ERRNO_SUCCESS) { return DBErr::E_ERROR; } diff --git a/services/distributeddataservice/service/cloud/sync_manager.cpp b/services/distributeddataservice/service/cloud/sync_manager.cpp index 933cd92cb..adb7e9e53 100644 --- a/services/distributeddataservice/service/cloud/sync_manager.cpp +++ b/services/distributeddataservice/service/cloud/sync_manager.cpp @@ -1006,7 +1006,7 @@ void SyncManager::CleanCompensateSync(int32_t userId) void SyncManager::AddCompensateSync(const StoreMetaData &meta) { - compensateSyncInfos_.Compute(std::stoi(meta.user), + compensateSyncInfos_.Compute(std::atoi(meta.user.c_str()), [&meta](auto &, std::map> &apps) { apps[meta.bundleName].insert(meta.storeId); return true; -- Gitee From aea219e3a486364d435605cb22004959da656042 Mon Sep 17 00:00:00 2001 From: gecheng Date: Tue, 8 Apr 2025 11:28:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=9D=99=E6=80=81=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: gecheng --- .../service/crypto/src/crypto_manager.cpp | 4 ++-- .../service/object/src/object_manager.cpp | 2 +- .../distributeddataservice/service/rdb/rdb_general_store.cpp | 2 +- .../service/test/rdb_general_store_test.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/services/distributeddataservice/service/crypto/src/crypto_manager.cpp b/services/distributeddataservice/service/crypto/src/crypto_manager.cpp index 16a775464..e278c678f 100644 --- a/services/distributeddataservice/service/crypto/src/crypto_manager.cpp +++ b/services/distributeddataservice/service/crypto/src/crypto_manager.cpp @@ -64,7 +64,7 @@ bool AddHksParams(HksParamSet *params, const CryptoManager::ParamConfig ¶mCo }; if (paramConfig.storageLevel > HKS_AUTH_STORAGE_LEVEL_DE) { hksParam.emplace_back( - HksParam { .tag = HKS_TAG_SPECIFIC_USER_ID, .int32Param = std::stoi(paramConfig.userId) }); + HksParam { .tag = HKS_TAG_SPECIFIC_USER_ID, .int32Param = std::atoi(paramConfig.userId.c_str()) }); } auto ret = HksAddParams(params, aes256Param, sizeof(aes256Param) / sizeof(aes256Param[0])); @@ -100,7 +100,7 @@ int32_t GetRootKeyParams(HksParamSet *¶ms, uint32_t storageLevel, const std: { .tag = HKS_TAG_AUTH_STORAGE_LEVEL, .uint32Param = storageLevel }, }; if (storageLevel > HKS_AUTH_STORAGE_LEVEL_DE) { - hksParam.emplace_back(HksParam { .tag = HKS_TAG_SPECIFIC_USER_ID, .int32Param = std::stoi(userId) }); + hksParam.emplace_back(HksParam { .tag = HKS_TAG_SPECIFIC_USER_ID, .int32Param = std::atoi(userId.c_str()) }); } ret = HksAddParams(params, hksParam.data(), hksParam.size()); diff --git a/services/distributeddataservice/service/object/src/object_manager.cpp b/services/distributeddataservice/service/object/src/object_manager.cpp index 369c3eef8..0c2229e9d 100644 --- a/services/distributeddataservice/service/object/src/object_manager.cpp +++ b/services/distributeddataservice/service/object/src/object_manager.cpp @@ -536,7 +536,7 @@ void ObjectStoreManager::PullAssets(const std::map& d for (const auto& [objectId, assets] : changedAssets) { std::string networkId = DmAdaper::GetInstance().ToNetworkID(saveInfo.sourceDeviceId); auto block = std::make_shared>>(WAIT_TIME, std::tuple{ true, true }); - ObjectAssetLoader::GetInstance()->TransferAssetsAsync(std::stoi(GetCurrentUser()), + ObjectAssetLoader::GetInstance()->TransferAssetsAsync(std::atoi(GetCurrentUser().c_str()), saveInfo.bundleName, networkId, assets, [this, block](bool success) { block->SetValue({ false, success }); }); diff --git a/services/distributeddataservice/service/rdb/rdb_general_store.cpp b/services/distributeddataservice/service/rdb/rdb_general_store.cpp index b8dc6345e..55beb04f8 100644 --- a/services/distributeddataservice/service/rdb/rdb_general_store.cpp +++ b/services/distributeddataservice/service/rdb/rdb_general_store.cpp @@ -141,7 +141,7 @@ void RdbGeneralStore::InitStoreInfo(const StoreMetaData &meta) storeInfo_.bundleName = meta.bundleName; storeInfo_.storeName = meta.storeId; storeInfo_.instanceId = meta.instanceId; - storeInfo_.user = std::stoi(meta.user); + storeInfo_.user = std::atoi(meta.user.c_str()); storeInfo_.deviceId = DeviceManagerAdapter::GetInstance().GetLocalDevice().uuid; } diff --git a/services/distributeddataservice/service/test/rdb_general_store_test.cpp b/services/distributeddataservice/service/test/rdb_general_store_test.cpp index de1ef193c..6f36ac141 100644 --- a/services/distributeddataservice/service/test/rdb_general_store_test.cpp +++ b/services/distributeddataservice/service/test/rdb_general_store_test.cpp @@ -393,7 +393,7 @@ HWTEST_F(RdbGeneralStoreTest, Close, TestSize.Level1) { auto store = new (std::nothrow) RdbGeneralStore(metaData_); ASSERT_NE(store, nullptr); - auto result = store->IsBound(std::stoi(metaData_.user)); + auto result = store->IsBound(std::atoi(metaData_.user.c_str())); EXPECT_EQ(result, false); EXPECT_EQ(store->delegate_, nullptr); auto ret = store->Close(); -- Gitee