From 7a0007346b74ff5b754bc0b2f86aa018e8d7b4a0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 10 Oct 2008 21:20:46 +0000 Subject: [PATCH] STL build compilation fix git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56223 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- utils/ifacecheck/src/xmlparser.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/utils/ifacecheck/src/xmlparser.cpp b/utils/ifacecheck/src/xmlparser.cpp index e0d5803c4c..8ce5cf383a 100644 --- a/utils/ifacecheck/src/xmlparser.cpp +++ b/utils/ifacecheck/src/xmlparser.cpp @@ -659,19 +659,20 @@ typedef std::map wxToResolveTypeHashMap; // utility to parse gccXML ID values; // this function is equivalent to wxString(str).Mid(1).ToULong(&id, GCCXML_BASE) // but is a little bit faster -bool getID(unsigned long *id, const wxStringCharType* str) +bool getID(unsigned long *id, const wxString& str) { + const wxStringCharType * const start = str.wx_str(); wxStringCharType *end; #if wxUSE_UNICODE_WCHAR - unsigned long val = wcstoul(str+1, &end, GCCXML_BASE); + unsigned long val = wcstoul(start, &end, GCCXML_BASE); #else - unsigned long val = strtoul(str+1, &end, GCCXML_BASE); + unsigned long val = strtoul(start, &end, GCCXML_BASE); #endif // return true only if scan was stopped by the terminating NUL and // if the string was not empty to start with and no under/overflow // occurred: - if ( *end != '\0' || end == str+1 || errno == ERANGE || errno == EINVAL ) + if ( *end != '\0' || end == start || errno == ERANGE || errno == EINVAL ) return false; *id = val; @@ -680,19 +681,20 @@ bool getID(unsigned long *id, const wxStringCharType* str) // utility specialized to parse efficiently the gccXML list of IDs which occur // in nodes like ones... i.e. numeric values separed by " _" token -bool getMemberIDs(wxClassMemberIdHashMap* map, wxClass* p, const wxStringCharType* str) +bool getMemberIDs(wxClassMemberIdHashMap* map, wxClass* p, const wxString& str) { + const wxStringCharType * const start = str.wx_str(); #if wxUSE_UNICODE_WCHAR - size_t len = wcslen(str); + size_t len = wcslen(start); #else - size_t len = strlen(str); + size_t len = strlen(start); #endif - if (len == 0 || str[0] != '_') + if (len == 0 || start[0] != '_') return false; - const wxStringCharType *curpos = str, - *end = str + len; + const wxStringCharType *curpos = start, + *end = start + len; wxStringCharType *nexttoken; while (curpos < end) -- 2.45.2