C >> C++ typecasting

This commit is contained in:
Simon Rozman 2016-10-03 10:41:40 +02:00
parent e9dd2b7ae5
commit 2e3e188026
3 changed files with 4 additions and 4 deletions

View File

@ -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));

View File

@ -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<const char*>(buf.GetData()), buf.GetDataLen());
}

View File

@ -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<char*>(buf.GetWriteBuf(len)), len, src, srcLen);
if ( len == wxCONV_FAILED )
len = 0;