Commit f3646333 authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[clang-tidy] Prefer static_cast to c style casts

See
https://clang.llvm.org/extra/clang-tidy/checks/google-readability-casting.html
and https://google.github.io/styleguide/cppguide.html#Casting.

Change-Id: Ib5a3bb8873bc6d050c4d0abe36a3ae813bbd448a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2233987Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68301}
parent ab84c502
...@@ -775,7 +775,7 @@ static int GetCaseIndependentLetters(Isolate* isolate, uc16 character, ...@@ -775,7 +775,7 @@ static int GetCaseIndependentLetters(Isolate* isolate, uc16 character,
if (in_special_add_set && RegExpCaseFolding::Canonicalize(cu) != canon) { if (in_special_add_set && RegExpCaseFolding::Canonicalize(cu) != canon) {
continue; continue;
} }
letters[items++] = (unibrow::uchar)(cu); letters[items++] = static_cast<unibrow::uchar>(cu);
} }
} }
DCHECK(ContainsOnlyUtf16CodeUnits(letters, items)); DCHECK(ContainsOnlyUtf16CodeUnits(letters, items));
......
...@@ -67,7 +67,7 @@ int RegExpMacroAssembler::CaseInsensitiveCompareUnicode(Address byte_offset1, ...@@ -67,7 +67,7 @@ int RegExpMacroAssembler::CaseInsensitiveCompareUnicode(Address byte_offset1,
DCHECK_EQ(0, byte_length % 2); DCHECK_EQ(0, byte_length % 2);
#ifdef V8_INTL_SUPPORT #ifdef V8_INTL_SUPPORT
int32_t length = (int32_t)(byte_length >> 1); int32_t length = static_cast<int32_t>(byte_length >> 1);
icu::UnicodeString uni_str_1(reinterpret_cast<const char16_t*>(byte_offset1), icu::UnicodeString uni_str_1(reinterpret_cast<const char16_t*>(byte_offset1),
length); length);
return uni_str_1.caseCompare(reinterpret_cast<const char16_t*>(byte_offset2), return uni_str_1.caseCompare(reinterpret_cast<const char16_t*>(byte_offset2),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment