diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2017-08-23 07:41:23 (GMT) |
---|---|---|
committer | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2017-08-27 07:58:46 (GMT) |
commit | 190e3825d44d4f846d37e1ec7372f5829a5b6b3e (patch) | |
tree | 85605643bc6fcdcb455d5fe58469a08874ef8673 /Source/cmListCommand.cxx | |
parent | 2ade9a0264b7c8d4e97d9d820e8c1531f3d1a43c (diff) | |
download | CMake-190e3825d44d4f846d37e1ec7372f5829a5b6b3e.zip CMake-190e3825d44d4f846d37e1ec7372f5829a5b6b3e.tar.gz CMake-190e3825d44d4f846d37e1ec7372f5829a5b6b3e.tar.bz2 |
Replace C-style casts
Diffstat (limited to 'Source/cmListCommand.cxx')
-rw-r--r-- | Source/cmListCommand.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 0542c4f..ae4f0a8 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -182,9 +182,9 @@ bool cmListCommand::HandleGetCommand(std::vector<std::string> const& args) value += sep; sep = ";"; if (item < 0) { - item = (int)nitem + item; + item = static_cast<int>(nitem) + item; } - if (item < 0 || nitem <= (size_t)item) { + if (item < 0 || nitem <= static_cast<size_t>(item)) { std::ostringstream str; str << "index: " << item << " out of range (-" << nitem << ", " << nitem - 1 << ")"; @@ -273,9 +273,9 @@ bool cmListCommand::HandleInsertCommand(std::vector<std::string> const& args) if (!varArgsExpanded.empty()) { size_t nitem = varArgsExpanded.size(); if (item < 0) { - item = (int)nitem + item; + item = static_cast<int>(nitem) + item; } - if (item < 0 || nitem <= (size_t)item) { + if (item < 0 || nitem <= static_cast<size_t>(item)) { std::ostringstream str; str << "index: " << item << " out of range (-" << varArgsExpanded.size() << ", " @@ -423,9 +423,9 @@ bool cmListCommand::HandleRemoveAtCommand(std::vector<std::string> const& args) for (cc = 2; cc < args.size(); ++cc) { int item = atoi(args[cc].c_str()); if (item < 0) { - item = (int)nitem + item; + item = static_cast<int>(nitem) + item; } - if (item < 0 || nitem <= (size_t)item) { + if (item < 0 || nitem <= static_cast<size_t>(item)) { std::ostringstream str; str << "index: " << item << " out of range (-" << nitem << ", " << nitem - 1 << ")"; |