From 4125ac707288a244a7175b755d74dd963e762f56 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 7 May 2014 17:57:08 +0300 Subject: Remove depricated casts. --- src/utils/copynpaste.cpp | 10 +++++----- 1 file 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(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(temp), len, nullptr, nullptr)) { - text.insert(pos, (char*)temp); + text.insert(pos, static_cast(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(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(GlobalLock(h)); MultiByteToWideChar(CP_UTF8, 0, text.c_str(), -1, out, wCharsLen); -- cgit v1.2.3-70-g09d2