Bool neg = False;
Long n = 0;
if (*str == '-') { str++; neg = True; };
+ if (*str == '0' && (*(str+1) == 'x' || *(str+1) == 'X')) {
+ str += 2;
+ }
while (True) {
Char c = *str;
if (c >= '0' && c <= (Char)'9') {
Converting strings to numbers
------------------------------------------------------------------ */
- // Nb: atoll16 doesn't handle a "0x" prefix.
-extern Long VG_(atoll) ( Char* str ); // base 10
-extern Long VG_(atoll16) ( Char* str ); // base 16
-extern Long VG_(atoll36) ( Char* str ); // base 36
+extern Long VG_(atoll) ( Char* str ); // base 10
+extern Long VG_(atoll16) ( Char* str ); // base 16; leading 0x accepted
+extern Long VG_(atoll36) ( Char* str ); // base 36
/* ---------------------------------------------------------------------
String functions and macros