summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKWSys Upstream <kwrobot@kitware.com>2017-05-23 13:50:42 (GMT)
committerBrad King <brad.king@kitware.com>2017-05-23 18:34:23 (GMT)
commit47a8ff3491cf4892eb2b28048b5f987a4ec1187a (patch)
treedb56e03ed9d3494444a3f580005c34e1d0d78c4f
parent7be70ca6cc888df532d2f1560e74d13642730ee5 (diff)
downloadCMake-47a8ff3491cf4892eb2b28048b5f987a4ec1187a.zip
CMake-47a8ff3491cf4892eb2b28048b5f987a4ec1187a.tar.gz
CMake-47a8ff3491cf4892eb2b28048b5f987a4ec1187a.tar.bz2
KWSys 2017-05-23 (411e958f)
Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit 411e958f46246eaf8e044b6d0af542685bca5fcf (master). Upstream Shortlog ----------------- Brad King (1): c23e388b ConsoleBuf: Avoid signed/unsigned comparison
-rw-r--r--ConsoleBuf.hxx.in9
1 files changed, 5 insertions, 4 deletions
diff --git a/ConsoleBuf.hxx.in b/ConsoleBuf.hxx.in
index 32e680c..46d65a8 100644
--- a/ConsoleBuf.hxx.in
+++ b/ConsoleBuf.hxx.in
@@ -338,7 +338,7 @@ private:
}
bool decodeInputBuffer(const std::string buffer, std::wstring& wbuffer)
{
- int length = int(buffer.length());
+ size_t length = buffer.length();
if (length == 0) {
wbuffer = std::wstring();
return true;
@@ -353,11 +353,12 @@ private:
data += BOMsize;
length -= BOMsize;
}
- const int wlength =
- MultiByteToWideChar(actualCodepage, 0, data, length, NULL, 0);
+ const size_t wlength = static_cast<size_t>(MultiByteToWideChar(
+ actualCodepage, 0, data, static_cast<int>(length), NULL, 0));
wchar_t* wbuf = new wchar_t[wlength];
const bool success =
- MultiByteToWideChar(actualCodepage, 0, data, length, wbuf, wlength) > 0
+ MultiByteToWideChar(actualCodepage, 0, data, static_cast<int>(length),
+ wbuf, static_cast<int>(wlength)) > 0
? true
: false;
wbuffer = std::wstring(wbuf, wlength);