make wxTmemchr() return (and take) char* instead of void* in ANSI build too

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47876 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-08-04 21:33:42 +00:00
parent 628f9e9596
commit de34bb081b
2 changed files with 21 additions and 24 deletions

View File

@@ -71,10 +71,13 @@ Changes in behaviour which may result in compilation errors
- Virtual wxHtmlParser::AddText() takes wxString, not wxChar*, argument now.
- Funtions that took wxChar* arguments that could by NULL in wxWidgets 2.8.
- Functions that took wxChar* arguments that could by NULL in wxWidgets 2.8.
are deprecated and passing NULL to them won't compile anymore, wxEmptyString
must be used instead.
- wxTmemxxx() functions take either wxChar* or char*, not void*: use memxxx()
with void pointers.
- Removed insecure wxGets() and wxTmpnam() functions.
- Removed global GetLine() function from wx/protocol/protocol.h, use

View File

@@ -72,9 +72,9 @@ WXDLLIMPEXP_BASE bool wxOKlibc(); /* for internal use */
// (including even MSC) inline them just like we do right in their
// headers.
//
#if wxUSE_UNICODE
#include <string.h> //for mem funcs
#include <string.h>
#if wxUSE_UNICODE
//implement our own wmem variants
inline wxChar* wxTmemchr(const wxChar* s, wxChar c, size_t l)
{
@@ -114,28 +114,22 @@ WXDLLIMPEXP_BASE bool wxOKlibc(); /* for internal use */
return szRet;
}
#endif /* wxUSE_UNICODE */
// and trivial wrappers for char* versions:
inline char* wxTmemchr(const char* s, char c, size_t len)
// provide trivial wrappers for char* versions for both ANSI and Unicode builds
// (notice that these intentionally return "char *" and not "void *" unlike the
// standard memxxx() for symmetry with the wide char versions):
inline char* wxTmemchr(const char* s, char c, size_t len)
{ return (char*)memchr(s, c, len); }
inline int wxTmemcmp(const char* sz1, const char* sz2, size_t len)
inline int wxTmemcmp(const char* sz1, const char* sz2, size_t len)
{ return memcmp(sz1, sz2, len); }
inline char* wxTmemcpy(char* szOut, const char* szIn, size_t len)
inline char* wxTmemcpy(char* szOut, const char* szIn, size_t len)
{ return (char*)memcpy(szOut, szIn, len); }
inline char* wxTmemmove(char* szOut, const char* szIn, size_t len)
inline char* wxTmemmove(char* szOut, const char* szIn, size_t len)
{ return (char*)memmove(szOut, szIn, len); }
inline char* wxTmemset(char* szOut, const char cIn, size_t len)
inline char* wxTmemset(char* szOut, const char cIn, size_t len)
{ return (char*)memset(szOut, cIn, len); }
#else /* !wxUSE_UNICODE */
#define wxTmemchr memchr
#define wxTmemcmp memcmp
#define wxTmemcpy memcpy
#define wxTmemmove memmove
#define wxTmemset memset
#endif /* wxUSE_UNICODE/!wxUSE_UNICODE */
// ============================================================================
// wx wrappers for CRT functions in both char* and wchar_t* versions
@@ -160,7 +154,7 @@ WXDLLIMPEXP_BASE bool wxOKlibc(); /* for internal use */
// ----------------------------------------------------------------------------
// NB: we can't provide const wchar_t* (= wxChar*) overload, because calling
// wxSetlocale(category, NULL) -- which is a common thing to do --would be
// wxSetlocale(category, NULL) -- which is a common thing to do -- would be
// ambiguous
WXDLLIMPEXP_BASE char* wxSetlocale(int category, const char *locale);
inline char* wxSetlocale(int category, const wxCharBuffer& locale)