diff options
author | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-11-23 22:02:44 +0000 |
---|---|---|
committer | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2016-11-23 22:02:44 +0000 |
commit | bbdf9b7d2b9eddf451b8f5991b00bb47c93f172c (patch) | |
tree | df27024d1589d354a2a83b5c5a94815a50e0c988 /libcxx/test/std/localization | |
parent | 562f28a6edae6f0ed3afac804619278c51811a1d (diff) | |
download | bcm5719-llvm-bbdf9b7d2b9eddf451b8f5991b00bb47c93f172c.tar.gz bcm5719-llvm-bbdf9b7d2b9eddf451b8f5991b00bb47c93f172c.zip |
[libcxx] [test] D27019: Fix MSVC warning C4245 "conversion from 'X' to 'Y', signed/unsigned mismatch", part 6/12.
Add static_cast when initializing unsigned integers with negative numbers (in order to obtain big values).
llvm-svn: 287826
Diffstat (limited to 'libcxx/test/std/localization')
6 files changed, 14 insertions, 14 deletions
diff --git a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long.pass.cpp b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long.pass.cpp index a4f9e9e089e..cfa6382a49b 100644 --- a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long.pass.cpp @@ -61,7 +61,7 @@ int main() } { std::ios ios(0); - unsigned long v = -1; + unsigned long v = static_cast<unsigned long>(-1); char str[50]; output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v); std::string ex(str, iter.base()); @@ -69,7 +69,7 @@ int main() } { std::ios ios(0); - unsigned long v = -1000; + unsigned long v = static_cast<unsigned long>(-1000); char str[50]; output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v); std::string ex(str, iter.base()); @@ -307,7 +307,7 @@ int main() { std::ios ios(0); ios.imbue(std::locale(std::locale::classic(), new my_numpunct)); - unsigned long v = -1000; + unsigned long v = static_cast<unsigned long>(-1000); right(ios); showpos(ios); ios.width(10); @@ -321,7 +321,7 @@ int main() { std::ios ios(0); ios.imbue(std::locale(std::locale::classic(), new my_numpunct)); - unsigned long v = -1000; + unsigned long v = static_cast<unsigned long>(-1000); left(ios); ios.width(10); char str[50]; @@ -334,7 +334,7 @@ int main() { std::ios ios(0); ios.imbue(std::locale(std::locale::classic(), new my_numpunct)); - unsigned long v = -1000; + unsigned long v = static_cast<unsigned long>(-1000); internal(ios); ios.width(10); char str[50]; diff --git a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long_long.pass.cpp b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long_long.pass.cpp index debbd5e0ee6..6700564cfe5 100644 --- a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long_long.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_unsigned_long_long.pass.cpp @@ -61,7 +61,7 @@ int main() } { std::ios ios(0); - unsigned long long v = -1; + unsigned long long v = static_cast<unsigned long long>(-1); char str[50]; output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v); std::string ex(str, iter.base()); @@ -69,7 +69,7 @@ int main() } { std::ios ios(0); - unsigned long long v = -1000; + unsigned long long v = static_cast<unsigned long long>(-1000); char str[50]; output_iterator<char*> iter = f.put(output_iterator<char*>(str), ios, '*', v); std::string ex(str, iter.base()); @@ -307,7 +307,7 @@ int main() { std::ios ios(0); ios.imbue(std::locale(std::locale::classic(), new my_numpunct)); - unsigned long long v = -1000; + unsigned long long v = static_cast<unsigned long long>(-1000); right(ios); showpos(ios); ios.width(10); @@ -320,7 +320,7 @@ int main() { std::ios ios(0); ios.imbue(std::locale(std::locale::classic(), new my_numpunct)); - unsigned long long v = -1000; + unsigned long long v = static_cast<unsigned long long>(-1000); left(ios); ios.width(10); char str[50]; @@ -332,7 +332,7 @@ int main() { std::ios ios(0); ios.imbue(std::locale(std::locale::classic(), new my_numpunct)); - unsigned long long v = -1000; + unsigned long long v = static_cast<unsigned long long>(-1000); internal(ios); ios.width(10); char str[50]; diff --git a/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_int.pass.cpp b/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_int.pass.cpp index 2d10569796c..0665bf2ac1c 100644 --- a/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_int.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_int.pass.cpp @@ -45,7 +45,7 @@ int main() { const my_facet f(1); std::ios ios(0); - unsigned int v = -1; + unsigned int v = static_cast<unsigned int>(-1); { const char str[] = "0"; std::ios_base::iostate err = ios.goodbit; diff --git a/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long.pass.cpp b/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long.pass.cpp index 50f0ff5ee5d..03fa3d77785 100644 --- a/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long.pass.cpp @@ -45,7 +45,7 @@ int main() { const my_facet f(1); std::ios ios(0); - unsigned long v = -1; + unsigned long v = static_cast<unsigned long>(-1); { const char str[] = "0"; std::ios_base::iostate err = ios.goodbit; diff --git a/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long_long.pass.cpp b/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long_long.pass.cpp index 31fbb2a2c81..dcf4bf1990b 100644 --- a/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long_long.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_long_long.pass.cpp @@ -45,7 +45,7 @@ int main() { const my_facet f(1); std::ios ios(0); - unsigned long long v = -1; + unsigned long long v = static_cast<unsigned long long>(-1); { const char str[] = "0"; std::ios_base::iostate err = ios.goodbit; diff --git a/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_short.pass.cpp b/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_short.pass.cpp index 822b83e0ff9..283c8e63db4 100644 --- a/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_short.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_unsigned_short.pass.cpp @@ -45,7 +45,7 @@ int main() { const my_facet f(1); std::ios ios(0); - unsigned short v = -1; + unsigned short v = static_cast<unsigned short>(-1); { const char str[] = "0"; std::ios_base::iostate err = ios.goodbit; |