X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/224c70764cab4e0e39a26aaf3ad3016552f62f55..1f2f436a38f7ae2d39a943ad2898d8fed4ed2e58:/locale/gb2312-fbsd.c?ds=inline diff --git a/locale/gb2312-fbsd.c b/locale/gb2312-fbsd.c index a632e07..a84b1cf 100644 --- a/locale/gb2312-fbsd.c +++ b/locale/gb2312-fbsd.c @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/locale/gb2312.c,v 1.8 2004/05/12 14:09:04 tjr Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/locale/gb2312.c,v 1.10 2007/10/13 16:28:21 ache Exp $"); #include "xlocale_private.h" @@ -39,12 +39,11 @@ __FBSDID("$FreeBSD: src/lib/libc/locale/gb2312.c,v 1.8 2004/05/12 14:09:04 tjr E #define GB2312_MB_CUR_MAX 2 -__private_extern__ int _GB2312_init(struct __xlocale_st_runelocale *); -static size_t _GB2312_mbrtowc(wchar_t * __restrict, const char * __restrict, size_t, - mbstate_t * __restrict, locale_t); +static size_t _GB2312_mbrtowc(wchar_t * __restrict, const char * __restrict, + size_t, mbstate_t * __restrict, locale_t); static int _GB2312_mbsinit(const mbstate_t *, locale_t); -static size_t _GB2312_wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict, locale_t); - +static size_t _GB2312_wcrtomb(char * __restrict, wchar_t, + mbstate_t * __restrict, locale_t); typedef struct { int count; u_char bytes[2]; @@ -58,11 +57,12 @@ _GB2312_init(struct __xlocale_st_runelocale *xrl) xrl->__wcrtomb = _GB2312_wcrtomb; xrl->__mbsinit = _GB2312_mbsinit; xrl->__mb_cur_max = GB2312_MB_CUR_MAX; + xrl->__mb_sb_limit = 128; return (0); } static int -_GB2312_mbsinit(const mbstate_t *ps, locale_t loc) +_GB2312_mbsinit(const mbstate_t *ps, locale_t loc __unused) { return (ps == NULL || ((const _GB2312State *)ps)->count == 0); @@ -93,7 +93,7 @@ _GB2312_check(const char *str, size_t n) static size_t _GB2312_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, - mbstate_t * __restrict ps, locale_t loc) + mbstate_t * __restrict ps, locale_t loc __unused) { _GB2312State *gs; wchar_t wc; @@ -133,7 +133,7 @@ _GB2312_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, } static size_t -_GB2312_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps, locale_t loc) +_GB2312_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps, locale_t loc __unused) { _GB2312State *gs;