Skip to content
Snippets Groups Projects
Commit 6e330961 authored by Thierry Escande's avatar Thierry Escande
Browse files

prebuilts: Use NAPI_CALL_BOOL() in //base/miscservices/pasteboard


This commit adds a patch that replaces calls to NAPI_CALL() with
NAPI_CALL_BOOL() on function returning a boolean. It applies on
//base/miscservices/pasteboard for OpenHarmony 3.1.1 code base. Even
though this pasteboard repository is not used by openharmony-standard
builds, the patch is needed for bundle and toolchain test jobs.

Signed-off-by: default avatarThierry Escande <thierry.escande@huawei.com>
parent 567c04e6
No related branches found
No related tags found
1 merge request!35A bit of cleanup and comments
......@@ -3,6 +3,7 @@
# SPDX-License-Identifier: Apache-2.0
SRC_URI += "file://patches/ace_napi.patch;apply=no;subdir=src"
SRC_URI += "file://patches/base_miscservices_pasteboard.patch;apply=no;subdir=src"
SRC_URI += "file://patches/base_notification_ans_standard.patch;apply=no;subdir=src"
SRC_URI += "file://patches/base_update_updater.patch;apply=no;subdir=src"
SRC_URI += "file://patches/base_usb_usb_manager.patch;apply=no;subdir=src"
......
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
Patch for //base/miscservices/pasteboard git repository of OpenHarmony 3.1 codebase.
This replaces NAPI_CALL() calls with NAPI_CALL_BOOL() in functions
returning a boolean.
Signed-off-by: Thierry Escande <thierry.escande@huawei.com>
Upstream-Status: Inappropriate
diff --git a/base/miscservices/pasteboard/interfaces/kits/napi/src/napi_pastedata_record.cpp b/base/miscservices/pasteboard/interfaces/kits/napi/src/napi_pastedata_record.cpp
index 2658349..f94f446 100644
--- a/base/miscservices/pasteboard/interfaces/kits/napi/src/napi_pastedata_record.cpp
+++ b/base/miscservices/pasteboard/interfaces/kits/napi/src/napi_pastedata_record.cpp
@@ -37,7 +37,7 @@ PasteDataRecordNapi::~PasteDataRecordNapi()
bool PasteDataRecordNapi::NewInstanceByRecord(
napi_env env, napi_value &instance, const std::shared_ptr<MiscServices::PasteDataRecord> &record)
{
- NAPI_CALL(env, PasteDataRecordNapi::NewInstance(env, instance));
+ NAPI_CALL_BOOL(env, PasteDataRecordNapi::NewInstance(env, instance));
PasteDataRecordNapi *obj = nullptr;
napi_status status = napi_unwrap(env, instance, reinterpret_cast<void **>(&obj));
if ((status != napi_ok) || (obj == nullptr)) {
@@ -50,7 +50,7 @@ bool PasteDataRecordNapi::NewInstanceByRecord(
bool PasteDataRecordNapi::NewHtmlTextRecordInstance(napi_env env, const std::string &text, napi_value &instance)
{
- NAPI_CALL(env, PasteDataRecordNapi::NewInstance(env, instance));
+ NAPI_CALL_BOOL(env, PasteDataRecordNapi::NewInstance(env, instance));
PasteDataRecordNapi *obj = nullptr;
napi_status status = napi_unwrap(env, instance, reinterpret_cast<void **>(&obj));
if ((status != napi_ok) || (obj == nullptr)) {
@@ -63,7 +63,7 @@ bool PasteDataRecordNapi::NewHtmlTextRecordInstance(napi_env env, const std::str
bool PasteDataRecordNapi::NewPlainTextRecordInstance(napi_env env, const std::string &text, napi_value &instance)
{
- NAPI_CALL(env, PasteDataRecordNapi::NewInstance(env, instance));
+ NAPI_CALL_BOOL(env, PasteDataRecordNapi::NewInstance(env, instance));
PasteDataRecordNapi *obj = nullptr;
napi_status status = napi_unwrap(env, instance, reinterpret_cast<void **>(&obj));
if ((status != napi_ok) || (obj == nullptr)) {
@@ -76,7 +76,7 @@ bool PasteDataRecordNapi::NewPlainTextRecordInstance(napi_env env, const std::st
bool PasteDataRecordNapi::NewUriRecordInstance(napi_env env, const std::string &text, napi_value &instance)
{
- NAPI_CALL(env, PasteDataRecordNapi::NewInstance(env, instance));
+ NAPI_CALL_BOOL(env, PasteDataRecordNapi::NewInstance(env, instance));
PasteDataRecordNapi *obj = nullptr;
napi_status status = napi_unwrap(env, instance, reinterpret_cast<void **>(&obj));
if ((status != napi_ok) || (obj == nullptr)) {
@@ -94,7 +94,7 @@ bool PasteDataRecordNapi::NewWantRecordInstance(
return false;
}
- NAPI_CALL(env, PasteDataRecordNapi::NewInstance(env, instance));
+ NAPI_CALL_BOOL(env, PasteDataRecordNapi::NewInstance(env, instance));
PasteDataRecordNapi *obj = nullptr;
napi_status status = napi_unwrap(env, instance, reinterpret_cast<void **>(&obj));
if ((status != napi_ok) || (obj == nullptr)) {
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment