diff options
author | KWSys Upstream <kwrobot@kitware.com> | 2021-10-27 13:30:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-10-27 15:21:46 (GMT) |
commit | 6015a898d463fc321187ae346155654d55393a4c (patch) | |
tree | 9413fdd221c42da73a35f6cf6c4945b67b13a18c /testEncoding.cxx | |
parent | 58f046ba26d67c6e1ceda2a20977e316f1a942ad (diff) | |
download | CMake-6015a898d463fc321187ae346155654d55393a4c.zip CMake-6015a898d463fc321187ae346155654d55393a4c.tar.gz CMake-6015a898d463fc321187ae346155654d55393a4c.tar.bz2 |
KWSys 2021-10-27 (e19a5668)
Code extracted from:
https://gitlab.kitware.com/utils/kwsys.git
at commit e19a5668f01bb9d96440ce96e777749d6e92562d (e19a5668f01bb9d96440ce96e777749d6e92562d).
Upstream Shortlog
-----------------
Mathieu Westphal (1):
e28d7282 DynamicLoader: Add RTLD_GLOBAL as a supported flag on linux
Sean McBride (8):
704a63d4 Replace sprintf with snprintf
f9f6d67b Replace non-standard _snprintf with standard snprintf
f771c009 Fix -Wunused-macros warning by defining under same conditions as usage
f3d4b12b Fix Wmissing-prototypes warnings by making functions static
6f4a1826 Fix Wmissing-variable-declarations by declaring variable in a header
31d25023 Fix all Wold-style-cast warnings
0f44b620 Fix Wreserved-id-macro warning by removing double underscore
44718539 Fix for extraneous semi-colon warning
Diffstat (limited to 'testEncoding.cxx')
-rw-r--r-- | testEncoding.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/testEncoding.cxx b/testEncoding.cxx index ee93e8d..1d605cb 100644 --- a/testEncoding.cxx +++ b/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 = |