From 5c42a8000800ca4eb0c7755f337c3999f9900729 Mon Sep 17 00:00:00 2001 From: chensi10 Date: Fri, 20 Aug 2021 14:37:45 +0800 Subject: [PATCH] Modify arm64 build error Signed-off-by: chensi10 --- interfaces/kits/napi/ans/include/subscribe.h | 2 +- interfaces/kits/napi/ans/src/common.cpp | 5 +++-- interfaces/kits/napi/ans/src/create_subscriber.cpp | 10 +++++----- interfaces/kits/napi/ans/src/get_active.cpp | 4 ++-- interfaces/kits/napi/ans/src/slot.cpp | 4 ++-- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/interfaces/kits/napi/ans/include/subscribe.h b/interfaces/kits/napi/ans/include/subscribe.h index ad57a9ba1..80b0faffe 100644 --- a/interfaces/kits/napi/ans/include/subscribe.h +++ b/interfaces/kits/napi/ans/include/subscribe.h @@ -26,4 +26,4 @@ napi_value Subscribe(napi_env env, napi_callback_info info); } // namespace NotificationNapi } // namespace OHOS -#endif // BASE_NOTIFICATION_ANS_STANDARD_KITS_NAPI_INCLUDE_SUBSCRIBE_H \ No newline at end of file +#endif // BASE_NOTIFICATION_ANS_STANDARD_KITS_NAPI_INCLUDE_SUBSCRIBE_H diff --git a/interfaces/kits/napi/ans/src/common.cpp b/interfaces/kits/napi/ans/src/common.cpp index 19ae25e69..174867b4e 100644 --- a/interfaces/kits/napi/ans/src/common.cpp +++ b/interfaces/kits/napi/ans/src/common.cpp @@ -14,6 +14,7 @@ */ #include "common.h" +#include #include "napi_common.h" #include "notification_long_text_content.h" #include "notification_multiline_content.h" @@ -2449,7 +2450,7 @@ napi_value getConversationalMessage(const napi_env &env, const napi_value &conve NAPI_CALL(env, napi_typeof(env, timestampResult, &valuetype)); NAPI_ASSERT(env, valuetype == napi_number, "Wrong argument type. Number expected."); napi_get_value_int64(env, timestampResult, ×tamp); - ANS_LOGI("conversationalMessage::timestamp = %{public}lld", timestamp); + ANS_LOGI("conversationalMessage::timestamp = %{public}" PRId64, timestamp); } // mimeType: string NAPI_CALL(env, napi_has_named_property(env, conversationalMessage, "mimeType", &hasProperty)); @@ -2877,7 +2878,7 @@ napi_value Common::GetNotificationSlot(const napi_env &env, NotificationSlot &sl NAPI_CALL(env, napi_typeof(env, nVibrationValue, &valuetype)); NAPI_ASSERT(env, valuetype == napi_number, "Wrong argument type. Number expected."); napi_get_value_int64(env, nVibrationValue, &vibrationValue); - ANS_LOGI("vibrationValue is: %{public}lld", vibrationValue); + ANS_LOGI("vibrationValue is: %{public}" PRId64, vibrationValue); vibrationValues.emplace_back(vibrationValue); } if (vibrationValues.size() > 0) { diff --git a/interfaces/kits/napi/ans/src/create_subscriber.cpp b/interfaces/kits/napi/ans/src/create_subscriber.cpp index 639da8fa8..28360ea0a 100644 --- a/interfaces/kits/napi/ans/src/create_subscriber.cpp +++ b/interfaces/kits/napi/ans/src/create_subscriber.cpp @@ -123,7 +123,7 @@ void SubscriberInstance::OnCanceled(const std::shared_ptrGetNotificationRequest().GetNotificationId()); - ANS_LOGI("OnCanceled sortingMap size = %{public}d", sortingMap->GetKey().size()); + ANS_LOGI("OnCanceled sortingMap size = %{public}zu", sortingMap->GetKey().size()); ANS_LOGI("OnCanceled deleteReason = %{public}d", deleteReason); uv_loop_s *loop = nullptr; @@ -196,7 +196,7 @@ void SubscriberInstance::OnConsumed(const std::shared_ptrGetNotificationRequest().GetNotificationId()); - ANS_LOGI("OnConsumed sortingMap size = %{public}d", sortingMap->GetKey().size()); + ANS_LOGI("OnConsumed sortingMap size = %{public}zu", sortingMap->GetKey().size()); uv_loop_s *loop = nullptr; #if NAPI_VERSION >= 2 @@ -257,7 +257,7 @@ void SubscriberInstance::OnUpdate(const std::shared_ptr ANS_LOGE("sortingMap is null"); return; } - ANS_LOGI("OnUpdate sortingMap size = %{public}d", sortingMap->GetKey().size()); + ANS_LOGI("OnUpdate sortingMap size = %{public}zu", sortingMap->GetKey().size()); uv_loop_s *loop = nullptr; #if NAPI_VERSION >= 2 @@ -784,7 +784,7 @@ bool AddAsyncCallbackInfo(SubscriberInstance *subscriber, AsyncCallbackInfoOn *a std::lock_guard lock(mutex_); auto infoItem = g_SubscriberInstances.find(subscriber); if (infoItem != g_SubscriberInstances.end()) { - ANS_LOGI("AddAsyncCallbackInfo AsyncCallbackInfoOn size = %{public}d", infoItem->second.size()); + ANS_LOGI("AddAsyncCallbackInfo AsyncCallbackInfoOn size = %{public}zu", infoItem->second.size()); for (auto asyncCallbackInfoOn : infoItem->second) { ANS_LOGI("AddAsyncCallbackInfo AsyncCallbackInfoOn ptr = %{public}p", asyncCallbackInfoOn); ANS_LOGI("AsyncCallbackInfoOn->type = %{public}s", asyncCallbackInfoOn->type.c_str()); @@ -815,7 +815,7 @@ bool DelAsyncCallbackInfo(SubscriberInstance *subscriber, const std::string &typ auto infoItem = g_SubscriberInstances.find(subscriber); if (infoItem != g_SubscriberInstances.end()) { - ANS_LOGI("DelSubscriberInstance AsyncCallbackInfoOn size = %{public}d", infoItem->second.size()); + ANS_LOGI("DelSubscriberInstance AsyncCallbackInfoOn size = %{public}zu", infoItem->second.size()); if (type.empty()) { for (auto asyncCallbackInfoOn : infoItem->second) { ANS_LOGI("DelSubscriberInstance AsyncCallbackInfoOn ptr = %{public}p", asyncCallbackInfoOn); diff --git a/interfaces/kits/napi/ans/src/get_active.cpp b/interfaces/kits/napi/ans/src/get_active.cpp index 28ab27097..0ae881ec3 100644 --- a/interfaces/kits/napi/ans/src/get_active.cpp +++ b/interfaces/kits/napi/ans/src/get_active.cpp @@ -92,7 +92,7 @@ napi_value GetAllActiveNotifications(napi_env env, napi_callback_info info) if (ParseParametersByAllActive(env, argv, argc, hashcode, callback) == nullptr) { return Common::JSParaError(env, callback); } - ANS_LOGI("GetAllActiveNotifications hashcode.size = %{public}d", hashcode.size()); + ANS_LOGI("GetAllActiveNotifications hashcode.size = %{public}zu", hashcode.size()); AsyncCallbackInfoActive *asynccallbackinfo = new (std::nothrow) AsyncCallbackInfoActive{.env = env, .asyncWork = nullptr, .strValue = hashcode}; @@ -328,4 +328,4 @@ napi_value GetActiveNotificationNums(napi_env env, napi_callback_info info) } } } // namespace NotificationNapi -} // namespace OHOS \ No newline at end of file +} // namespace OHOS diff --git a/interfaces/kits/napi/ans/src/slot.cpp b/interfaces/kits/napi/ans/src/slot.cpp index 99864d9d2..c3967c3b4 100644 --- a/interfaces/kits/napi/ans/src/slot.cpp +++ b/interfaces/kits/napi/ans/src/slot.cpp @@ -514,7 +514,7 @@ napi_value GetSlots(napi_env env, napi_callback_info info) } } } - ANS_LOGI("getSlots count = %{public}d", count); + ANS_LOGI("getSlots count = %{public}zu", count); if (count == 0) { asynccallbackinfo->errorCode = ERROR; asynccallbackinfo->result = Common::NapiGetNull(env); @@ -615,4 +615,4 @@ napi_value RemoveSlot(napi_env env, napi_callback_info info) } } // namespace NotificationNapi -} // namespace OHOS \ No newline at end of file +} // namespace OHOS -- Gitee