summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-07 17:57:08 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-07 17:57:08 +0300
commit4125ac707288a244a7175b755d74dd963e762f56 (patch)
treed5e431c8fd0cde1d1ff6cb5992f8591c1c13b8e2 /src/utils
parentb43451daa5dc7b2e352d084d45934cf71db7ae4f (diff)
downloadmanaplus-4125ac707288a244a7175b755d74dd963e762f56.tar.gz
manaplus-4125ac707288a244a7175b755d74dd963e762f56.tar.bz2
manaplus-4125ac707288a244a7175b755d74dd963e762f56.tar.xz
manaplus-4125ac707288a244a7175b755d74dd963e762f56.zip
Remove depricated casts.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/copynpaste.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/utils/copynpaste.cpp b/src/utils/copynpaste.cpp
index 9506332d0..16c9f8958 100644
--- a/src/utils/copynpaste.cpp
+++ b/src/utils/copynpaste.cpp
@@ -77,7 +77,7 @@ bool retrieveBuffer(std::string& text, size_t& pos)
HANDLE h = GetClipboardData(CF_UNICODETEXT);
if (h)
{
- LPCWSTR data = (LPCWSTR)GlobalLock(h);
+ LPCWSTR data = static_cast<LPCWSTR>(GlobalLock(h));
if (data)
{
@@ -88,9 +88,9 @@ bool retrieveBuffer(std::string& text, size_t& pos)
// Convert from UTF-16 to UTF-8
void *temp = calloc(len, 1);
if (WideCharToMultiByte(CP_UTF8, 0, data, -1,
- (LPSTR)temp, len, nullptr, nullptr))
+ static_cast<LPSTR>(temp), len, nullptr, nullptr))
{
- text.insert(pos, (char*)temp);
+ text.insert(pos, static_cast<char*>(temp));
pos += len-1;
}
free(temp);
@@ -105,7 +105,7 @@ bool retrieveBuffer(std::string& text, size_t& pos)
if (h)
{
- const char *const data = (char*)GlobalLock(h);
+ const char *const data = static_cast<char*>(GlobalLock(h));
if (data)
{
text.insert(pos, data);
@@ -129,7 +129,7 @@ bool sendBuffer(std::string& text)
HANDLE h = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE,
wCharsLen * sizeof(WCHAR));
- WCHAR *const out = (WCHAR*)GlobalLock(h);
+ WCHAR *const out = static_cast<WCHAR*>(GlobalLock(h));
MultiByteToWideChar(CP_UTF8, 0, text.c_str(), -1, out, wCharsLen);