mirror of
https://github.com/openharmony/ace_napi.git
synced 2026-07-21 16:55:22 -04:00
The type of the left variable does not match the type of the right
variable. Refer the context around the expression to decide either to change the type of the left variable or use "static_cast<>()" to get the value of compatible type from the right varible. Signed-off-by: Gongyuhang <gongyuhang5@huawei.com>
This commit is contained in:
@@ -601,7 +601,7 @@ ExceptionInfo* ArkNativeEngine::GetExceptionForWorker() const
|
||||
}
|
||||
|
||||
ExceptionInfo* exceptionInfo = new ExceptionInfo();
|
||||
int msgLength = exceptionStr_.length();
|
||||
size_t msgLength = exceptionStr_.length();
|
||||
char* exceptionMessage = new char[msgLength + 1] { 0 };
|
||||
if (memcpy_s(exceptionMessage, msgLength + 1, exceptionStr_.c_str(), msgLength) != EOK) {
|
||||
HILOG_ERROR("worker:: memcpy_s error");
|
||||
|
||||
@@ -136,7 +136,7 @@ Local<JSValueRef> ArkNativeFunction::NativeFunctionCallBack(EcmaVM* vm,
|
||||
NativeScope* nativeScope = scopeManager->Open();
|
||||
cbInfo.thisVar = ArkNativeEngine::ArkValueToNativeValue(engine, thisObj);
|
||||
cbInfo.function = nullptr;
|
||||
cbInfo.argc = length;
|
||||
cbInfo.argc = static_cast<size_t>(length);
|
||||
cbInfo.argv = nullptr;
|
||||
cbInfo.functionInfo = info;
|
||||
if (cbInfo.argc > 0) {
|
||||
@@ -197,7 +197,7 @@ Local<JSValueRef> ArkNativeFunction::NativeClassFunctionCallBack(EcmaVM* vm,
|
||||
NativeScope* nativeScope = scopeManager->Open();
|
||||
cbInfo.thisVar = ArkNativeEngine::ArkValueToNativeValue(engine, function);
|
||||
cbInfo.function = ArkNativeEngine::ArkValueToNativeValue(engine, newTarget);
|
||||
cbInfo.argc = length;
|
||||
cbInfo.argc = static_cast<size_t>(length);
|
||||
cbInfo.argv = nullptr;
|
||||
cbInfo.functionInfo = info;
|
||||
if (cbInfo.argc > 0) {
|
||||
|
||||
@@ -78,7 +78,7 @@ size_t ArkNativeString::EncodeWriteUtf8(char* buffer, size_t bufferSize, int32_t
|
||||
int32_t length = val->Length();
|
||||
|
||||
int32_t pos = 0;
|
||||
int32_t writableSize = bufferSize;
|
||||
int32_t writableSize = static_cast<int32_t>(bufferSize);
|
||||
int32_t i = 0;
|
||||
Local<ObjectRef> strObj = Local<ObjectRef>(val.ToLocal(vm));
|
||||
for (; i < length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user