diff options
author | Brad King <brad.king@kitware.com> | 2017-05-24 14:25:55 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-05-24 14:26:09 (GMT) |
commit | 5e0858cc15d91cb1364f7fcba2cd92519adf0a19 (patch) | |
tree | 831d7921bea1f987d126bab47cbe95ec7df30a49 /Source | |
parent | 56f87f179a026f1955994804b998485ee7910bec (diff) | |
parent | 6f3341591dfbb85f69e224b66bb9f7d4fa7f05cc (diff) | |
download | CMake-5e0858cc15d91cb1364f7fcba2cd92519adf0a19.zip CMake-5e0858cc15d91cb1364f7fcba2cd92519adf0a19.tar.gz CMake-5e0858cc15d91cb1364f7fcba2cd92519adf0a19.tar.bz2 |
Merge topic 'update-kwsys'
6f334159 Merge branch 'upstream-KWSys' into update-kwsys
47a8ff34 KWSys 2017-05-23 (411e958f)
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !882
Diffstat (limited to 'Source')
-rw-r--r-- | Source/kwsys/ConsoleBuf.hxx.in | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/kwsys/ConsoleBuf.hxx.in b/Source/kwsys/ConsoleBuf.hxx.in index 32e680c..46d65a8 100644 --- a/Source/kwsys/ConsoleBuf.hxx.in +++ b/Source/kwsys/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); |