diff options
author | Brad King <brad.king@kitware.com> | 2021-10-27 15:21:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-10-27 15:21:46 (GMT) |
commit | 848eeba483bef0cfeeef78ae77dc3c9a7327b8ea (patch) | |
tree | 3f8066f2905e9c1deb97f3f48db165edf8017289 /Source/kwsys/testEncoding.cxx | |
parent | a956be484783a991dbda3b14f676538d5f0b17bd (diff) | |
parent | 6015a898d463fc321187ae346155654d55393a4c (diff) | |
download | CMake-848eeba483bef0cfeeef78ae77dc3c9a7327b8ea.zip CMake-848eeba483bef0cfeeef78ae77dc3c9a7327b8ea.tar.gz CMake-848eeba483bef0cfeeef78ae77dc3c9a7327b8ea.tar.bz2 |
Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
KWSys 2021-10-27 (e19a5668)
Diffstat (limited to 'Source/kwsys/testEncoding.cxx')
-rw-r--r-- | Source/kwsys/testEncoding.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/kwsys/testEncoding.cxx b/Source/kwsys/testEncoding.cxx index ee93e8d..1d605cb 100644 --- a/Source/kwsys/testEncoding.cxx +++ b/Source/kwsys/testEncoding.cxx @@ -80,7 +80,7 @@ static int testRobustEncoding() std::ios::fmtflags const& flags = std::cout.flags(); int ret = 0; - char cstr[] = { (char)-1, 0 }; + char cstr[] = { static_cast<char>(-1), 0 }; // this conversion could fail std::wstring wstr = kwsys::Encoding::ToWide(cstr); @@ -89,7 +89,7 @@ static int testRobustEncoding() const wchar_t* wcstr = wstr.c_str(); std::cout << "ToWide(NULL) returned"; for (size_t i = 0; i < wstr.size(); i++) { - std::cout << " " << std::hex << (int)wcstr[i]; + std::cout << " " << std::hex << static_cast<int>(wcstr[i]); } std::cout << std::endl; ret++; @@ -99,7 +99,7 @@ static int testRobustEncoding() const wchar_t* wcstr = wstr.c_str(); std::cout << "ToWide(\"\") returned"; for (size_t i = 0; i < wstr.size(); i++) { - std::cout << " " << std::hex << (int)wcstr[i]; + std::cout << " " << std::hex << static_cast<int>(wcstr[i]); } std::cout << std::endl; ret++; @@ -160,7 +160,9 @@ static int testCommandLineArguments() { int status = 0; - char const* argv[2] = { "./app.exe", (char const*)helloWorldStrings[1] }; + char const* argv[2] = { + "./app.exe", reinterpret_cast<char const*>(helloWorldStrings[1]) + }; kwsys::Encoding::CommandLineArguments args(2, argv); kwsys::Encoding::CommandLineArguments arg2 = |