1 --- wcstoull.c.orig Tue May 20 15:21:45 2003
2 +++ wcstoull.c Fri Feb 18 14:58:24 2005
5 __FBSDID("$FreeBSD: src/lib/libc/locale/wcstoull.c,v 1.1 2002/09/22 08:06:45 tjr Exp $");
7 +#include "xlocale_private.h"
13 * Convert a wide character string to an unsigned long long integer.
16 -wcstoull(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr,
18 +wcstoull_l(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr,
19 + int base, locale_t loc)
22 unsigned long long acc;
24 unsigned long long cutoff;
27 + NORMALIZE_LOCALE(loc);
29 * See strtoull for comments as to the logic used.
34 - } while (iswspace(c));
35 + } while (iswspace_l(c, loc));
40 cutlim = ULLONG_MAX % base;
45 + if (iswdigit_l(c, loc))
46 + c = digittoint_l(c, loc);
49 if (c >= L'0' && c <= L'9')
52 *endptr = (wchar_t *)(any ? s - 1 : nptr);
57 +wcstoull(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr,
60 + return wcstoull_l(nptr, endptr, base, __current_locale());