diff --git a/interfaces/inner_kits/test/unittest/mock/mock_distributed_input_client.cpp b/interfaces/inner_kits/test/unittest/mock/mock_distributed_input_client.cpp index 683375c..d48faf2 100644 --- a/interfaces/inner_kits/test/unittest/mock/mock_distributed_input_client.cpp +++ b/interfaces/inner_kits/test/unittest/mock/mock_distributed_input_client.cpp @@ -73,7 +73,7 @@ void DistributedInputClient::AddWhiteListInfosCb::OnResult(const std::string &de return; } size_t jsonSize = inputData.size(); - DHLOGI("AddWhiteListInfosCb OnResult json size:%d.\n", jsonSize); + DHLOGI("AddWhiteListInfosCb OnResult json size:%zu.\n", jsonSize); TYPE_WHITE_LIST_VEC vecWhiteList = inputData; WhiteListUtil::GetInstance().SyncWhiteList(deviceId, vecWhiteList); } diff --git a/interfaces/ipc/src/distributed_input_client.cpp b/interfaces/ipc/src/distributed_input_client.cpp index aed168d..1cd468f 100644 --- a/interfaces/ipc/src/distributed_input_client.cpp +++ b/interfaces/ipc/src/distributed_input_client.cpp @@ -643,7 +643,7 @@ void DistributedInputClient::AddWhiteListInfos(const std::string &deviceId, cons return; } size_t jsonSize = inputData.size(); - DHLOGI("AddWhiteListInfosCb OnResult deviceId: %s, json str: %s, json size:%d.\n", + DHLOGI("AddWhiteListInfosCb OnResult deviceId: %s, json str: %s, json size:%zu.\n", GetAnonyString(deviceId).c_str(), GetAnonyString(strJson).c_str(), jsonSize); TYPE_WHITE_LIST_VEC vecWhiteList = inputData; WhiteListUtil::GetInstance().SyncWhiteList(deviceId, vecWhiteList); @@ -668,7 +668,7 @@ void DistributedInputClient::UpdateSinkScreenInfos(const std::string &strJson) return; } size_t jsonSize = inputData.size(); - DHLOGI("OnResult json str: %s, json size:%d.\n", GetAnonyString(strJson).c_str(), jsonSize); + DHLOGI("OnResult json str: %s, json size:%zu.\n", GetAnonyString(strJson).c_str(), jsonSize); std::vector> transInfos = inputData; for (auto info : transInfos) { if (info.size() != SINK_SCREEN_INFO_SIZE) { diff --git a/services/sink/sinkmanager/src/distributed_input_sink_manager.cpp b/services/sink/sinkmanager/src/distributed_input_sink_manager.cpp index 38680bf..2a4e51d 100644 --- a/services/sink/sinkmanager/src/distributed_input_sink_manager.cpp +++ b/services/sink/sinkmanager/src/distributed_input_sink_manager.cpp @@ -748,7 +748,7 @@ void DistributedInputSinkManager::ProjectWindowListener::OnMessage(const DHTopic { DHLOGI("ProjectWindowListener OnMessage!"); if (topic != DHTopic::TOPIC_SINK_PROJECT_WINDOW_INFO) { - DHLOGE("this topic is wrong, %d", static_cast(topic)); + DHLOGE("this topic is wrong, %u", static_cast(topic)); return; } std::string srcDeviceId = ""; @@ -876,7 +876,7 @@ void DistributedInputSinkManager::PluginStartListener::OnMessage(const DHTopic t { DHLOGI("PluginStartListener OnMessage!"); if (topic != DHTopic::TOPIC_PHY_DEV_PLUGIN) { - DHLOGE("this topic is wrong, %d", static_cast(topic)); + DHLOGE("this topic is wrong, %u", static_cast(topic)); return; } if (message.empty()) { diff --git a/services/sink/transport/src/distributed_input_sink_transport.cpp b/services/sink/transport/src/distributed_input_sink_transport.cpp index 10e27f9..04ff964 100644 --- a/services/sink/transport/src/distributed_input_sink_transport.cpp +++ b/services/sink/transport/src/distributed_input_sink_transport.cpp @@ -210,7 +210,7 @@ void DistributedInputSinkTransport::SendKeyStateNodeMsg(const int32_t sessionId, DHLOGE("SendKeyStateNodeMsg error, sessionId <= 0."); return; } - DHLOGI("SendKeyStateNodeMsg sessionId: %d, btnCode: %d.", sessionId, btnCode); + DHLOGI("SendKeyStateNodeMsg sessionId: %d, btnCode: %u.", sessionId, btnCode); nlohmann::json jsonStr; jsonStr[DINPUT_SOFTBUS_KEY_CMD_TYPE] = TRANS_SINK_MSG_KEY_STATE; jsonStr[DINPUT_SOFTBUS_KEY_KEYSTATE_DHID] = dhId; diff --git a/services/source/sourcemanager/src/dinput_source_listener.cpp b/services/source/sourcemanager/src/dinput_source_listener.cpp index c35328d..6645e76 100644 --- a/services/source/sourcemanager/src/dinput_source_listener.cpp +++ b/services/source/sourcemanager/src/dinput_source_listener.cpp @@ -346,7 +346,7 @@ void DInputSourceListener::OnReceivedEventRemoteInput(const std::string deviceId } size_t jsonSize = inputData.size(); - DHLOGD("OnReceivedEventRemoteInput called, deviceId: %s, json size:%d.", + DHLOGD("OnReceivedEventRemoteInput called, deviceId: %s, json size:%zu.", GetAnonyString(deviceId).c_str(), jsonSize); std::vector mEventBuffer(jsonSize); diff --git a/services/source/sourcemanager/src/distributed_input_source_manager.cpp b/services/source/sourcemanager/src/distributed_input_source_manager.cpp index 1a09799..8f89121 100644 --- a/services/source/sourcemanager/src/distributed_input_source_manager.cpp +++ b/services/source/sourcemanager/src/distributed_input_source_manager.cpp @@ -1632,7 +1632,7 @@ void DistributedInputSourceManager::StopDScreenListener::OnMessage(const DHTopic { DHLOGI("StopDScreenListener OnMessage!"); if (topic != DHTopic::TOPIC_STOP_DSCREEN) { - DHLOGE("this topic is wrong, %d", static_cast(topic)); + DHLOGE("this topic is wrong, %u", static_cast(topic)); return; } std::string sinkDevId = ""; @@ -1700,7 +1700,7 @@ void DistributedInputSourceManager::DeviceOfflineListener::OnMessage(const DHTop { DHLOGI("DeviceOfflineListener OnMessage!"); if (topic != DHTopic::TOPIC_DEV_OFFLINE) { - DHLOGE("this topic is wrong, %d", static_cast(topic)); + DHLOGE("this topic is wrong, %u", static_cast(topic)); return; } if (message.empty()) { diff --git a/services/transportbase/src/distributed_input_transport_base.cpp b/services/transportbase/src/distributed_input_transport_base.cpp index 698be02..03a040f 100644 --- a/services/transportbase/src/distributed_input_transport_base.cpp +++ b/services/transportbase/src/distributed_input_transport_base.cpp @@ -95,7 +95,7 @@ void OnFile(int32_t socket, FileEvent *event) void OnQos(int32_t socket, QoSEvent eventId, const QosTV *qos, uint32_t qosCount) { - DHLOGI("OnQos, socket: %d, QoSEvent: %d, qosCount: %ld", socket, (int32_t)eventId, qosCount); + DHLOGI("OnQos, socket: %d, QoSEvent: %d, qosCount: %u", socket, (int32_t)eventId, qosCount); for (uint32_t idx = 0; idx < qosCount; idx++) { DHLOGI("QosTV: type: %d, value: %d", (int32_t)qos[idx].qos, qos[idx].value); } diff --git a/sinkhandler/test/unittest/mock/mock_distributed_input_client.cpp b/sinkhandler/test/unittest/mock/mock_distributed_input_client.cpp index 8a5e798..6c453fd 100644 --- a/sinkhandler/test/unittest/mock/mock_distributed_input_client.cpp +++ b/sinkhandler/test/unittest/mock/mock_distributed_input_client.cpp @@ -68,7 +68,7 @@ void DistributedInputClient::AddWhiteListInfosCb::OnResult(const std::string &de return; } size_t jsonSize = inputData.size(); - DHLOGI("AddWhiteListInfosCb OnResult json size:%d.\n", jsonSize); + DHLOGI("AddWhiteListInfosCb OnResult json size:%zu.\n", jsonSize); TYPE_WHITE_LIST_VEC vecWhiteList = inputData; WhiteListUtil::GetInstance().SyncWhiteList(deviceId, vecWhiteList); } diff --git a/sourcehandler/test/unittest/mock/mock_distributed_input_client.cpp b/sourcehandler/test/unittest/mock/mock_distributed_input_client.cpp index ae72613..544fd11 100644 --- a/sourcehandler/test/unittest/mock/mock_distributed_input_client.cpp +++ b/sourcehandler/test/unittest/mock/mock_distributed_input_client.cpp @@ -69,7 +69,7 @@ void DistributedInputClient::AddWhiteListInfosCb::OnResult(const std::string &de return; } size_t jsonSize = inputData.size(); - DHLOGI("AddWhiteListInfosCb OnResult json size:%d.\n", jsonSize); + DHLOGI("AddWhiteListInfosCb OnResult json size:%zu.\n", jsonSize); TYPE_WHITE_LIST_VEC vecWhiteList = inputData; WhiteListUtil::GetInstance().SyncWhiteList(deviceId, vecWhiteList); }