From fd18d28b3c9217041b6e8482d9bac2846c791dc7 Mon Sep 17 00:00:00 2001 From: likailong Date: Tue, 8 Mar 2022 18:41:53 +0800 Subject: [PATCH] chore: fix some codex Signed-off-by: likailong --- samgr_client/source/remote_register_rpc.c | 2 +- samgr_endpoint/source/default_client_rpc.c | 5 ++--- samgr_endpoint/source/endpoint_rpc.c | 4 +--- samgr_server/source/samgr_server_rpc.c | 1 - 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/samgr_client/source/remote_register_rpc.c b/samgr_client/source/remote_register_rpc.c index 2e3767d..42327ff 100755 --- a/samgr_client/source/remote_register_rpc.c +++ b/samgr_client/source/remote_register_rpc.c @@ -50,7 +50,7 @@ int SAMGR_RegisterServiceApi(const char *service, const char *feature, const Ide SaName saName = {service, feature}; int32 token = SAMGR_AddRouter(g_remoteRegister.endpoint, &saName, identity, iUnknown); char saNameStr[2 * MAX_NAME_LEN + 2]; - sprintf_s(saNameStr, 2 * MAX_NAME_LEN + 2, "%s#%s", service, feature?feature:""); + (void)sprintf_s(saNameStr, 2 * MAX_NAME_LEN + 2, "%s#%s", service, feature?feature:""); HILOG_INFO(HILOG_MODULE_SAMGR, "register saname: %s index: %d\n", saNameStr, token); SaNode *saNode = GetSaNodeBySaName(service, feature); if (saNode != NULL) { diff --git a/samgr_endpoint/source/default_client_rpc.c b/samgr_endpoint/source/default_client_rpc.c index 33acdb6..a245f2e 100755 --- a/samgr_endpoint/source/default_client_rpc.c +++ b/samgr_endpoint/source/default_client_rpc.c @@ -300,7 +300,7 @@ static SvcIdentity QueryIdentity(const char *service, const char *feature) static SvcIdentity QueryRemoteIdentity(const char *deviceId, const char *service, const char *feature) { char saName[2 * MAX_NAME_LEN + 2]; - sprintf_s(saName, 2 * MAX_NAME_LEN + 2, "%s#%s", service?service:"", feature?feature:""); + (void)sprintf_s(saName, 2 * MAX_NAME_LEN + 2, "%s#%s", service?service:"", feature?feature:""); HILOG_INFO(HILOG_MODULE_SAMGR, "saName %s, make remote binder start", saName); SvcIdentity target = {INVALID_INDEX, INVALID_INDEX, INVALID_INDEX};; @@ -316,9 +316,8 @@ static SvcIdentity QueryRemoteIdentity(const char *deviceId, const char *service return target; } target.handle = GetNextHandle(); - // todo: in l1, we should use ReadRemoteObject, because we should use IPC extern void WaitForProxyInit(SvcIdentity *svc); WaitForProxyInit(&target); HILOG_ERROR(HILOG_MODULE_SAMGR, "MakeRemoteBinder sid handle=%d", target.handle); return target; -} \ No newline at end of file +} diff --git a/samgr_endpoint/source/endpoint_rpc.c b/samgr_endpoint/source/endpoint_rpc.c index a583e7e..fde0b9b 100644 --- a/samgr_endpoint/source/endpoint_rpc.c +++ b/samgr_endpoint/source/endpoint_rpc.c @@ -115,8 +115,6 @@ int SAMGR_AddRouter(Endpoint *endpoint, const SaName *saName, const Identity *id } IServerProxy *serverProxy = NULL; proxy->QueryInterface(proxy, SERVER_PROXY_VER, (void *)&serverProxy); - if (serverProxy == NULL) { - } int index = VECTOR_FindByKey(&endpoint->routers, proxy); if (index != INVALID_INDEX) { serverProxy->Release((IUnknown *)serverProxy); @@ -225,7 +223,7 @@ static int SendGetAllSysCapsRequest(const Endpoint *endpoint, uint32 startIdx, I MessageOptionInit(&option); int ret = SendRequest(samgr, INVALID_INDEX, &req, reply, option, (uintptr_t *)replyBuf); - HILOG_DEBUG(HILOG_MODULE_SAMGR, "SendGetAllSysCapsRequest startIdx:%d, ret:%d!", startIdx, ret); + HILOG_DEBUG(HILOG_MODULE_SAMGR, "SendGetAllSysCapsRequest startIdx:%u, ret:%d!", startIdx, ret); return -ret; } diff --git a/samgr_server/source/samgr_server_rpc.c b/samgr_server/source/samgr_server_rpc.c index 6ccbed5..bbf1afe 100755 --- a/samgr_server/source/samgr_server_rpc.c +++ b/samgr_server/source/samgr_server_rpc.c @@ -196,7 +196,6 @@ static const char *GetName(Service *service) static BOOL Initialize(Service *service, Identity identity) { - //todo: move rpc here SamgrServer *server = (SamgrServer *)service; server->identity = identity; SaName saName = {SAMGR_SERVICE, NULL}; -- Gitee