diff --git a/runtime/js_date_time_format.cpp b/runtime/js_date_time_format.cpp index 425243b65c0ef025fb1fb22f4fc5097f1f8236d6..08b1335df82249ed070a20a4c838ea5fea57f42a 100644 --- a/runtime/js_date_time_format.cpp +++ b/runtime/js_date_time_format.cpp @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -824,8 +824,8 @@ void JSDateTimeFormat::ResolvedOptions(JSThread *thread, const JSHandle(canonicalTimezone == UNICODE_STRING_SIMPLE("Etc/UTC")) != 0 || + static_cast(canonicalTimezone == UNICODE_STRING_SIMPLE("Etc/GMT")) != 0) { timezoneValue.Update(globalConst->GetUTCString()); } else { timezoneValue.Update(JSLocale::IcuToString(thread, canonicalTimezone).GetTaggedValue()); diff --git a/runtime/js_locale.cpp b/runtime/js_locale.cpp index 4a9debeb6c510126e645c4b865528d1efccdd5ef..98c6de8d09607509ce3751a2242a464059b39473 100644 --- a/runtime/js_locale.cpp +++ b/runtime/js_locale.cpp @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -113,7 +113,7 @@ bool JSLocale::IsValidTimeZoneName(const icu::TimeZone &tz) tz.getID(id); icu::UnicodeString canonical; icu::TimeZone::getCanonicalID(id, canonical, status); - UBool canonicalFlag = (canonical != icu::UnicodeString("Etc/Unknown", -1, US_INV)); + UBool canonicalFlag = static_cast(canonical != icu::UnicodeString("Etc/Unknown", -1, US_INV)); return (U_SUCCESS(status) != 0) && (canonicalFlag != 0); }