!92 修改64位机上不兼容的变量打印格式控制符

Merge pull request !92 from LongestDistance/master
This commit is contained in:
openharmony_ci 2024-11-06 09:39:13 +00:00 committed by Gitee
commit 67f7efa084
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 16 additions and 3 deletions

View File

@ -654,7 +654,8 @@ int32_t StreamPlayerImplProxy::ProvideKeyResponse(const std::string &mediaId, co
MessageOption option;
auto len = response.size();
if (len > data.GetDataCapacity()) {
CLOGD("ProvideKeyResponse SetDataCapacity totalSize: %u", len);
CLOGD("ProvideKeyResponse SetDataCapacity totalSize: %zu", len);
data.SetMaxCapacity(len + len);
data.SetDataCapacity(len);
}
@ -663,20 +664,24 @@ int32_t StreamPlayerImplProxy::ProvideKeyResponse(const std::string &mediaId, co
CLOGE("Failed to write the interface token");
return CAST_ENGINE_ERROR;
}
if (!data.WriteString(mediaId)) {
CLOGE("Failed to write mediaId");
return CAST_ENGINE_ERROR;
}
if (!data.WriteInt32(response.size())) {
CLOGE("StreamPlayerImplProxy ProvideKeyResponse Write response size failed");
return IPC_PROXY_ERR;
}
if (len != 0) {
if (!data.WriteBuffer(response.data(), len)) {
CLOGE("StreamPlayerImplProxy ProvideKeyResponse write response failed");
return IPC_PROXY_ERR;
}
}
if (Remote()->SendRequest(PROVIDE_KEY_RESPONSE, data, reply, option) != ERR_NONE) {
CLOGE("Failed to send ipc request when provide key response");
return CAST_ENGINE_ERROR;

View File

@ -133,14 +133,17 @@ void CastServiceListenerImplProxy::OnLogEvent(int32_t eventId, int64_t param)
CLOGE("Failed to write the interface token");
return;
}
if (!data.WriteInt32(eventId)) {
CLOGE("Failed to write the eventId:%d", eventId);
return;
}
if (!data.WriteInt64(param)) {
CLOGE("Failed to write the param:%lld", param);
CLOGE("Failed to write the param:%" PRIu64, param);
return;
}
CLOGD("send request");
Remote()->SendRequest(ON_LOG_EVENT, data, reply, option);
}

View File

@ -342,7 +342,8 @@ void StreamPlayerListenerImplProxy::OnKeyRequest(const std::string &mediaId, con
MessageOption option;
auto len = keyRequestData.size();
if (len > data.GetDataCapacity()) {
CLOGD("SetDataCapacity totalSize: %u", len);
CLOGD("SetDataCapacity totalSize: %zu", len);
data.SetMaxCapacity(len + len);
data.SetDataCapacity(len);
}
@ -351,20 +352,24 @@ void StreamPlayerListenerImplProxy::OnKeyRequest(const std::string &mediaId, con
CLOGE("Failed to write the interface token");
return;
}
if (!data.WriteString(mediaId)) {
CLOGE("Failed to write mediaId");
return;
}
if (!data.WriteInt32(keyRequestData.size())) {
CLOGE("Write keyRequestData size failed");
return;
}
if (len != 0) {
if (!data.WriteBuffer(keyRequestData.data(), len)) {
CLOGE("write keyRequestData failed");
return;
}
}
if (Remote()->SendRequest(ON_KEY_REQUEST, data, reply, option) != ERR_NONE) {
CLOGE("Failed to send ipc request when reporting key request data");
return;