fix warning files

Signed-off-by: hjzhangcm <zhanghaijun20@huawei.com>
This commit is contained in:
hjzhangcm
2022-02-16 10:45:01 +08:00
parent 3b0ffae646
commit 347d8227af
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -311,7 +311,7 @@ JSTaggedValue TypedArrayHelper::CreateFromArrayBuffer(EcmaRuntimeCallInfo *argv,
// a. Let newByteLength be newLength × elementSize.
// b. If offset + newByteLength > bufferByteLength, throw a RangeError exception.
newByteLength = newLength * elementSize;
if (offset + newByteLength > bufferByteLength) {
if (static_cast<uint32_t>(offset + newByteLength) > bufferByteLength) {
THROW_RANGE_ERROR_AND_RETURN(thread, "The newByteLength is out of range.", JSTaggedValue::Exception());
}
}
+2 -2
View File
@@ -359,7 +359,7 @@ void JSHClass::RegisterOnProtoChain(const JSThread *thread, const JSHandle<JSHCl
while (true) {
// Find the prototype chain as far as the hclass has not been registered.
if (userDetails->GetRegisterIndex() != ProtoChangeDetails::UNREGISTERED) {
if (userDetails->GetRegisterIndex() != static_cast<uint32_t>(ProtoChangeDetails::UNREGISTERED)) {
return;
}
@@ -403,7 +403,7 @@ bool JSHClass::UnregisterOnProtoChain(const JSThread *thread, const JSHandle<JSH
}
JSHandle<ProtoChangeDetails> currentDetails = GetProtoChangeDetails(thread, jshclass);
uint32_t index = currentDetails->GetRegisterIndex();
if (index == ProtoChangeDetails::UNREGISTERED) {
if (index == static_cast<uint32_t>(ProtoChangeDetails::UNREGISTERED)) {
return false;
}
JSTaggedValue proto = jshclass->GetPrototype();