Changeset 56223
- Timestamp:
- 10/10/08 14:20:46 (6 weeks ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
wxWidgets/trunk/utils/ifacecheck/src/xmlparser.cpp
r56080 r56223 660 660 // this function is equivalent to wxString(str).Mid(1).ToULong(&id, GCCXML_BASE) 661 661 // but is a little bit faster 662 bool getID(unsigned long *id, const wxStringCharType* str) 663 { 662 bool getID(unsigned long *id, const wxString& str) 663 { 664 const wxStringCharType * const start = str.wx_str(); 664 665 wxStringCharType *end; 665 666 #if wxUSE_UNICODE_WCHAR 666 unsigned long val = wcstoul(st r+1, &end, GCCXML_BASE);667 unsigned long val = wcstoul(start, &end, GCCXML_BASE); 667 668 #else 668 unsigned long val = strtoul(st r+1, &end, GCCXML_BASE);669 unsigned long val = strtoul(start, &end, GCCXML_BASE); 669 670 #endif 670 671 … … 672 673 // if the string was not empty to start with and no under/overflow 673 674 // occurred: 674 if ( *end != '\0' || end == st r+1|| errno == ERANGE || errno == EINVAL )675 if ( *end != '\0' || end == start || errno == ERANGE || errno == EINVAL ) 675 676 return false; 676 677 … … 681 682 // utility specialized to parse efficiently the gccXML list of IDs which occur 682 683 // in nodes like <Class> ones... i.e. numeric values separed by " _" token 683 bool getMemberIDs(wxClassMemberIdHashMap* map, wxClass* p, const wxStringCharType* str) 684 { 684 bool getMemberIDs(wxClassMemberIdHashMap* map, wxClass* p, const wxString& str) 685 { 686 const wxStringCharType * const start = str.wx_str(); 685 687 #if wxUSE_UNICODE_WCHAR 686 size_t len = wcslen(st r);688 size_t len = wcslen(start); 687 689 #else 688 size_t len = strlen(st r);690 size_t len = strlen(start); 689 691 #endif 690 692 691 if (len == 0 || st r[0] != '_')692 return false; 693 694 const wxStringCharType *curpos = st r,695 *end = st r+ len;693 if (len == 0 || start[0] != '_') 694 return false; 695 696 const wxStringCharType *curpos = start, 697 *end = start + len; 696 698 wxStringCharType *nexttoken; 697 699
