Commit 50f1d6c9 authored by Florian Sattler's avatar Florian Sattler Committed by Commit Bot

[cleanup] Replace old c-style casts with c++ casts.

Fixing clang-tidy warning.

Bug: v8:8015
Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I3a09bb6936853bca448f425d4266365deb6671d4
Reviewed-on: https://chromium-review.googlesource.com/1220146Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Commit-Queue: Florian Sattler <sattlerf@google.com>
Cr-Commit-Position: refs/heads/master@{#55871}
parent fb7f6ab9
......@@ -1210,9 +1210,9 @@ double atan(double x) {
if (ix > 0x7FF00000 || (ix == 0x7FF00000 && (low != 0)))
return x + x; /* NaN */
if (hx > 0)
return atanhi[3] + *(volatile double *)&atanlo[3];
return atanhi[3] + *const_cast<volatile double*>(&atanlo[3]);
else
return -atanhi[3] - *(volatile double *)&atanlo[3];
return -atanhi[3] - *const_cast<volatile double*>(&atanlo[3]);
}
if (ix < 0x3FDC0000) { /* |x| < 0.4375 */
if (ix < 0x3E400000) { /* |x| < 2^-27 */
......
......@@ -86,7 +86,7 @@ namespace base {
namespace {
// 0 is never a valid thread id.
const pthread_t kNoThread = (pthread_t) 0;
const pthread_t kNoThread = static_cast<pthread_t>(0);
bool g_hard_abort = false;
......
......@@ -116,13 +116,13 @@ ConversionResult convertUTF16ToUTF8(const UChar** sourceStart,
}
}
// Figure out how many bytes the result will require
if (ch < (UChar32)0x80) {
if (ch < static_cast<UChar32>(0x80)) {
bytesToWrite = 1;
} else if (ch < (UChar32)0x800) {
} else if (ch < static_cast<UChar32>(0x800)) {
bytesToWrite = 2;
} else if (ch < (UChar32)0x10000) {
} else if (ch < static_cast<UChar32>(0x10000)) {
bytesToWrite = 3;
} else if (ch < (UChar32)0x110000) {
} else if (ch < static_cast<UChar32>(0x110000)) {
bytesToWrite = 4;
} else {
bytesToWrite = 3;
......
......@@ -81,7 +81,7 @@ String16 calculateHash(v8::Isolate* isolate, v8::Local<v8::String> source) {
String16Builder hash;
for (size_t i = 0; i < hashesSize; ++i)
hash.appendUnsignedAsHex((uint32_t)hashes[i]);
hash.appendUnsignedAsHex(static_cast<uint32_t>(hashes[i]));
return hash.toString();
}
......
......@@ -14682,7 +14682,7 @@ const char* Code::Kind2String(Kind kind) {
// Identify kind of code.
const char* AbstractCode::Kind2String(Kind kind) {
if (kind < AbstractCode::INTERPRETED_FUNCTION)
return Code::Kind2String((Code::Kind)kind);
return Code::Kind2String(static_cast<Code::Kind>(kind));
if (kind == AbstractCode::INTERPRETED_FUNCTION) return "INTERPRETED_FUNCTION";
UNREACHABLE();
}
......
......@@ -1068,7 +1068,7 @@ TEST(AssemblerX64FMA_sd) {
// - xmm0 * xmm1 + xmm2
__ movaps(xmm3, xmm0);
__ mulsd(xmm3, xmm1);
__ Move(xmm4, (uint64_t)1 << 63);
__ Move(xmm4, static_cast<uint64_t>(1) << 63);
__ xorpd(xmm3, xmm4);
__ addsd(xmm3, xmm2); // Expected result in xmm3
......@@ -1117,7 +1117,7 @@ TEST(AssemblerX64FMA_sd) {
// - xmm0 * xmm1 - xmm2
__ movaps(xmm3, xmm0);
__ mulsd(xmm3, xmm1);
__ Move(xmm4, (uint64_t)1 << 63);
__ Move(xmm4, static_cast<uint64_t>(1) << 63);
__ xorpd(xmm3, xmm4);
__ subsd(xmm3, xmm2); // Expected result in xmm3
......@@ -1294,7 +1294,7 @@ TEST(AssemblerX64FMA_ss) {
// - xmm0 * xmm1 + xmm2
__ movaps(xmm3, xmm0);
__ mulss(xmm3, xmm1);
__ Move(xmm4, (uint32_t)1 << 31);
__ Move(xmm4, static_cast<uint32_t>(1) << 31);
__ xorps(xmm3, xmm4);
__ addss(xmm3, xmm2); // Expected result in xmm3
......@@ -1343,7 +1343,7 @@ TEST(AssemblerX64FMA_ss) {
// - xmm0 * xmm1 - xmm2
__ movaps(xmm3, xmm0);
__ mulss(xmm3, xmm1);
__ Move(xmm4, (uint32_t)1 << 31);
__ Move(xmm4, static_cast<uint32_t>(1) << 31);
__ xorps(xmm3, xmm4);
__ subss(xmm3, xmm2); // Expected result in xmm3
......
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