C >> C++ typecasting
This commit is contained in:
parent
e9dd2b7ae5
commit
2e3e188026
@ -150,7 +150,7 @@ public:
|
|||||||
inline bool HashAsUTF8(const wxString &str)
|
inline bool HashAsUTF8(const wxString &str)
|
||||||
{
|
{
|
||||||
const wxScopedCharBuffer buf(str.ToUTF8());
|
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"));
|
wxFFile file(fileName, wxT("rb"));
|
||||||
if (file.IsOpened()) {
|
if (file.IsOpened()) {
|
||||||
wxMemoryBuffer buf(4*1024);
|
wxMemoryBuffer buf(4*1024);
|
||||||
char *data = (char*)buf.GetData();
|
void *data = buf.GetData();
|
||||||
size_t nBlock = buf.GetBufSize();
|
size_t nBlock = buf.GetBufSize();
|
||||||
while (!file.Eof())
|
while (!file.Eof())
|
||||||
Hash(data, file.Read(data, nBlock));
|
Hash(data, file.Read(data, nBlock));
|
||||||
|
@ -135,7 +135,7 @@ inline wxString wxURLEncode(const wxString& str)
|
|||||||
///
|
///
|
||||||
inline wxString wxURLEncode(const wxMemoryBuffer& buf)
|
inline wxString wxURLEncode(const wxMemoryBuffer& buf)
|
||||||
{
|
{
|
||||||
return wxURLEncode((const char*)buf.GetData(), buf.GetDataLen());
|
return wxURLEncode(reinterpret_cast<const char*>(buf.GetData()), buf.GetDataLen());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ wxMemoryBuffer WXEXTEND_API wxURLDecode(const char *src, size_t srcLen)
|
|||||||
srcLen = strlen(src);
|
srcLen = strlen(src);
|
||||||
|
|
||||||
size_t len = wxURLDecodedSize(srcLen);
|
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 )
|
if ( len == wxCONV_FAILED )
|
||||||
len = 0;
|
len = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user