From 2e3e188026b7e6845e9e2b5552faf7589d25cbfc Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 3 Oct 2016 10:41:40 +0200 Subject: [PATCH] C >> C++ typecasting --- include/wxex/crypto.h | 4 ++-- include/wxex/url.h | 2 +- src/url.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/wxex/crypto.h b/include/wxex/crypto.h index cf8b6cf..a272b15 100644 --- a/include/wxex/crypto.h +++ b/include/wxex/crypto.h @@ -150,7 +150,7 @@ public: inline bool HashAsUTF8(const wxString &str) { const wxScopedCharBuffer buf(str.ToUTF8()); - return Hash((const char*)buf.data(), buf.length()); + return Hash(buf.data(), buf.length()); } @@ -168,7 +168,7 @@ public: wxFFile file(fileName, wxT("rb")); if (file.IsOpened()) { wxMemoryBuffer buf(4*1024); - char *data = (char*)buf.GetData(); + void *data = buf.GetData(); size_t nBlock = buf.GetBufSize(); while (!file.Eof()) Hash(data, file.Read(data, nBlock)); diff --git a/include/wxex/url.h b/include/wxex/url.h index 9aedc1a..699e360 100644 --- a/include/wxex/url.h +++ b/include/wxex/url.h @@ -135,7 +135,7 @@ inline wxString wxURLEncode(const wxString& str) /// inline wxString wxURLEncode(const wxMemoryBuffer& buf) { - return wxURLEncode((const char*)buf.GetData(), buf.GetDataLen()); + return wxURLEncode(reinterpret_cast(buf.GetData()), buf.GetDataLen()); } diff --git a/src/url.cpp b/src/url.cpp index a71a230..d1f9baf 100644 --- a/src/url.cpp +++ b/src/url.cpp @@ -124,7 +124,7 @@ wxMemoryBuffer WXEXTEND_API wxURLDecode(const char *src, size_t srcLen) srcLen = strlen(src); size_t len = wxURLDecodedSize(srcLen); - len = wxURLDecode((char*)buf.GetWriteBuf(len), len, src, srcLen); + len = wxURLDecode(reinterpret_cast(buf.GetWriteBuf(len)), len, src, srcLen); if ( len == wxCONV_FAILED ) len = 0;