From dfdc10472482ee2b1a7047a8a0dcb54e8fca04dc Mon Sep 17 00:00:00 2001 From: zgit2021 Date: Wed, 23 Mar 2022 10:12:37 +0000 Subject: [PATCH] process code review Signed-off-by: zgit2021 --- interfaces/innerkits/libdbinder/include/dbinder_service.h | 2 +- ipc/native/c/adapter/access_token/src/access_token_adapter.c | 4 ++-- ipc/native/src/napi/src/napi_ashmem.cpp | 2 +- ipc/native/src/napi/src/napi_remote_object.cpp | 2 +- ipc/native/test/unittest/common/ipc_core_unittest.cpp | 1 - ipc/test/serializer/utils_serializer_test.cpp | 2 +- .../test/distributedtest/src/dbinder_distributed_test.cpp | 2 +- .../test/distributedtest/src/dbinder_test_server_main.cpp | 2 +- utils/src/rpc_session_handle.c | 1 + 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/interfaces/innerkits/libdbinder/include/dbinder_service.h b/interfaces/innerkits/libdbinder/include/dbinder_service.h index 763f092e..0a230d1d 100644 --- a/interfaces/innerkits/libdbinder/include/dbinder_service.h +++ b/interfaces/innerkits/libdbinder/include/dbinder_service.h @@ -105,7 +105,7 @@ public: sptr MakeRemoteBinder(const std::u16string &serviceName, const std::string &deviceID, binder_uintptr_t binderObject, uint64_t pid = 0); bool RegisterRemoteProxy(std::u16string serviceName, sptr binderObject); - bool RegisterRemoteProxy(std::u16string serviceName, int32_t systemAbilityId); + bool RegisterRemoteProxy(std::u16string serviceName, int32_t systemAbilityId); bool OnRemoteMessageTask(const struct DHandleEntryTxRx *message); std::shared_ptr QuerySessionObject(binder_uintptr_t stub); bool DetachDeathRecipient(sptr object); diff --git a/ipc/native/c/adapter/access_token/src/access_token_adapter.c b/ipc/native/c/adapter/access_token/src/access_token_adapter.c index bb5701b3..ea89447e 100644 --- a/ipc/native/c/adapter/access_token/src/access_token_adapter.c +++ b/ipc/native/c/adapter/access_token/src/access_token_adapter.c @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + #include "access_token_adapter.h" #include #include @@ -50,7 +50,7 @@ uint64_t RpcGetSelfTokenID(void) if (fd < 0) { return INVAL_TOKEN_ID; } - int ret =ioctl(fd, ACCESS_TOKENID_GET_TOKENID, &token); + int ret = ioctl(fd, ACCESS_TOKENID_GET_TOKENID, &token); if (ret) { close(fd); return INVAL_TOKEN_ID; diff --git a/ipc/native/src/napi/src/napi_ashmem.cpp b/ipc/native/src/napi/src/napi_ashmem.cpp index 842ae62e..c1e83e33 100644 --- a/ipc/native/src/napi/src/napi_ashmem.cpp +++ b/ipc/native/src/napi/src/napi_ashmem.cpp @@ -382,4 +382,4 @@ napi_value NAPIAshmem::Ashmem_JS_Constructor(napi_env env, napi_callback_info in NAPI_ASSERT(env, status == napi_ok, "wrap js Ashmem and native holder failed"); return thisVar; } -} +} // namespace OHOS diff --git a/ipc/native/src/napi/src/napi_remote_object.cpp b/ipc/native/src/napi/src/napi_remote_object.cpp index c886d655..feb2adf9 100644 --- a/ipc/native/src/napi/src/napi_remote_object.cpp +++ b/ipc/native/src/napi/src/napi_remote_object.cpp @@ -100,7 +100,7 @@ void NAPIDeathRecipient::OnRemoteDied(const wptr &object) if (work == nullptr) { DBINDER_LOGE("failed to new uv_work_t"); return; - }; + } OnRemoteDiedParam *param = new OnRemoteDiedParam { .env = env_, .deathRecipientRef = deathRecipientRef_ diff --git a/ipc/native/test/unittest/common/ipc_core_unittest.cpp b/ipc/native/test/unittest/common/ipc_core_unittest.cpp index 5e50daa3..a9118c60 100755 --- a/ipc/native/test/unittest/common/ipc_core_unittest.cpp +++ b/ipc/native/test/unittest/common/ipc_core_unittest.cpp @@ -22,7 +22,6 @@ #include "test_service_command.h" #include "test_service_client.h" #include "ipc_test_helper.h" -#include "iservice_registry.h" #include "if_system_ability_manager.h" #include "iservice_registry.h" #include "system_ability_definition.h" diff --git a/ipc/test/serializer/utils_serializer_test.cpp b/ipc/test/serializer/utils_serializer_test.cpp index 14f3b3ab..00ae72d2 100644 --- a/ipc/test/serializer/utils_serializer_test.cpp +++ b/ipc/test/serializer/utils_serializer_test.cpp @@ -970,7 +970,7 @@ HWTEST_F(UtilsSerializerTest, test_serializer_WriteAndRead_threshold_001, TestSi IpcIoInit(&io, buffer, SMALL_BUFFER_SIZE, 0); const char* strwrite ="test for write string threshold********************************************************\ #####################################################"; - + bool result = WriteString(&io, strwrite); EXPECT_EQ(result, false); } diff --git a/services/dbinder/test/distributedtest/src/dbinder_distributed_test.cpp b/services/dbinder/test/distributedtest/src/dbinder_distributed_test.cpp index b6fb51a2..d595be89 100755 --- a/services/dbinder/test/distributedtest/src/dbinder_distributed_test.cpp +++ b/services/dbinder/test/distributedtest/src/dbinder_distributed_test.cpp @@ -87,7 +87,7 @@ public: static void SetUpTestCase(); static void TearDownTestCase(); virtual void SetUp(); - virtual void TearDown() {}; + virtual void TearDown() {} std::string IpToDeviceId(const std::string &localIp); bool GetRemoteDeviceId(); }; diff --git a/services/dbinder/test/distributedtest/src/dbinder_test_server_main.cpp b/services/dbinder/test/distributedtest/src/dbinder_test_server_main.cpp index da905d47..a4219f73 100755 --- a/services/dbinder/test/distributedtest/src/dbinder_test_server_main.cpp +++ b/services/dbinder/test/distributedtest/src/dbinder_test_server_main.cpp @@ -29,5 +29,5 @@ int main(int argc __attribute__((unused)), char **argv __attribute__((unused))) HiLog::Info(LG_LABEL, "DBinderTestService-main call StartThreadPool"); - while (1) {}; + while (1) {} } diff --git a/utils/src/rpc_session_handle.c b/utils/src/rpc_session_handle.c index c52d2ad4..d6232079 100644 --- a/utils/src/rpc_session_handle.c +++ b/utils/src/rpc_session_handle.c @@ -15,6 +15,7 @@ #include "rpc_session_handle.h" +#include #include #include