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:
Gongyuhang
2022-03-11 10:59:59 +08:00
parent 00711c40f4
commit 3f01c0c794
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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++) {