summaryrefslogtreecommitdiff
path: root/src/utils/copynpaste.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-08 22:48:01 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-08 22:48:01 +0300
commitcd0de3bd2668294ab3174d3b5f032fefc25fa0e8 (patch)
tree54942df2cad49260ae466c23fc2af4ec64c03dfb /src/utils/copynpaste.cpp
parent454508376039429ad292de69cd491badda798062 (diff)
downloadmanaplus-cd0de3bd2668294ab3174d3b5f032fefc25fa0e8.tar.gz
manaplus-cd0de3bd2668294ab3174d3b5f032fefc25fa0e8.tar.bz2
manaplus-cd0de3bd2668294ab3174d3b5f032fefc25fa0e8.tar.xz
manaplus-cd0de3bd2668294ab3174d3b5f032fefc25fa0e8.zip
Fix code style in utils.
Diffstat (limited to 'src/utils/copynpaste.cpp')
-rw-r--r--src/utils/copynpaste.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/copynpaste.cpp b/src/utils/copynpaste.cpp
index 16c9f8958..e4f109d5a 100644
--- a/src/utils/copynpaste.cpp
+++ b/src/utils/copynpaste.cpp
@@ -81,7 +81,7 @@ bool retrieveBuffer(std::string& text, size_t& pos)
if (data)
{
- const int len = WideCharToMultiByte(CP_UTF8, 0, data, -1,
+ const size_t len = WideCharToMultiByte(CP_UTF8, 0, data, -1,
nullptr, 0, nullptr, nullptr);
if (len > 0)
{
@@ -91,7 +91,7 @@ bool retrieveBuffer(std::string& text, size_t& pos)
static_cast<LPSTR>(temp), len, nullptr, nullptr))
{
text.insert(pos, static_cast<char*>(temp));
- pos += len-1;
+ pos += len - 1;
}
free(temp);
ret = true;
@@ -128,7 +128,7 @@ bool sendBuffer(std::string& text)
return false;
HANDLE h = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE,
- wCharsLen * sizeof(WCHAR));
+ static_cast<size_t>(wCharsLen) * sizeof(WCHAR));
WCHAR *const out = static_cast<WCHAR*>(GlobalLock(h));
MultiByteToWideChar(CP_UTF8, 0, text.c_str(), -1, out, wCharsLen);