[libcxx] r321923 - Add casts to prevent narrowing warnings.
Billy Robert O'Neal III via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 5 18:50:04 PST 2018
Author: bion
Date: Fri Jan 5 18:50:03 2018
New Revision: 321923
URL: http://llvm.org/viewvc/llvm-project?rev=321923&view=rev
Log:
Add casts to prevent narrowing warnings.
Modified:
libcxx/trunk/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp
libcxx/trunk/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
libcxx/trunk/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
Modified: libcxx/trunk/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp?rev=321923&r1=321922&r2=321923&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp Fri Jan 5 18:50:03 2018
@@ -105,7 +105,7 @@ void basic_tests()
std::iota(v.begin(), v.end(), 0);
std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), 30, std::plus<>(), add_ten{});
for (size_t i = 0; i < v.size(); ++i)
- assert(v[i] == 30 + triangle(i - 1) + i * 10);
+ assert(v[i] == 30 + triangle(i - 1) + (int) i * 10);
}
{
@@ -113,7 +113,7 @@ void basic_tests()
std::iota(v.begin(), v.end(), 1);
std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), 40, std::plus<>(), add_ten{});
for (size_t i = 0; i < v.size(); ++i)
- assert(v[i] == 40 + triangle(i) + i * 10);
+ assert(v[i] == 40 + triangle(i) + (int) i * 10);
}
{
Modified: libcxx/trunk/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp?rev=321923&r1=321922&r2=321923&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp Fri Jan 5 18:50:03 2018
@@ -96,7 +96,7 @@ void basic_tests()
std::iota(v.begin(), v.end(), 0);
std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_ten{});
for (size_t i = 0; i < v.size(); ++i)
- assert(v[i] == triangle(i) + (i + 1) * 10);
+ assert(v[i] == triangle(i) + (int)(i + 1) * 10);
}
{
@@ -104,7 +104,7 @@ void basic_tests()
std::iota(v.begin(), v.end(), 1);
std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_ten{});
for (size_t i = 0; i < v.size(); ++i)
- assert(v[i] == triangle(i + 1) + (i + 1) * 10);
+ assert(v[i] == triangle(i + 1) + (int)(i + 1) * 10);
}
{
Modified: libcxx/trunk/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp?rev=321923&r1=321922&r2=321923&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp Fri Jan 5 18:50:03 2018
@@ -105,7 +105,7 @@ void basic_tests()
std::iota(v.begin(), v.end(), 0);
std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_ten{}, 30);
for (size_t i = 0; i < v.size(); ++i)
- assert(v[i] == 30 + triangle(i) + (i + 1) * 10);
+ assert(v[i] == 30 + triangle(i) + (int) (i + 1) * 10);
}
{
@@ -113,7 +113,7 @@ void basic_tests()
std::iota(v.begin(), v.end(), 1);
std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_ten{}, 40);
for (size_t i = 0; i < v.size(); ++i)
- assert(v[i] == 40 + triangle(i + 1) + (i + 1) * 10);
+ assert(v[i] == 40 + triangle(i + 1) + (int) (i + 1) * 10);
}
{
More information about the cfe-commits
mailing list