Re: CVS commit: src/lib/libc/locale
I can' t understand why this change is needed. POSIX2008 spec say, *_l func with invalid locale handle may EINVAL. NULL or (locale_t)0 is invalid locale handle. why are you think fallback to C locale? http://pubs.opengroup.org/onlinepubs/9699919799/functions/isalpha.html http://pubs.opengroup.org/onlinepubs/9699919799/functions/nl_langinfo.html http://pubs.opengroup.org/onlinepubs/9699919799/functions/newlocale.html glibc2(*_l function's origin) does more simpler, they don't check NULL and cause Segmentation Fault. I think glibc2 is reasonable, because POSIX2008 does change for the worse. as far as is*_l functions, return value is non-zero(=matches class) or zero(=not matches class) only. we can't know the error from it. 2013/4/15 Joerg Sonnenberger jo...@netbsd.org: Module Name:src Committed By: joerg Date: Sun Apr 14 23:44:54 UTC 2013 Modified Files: src/lib/libc/locale: Makefile.inc setlocale_local.h Added Files: src/lib/libc/locale: c_locale.c Log Message: Provide a const copy of global_locale for libc-internal use. This will be used by *_l when a NULL pointer is given. To generate a diff of this commit: cvs rdiff -u -r1.60 -r1.61 src/lib/libc/locale/Makefile.inc cvs rdiff -u -r0 -r1.1 src/lib/libc/locale/c_locale.c cvs rdiff -u -r1.10 -r1.11 src/lib/libc/locale/setlocale_local.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. -- Takehiko NOZAKItakehiko.noz...@gmail.com
CVS commit: src/share/locale/ctype
Module Name:src Committed By: tnozaki Date: Wed Aug 8 18:40:37 UTC 2012 Modified Files: src/share/locale/ctype: en_US.UTF-8.src Log Message: fix PR lib/46772 wcwidth of combining characters. patch probyted by yamt@, thanks. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/share/locale/ctype/en_US.UTF-8.src Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/locale/ctype/en_US.UTF-8.src diff -u src/share/locale/ctype/en_US.UTF-8.src:1.4 src/share/locale/ctype/en_US.UTF-8.src:1.5 --- src/share/locale/ctype/en_US.UTF-8.src:1.4 Thu Feb 10 18:12:42 2005 +++ src/share/locale/ctype/en_US.UTF-8.src Wed Aug 8 18:40:37 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: en_US.UTF-8.src,v 1.4 2005/02/10 18:12:42 tnozaki Exp $ */ +/* $NetBSD: en_US.UTF-8.src,v 1.5 2012/08/08 18:40:37 tnozaki Exp $ */ /* $FreeBSD: /repoman/r/ncvs/src/share/mklocale/UTF-8.src,v 1.1 2004/03/27 08:14:14 tjr Exp $ */ /* @@ -493,7 +493,7 @@ SWIDTH1 0x02b0 - 0x02ee GRAPH 0x0300 - 0x034f 0x0360 - 0x036f PRINT 0x0300 - 0x034f 0x0360 - 0x036f -SWIDTH1 0x0300 - 0x034f 0x0360 - 0x036f +SWIDTH0 0x0300 - 0x034f 0x0360 - 0x036f MAPUPPER 0x0345 0x0399
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Wed Aug 8 18:37:26 UTC 2012 Modified Files: src/lib/libc/locale: rune.c Log Message: fix PR lib/46781 statically compiled bash makes locale loading fail. analyzed and patch provided by enami@ nonaka@ obache@ soda@, thanks. patch modified by me. To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/lib/libc/locale/rune.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/locale/rune.c diff -u src/lib/libc/locale/rune.c:1.43 src/lib/libc/locale/rune.c:1.44 --- src/lib/libc/locale/rune.c:1.43 Fri Jan 20 16:31:30 2012 +++ src/lib/libc/locale/rune.c Wed Aug 8 18:37:26 2012 @@ -1,5 +1,3 @@ -/* $NetBSD: rune.c,v 1.43 2012/01/20 16:31:30 joerg Exp $ */ - /*- * Copyright (c)2010 Citrus Project, * All rights reserved. @@ -162,7 +160,7 @@ _rune_read_file(const char * __restrict variable_len = be32toh((uint32_t)frl-frl_variable_len); - n = (len * sizeof(*fre)) + variable_len; + n = len * sizeof(*fre); if (lenvar n) return EFTYPE; lenvar -= n; @@ -219,15 +217,15 @@ do { \ READ_RANGE(maplower); READ_RANGE(mapupper); - memcpy((void *)rune, (void const *)frune, variable_len); - rl-rl_variable_len = variable_len; - rl-rl_variable = (void *)rune; - - if (lenvar 0) { + if (lenvar variable_len) { ret = EFTYPE; goto err; } + memcpy((void *)rune, (void const *)frune, variable_len); + rl-rl_variable_len = variable_len; + rl-rl_variable = (void *)rune; + _rune_find_codeset(rlp-rlp_codeset, sizeof(rlp-rlp_codeset), (char *)rl-rl_variable, rl-rl_variable_len);
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Wed Aug 8 18:37:26 UTC 2012 Modified Files: src/lib/libc/locale: rune.c Log Message: fix PR lib/46781 statically compiled bash makes locale loading fail. analyzed and patch provided by enami@ nonaka@ obache@ soda@, thanks. patch modified by me. To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/lib/libc/locale/rune.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/share/locale/ctype
Module Name:src Committed By: tnozaki Date: Wed Aug 8 18:40:37 UTC 2012 Modified Files: src/share/locale/ctype: en_US.UTF-8.src Log Message: fix PR lib/46772 wcwidth of combining characters. patch probyted by yamt@, thanks. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/share/locale/ctype/en_US.UTF-8.src Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/lib/libc/stdio
Hi, It seems that lint(1) is not cross build safe, it doesn't handle MD char default type of sign/unsignd. See src/usr.bin/xlint/lint1/tree.c::cvtcon(). They use host MD CHAR_MAX directry ;) So, if cross building ppc/arm on other arch cause false alarm , out of range warnng. Regards. -- 2012/03/22 10:39 Joerg Sonnenberger jo...@britannica.bec.de: On Thu, Mar 22, 2012 at 01:31:41AM +, Christos Zoulas wrote: In article 20120322003141.gb1...@britannica.bec.de, Joerg Sonnenberger jo...@britannica.bec.de wrote: On Wed, Mar 21, 2012 at 10:20:47AM -0400, Christos Zoulas wrote: Module Name: src Committed By: christos Date: Wed Mar 21 14:20:47 UTC 2012 Modified Files: src/lib/libc/stdio: vfwprintf.c Log Message: unsigned char portability casts This looks wrong. What's the point of it? What's is wrong with it? It should be unnecessary. CHAR_MAX is certainly required to fit into both char and unsigned char. Joerg
Re: CVS commit: src/lib/libc/stdio
Hi, It seems that lint(1) is not cross build safe, it doesn't handle MD char default type of sign/unsignd. See src/usr.bin/xlint/lint1/tree.c::cvtcon(). They use host MD CHAR_MAX directry ;) So, if cross building ppc/arm on other arch cause false alarm , out of range warnng. very truly yours. -- Takehiko NOZAKItnoz...@netbsd.org 2012/3/21 Christos Zoulas chris...@netbsd.org: Module Name: src Committed By: christos Date: Wed Mar 21 14:20:47 UTC 2012 Modified Files: src/lib/libc/stdio: vfwprintf.c Log Message: unsigned char portability casts To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/lib/libc/stdio/vfwprintf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc
Module Name:src Committed By: tnozaki Date: Sun Mar 4 21:14:57 UTC 2012 Modified Files: src/lib/libc/citrus: citrus_lc_ctype.c citrus_lc_messages.c citrus_lc_monetary.c citrus_lc_numeric.c citrus_lc_time.c src/lib/libc/locale: dummy_lc_collate.c dummy_lc_template.h generic_lc_all.c generic_lc_template_decl.h nb_lc_template.h setlocale.c setlocale_local.h Removed Files: src/lib/libc/locale: generic_lc_template.h Log Message: don't use __link_set_* stuff for locale implementation. patch reviewed by matt@, thanks. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/lib/libc/citrus/citrus_lc_ctype.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/citrus/citrus_lc_messages.c \ src/lib/libc/citrus/citrus_lc_monetary.c \ src/lib/libc/citrus/citrus_lc_numeric.c cvs rdiff -u -r1.5 -r1.6 src/lib/libc/citrus/citrus_lc_time.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/dummy_lc_collate.c \ src/lib/libc/locale/dummy_lc_template.h \ src/lib/libc/locale/generic_lc_template_decl.h cvs rdiff -u -r1.3 -r1.4 src/lib/libc/locale/generic_lc_all.c \ src/lib/libc/locale/nb_lc_template.h cvs rdiff -u -r1.3 -r0 src/lib/libc/locale/generic_lc_template.h cvs rdiff -u -r1.59 -r1.60 src/lib/libc/locale/setlocale.c cvs rdiff -u -r1.7 -r1.8 src/lib/libc/locale/setlocale_local.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/citrus_lc_ctype.c diff -u src/lib/libc/citrus/citrus_lc_ctype.c:1.9 src/lib/libc/citrus/citrus_lc_ctype.c:1.10 --- src/lib/libc/citrus/citrus_lc_ctype.c:1.9 Sat Jun 19 13:26:51 2010 +++ src/lib/libc/citrus/citrus_lc_ctype.c Sun Mar 4 21:14:55 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_lc_ctype.c,v 1.9 2010/06/19 13:26:51 tnozaki Exp $ */ +/* $NetBSD: citrus_lc_ctype.c,v 1.10 2012/03/04 21:14:55 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: citrus_lc_ctype.c,v 1.9 2010/06/19 13:26:51 tnozaki Exp $); +__RCSID($NetBSD: citrus_lc_ctype.c,v 1.10 2012/03/04 21:14:55 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include reentrant.h @@ -130,4 +130,3 @@ _PREFIX(fixup)(_RuneLocale *data) #define _CATEGORY_DEFAULT _DefaultRuneLocale #include nb_lc_template.h -_LOCALE_CATEGORY_ENTRY(_citrus_LC_CTYPE_); Index: src/lib/libc/citrus/citrus_lc_messages.c diff -u src/lib/libc/citrus/citrus_lc_messages.c:1.4 src/lib/libc/citrus/citrus_lc_messages.c:1.5 --- src/lib/libc/citrus/citrus_lc_messages.c:1.4 Sun Jun 13 04:14:57 2010 +++ src/lib/libc/citrus/citrus_lc_messages.c Sun Mar 4 21:14:55 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_lc_messages.c,v 1.4 2010/06/13 04:14:57 tnozaki Exp $ */ +/* $NetBSD: citrus_lc_messages.c,v 1.5 2012/03/04 21:14:55 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: citrus_lc_messages.c,v 1.4 2010/06/13 04:14:57 tnozaki Exp $); +__RCSID($NetBSD: citrus_lc_messages.c,v 1.5 2012/03/04 21:14:55 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h @@ -160,4 +160,3 @@ fatal: #define _CATEGORY_MAGIC _CITRUS_LC_MESSAGES_MAGIC_1 #include citrus_lc_template.h -_LOCALE_CATEGORY_ENTRY(_citrus_LC_MESSAGES_); Index: src/lib/libc/citrus/citrus_lc_monetary.c diff -u src/lib/libc/citrus/citrus_lc_monetary.c:1.4 src/lib/libc/citrus/citrus_lc_monetary.c:1.5 --- src/lib/libc/citrus/citrus_lc_monetary.c:1.4 Sun Jun 13 04:14:57 2010 +++ src/lib/libc/citrus/citrus_lc_monetary.c Sun Mar 4 21:14:55 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_lc_monetary.c,v 1.4 2010/06/13 04:14:57 tnozaki Exp $ */ +/* $NetBSD: citrus_lc_monetary.c,v 1.5 2012/03/04 21:14:55 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: citrus_lc_monetary.c,v 1.4 2010/06/13 04:14:57 tnozaki Exp $); +__RCSID($NetBSD: citrus_lc_monetary.c,v 1.5 2012/03/04 21:14:55 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h @@ -217,4 +217,3 @@ fatal: #define _CATEGORY_MAGIC _CITRUS_LC_MONETARY_MAGIC_1 #include citrus_lc_template.h -_LOCALE_CATEGORY_ENTRY(_citrus_LC_MONETARY_); Index: src/lib/libc/citrus/citrus_lc_numeric.c diff -u src/lib/libc/citrus/citrus_lc_numeric.c:1.4 src/lib/libc/citrus/citrus_lc_numeric.c:1.5 --- src/lib/libc/citrus/citrus_lc_numeric.c:1.4 Sun Jun 13 04:14:57 2010 +++ src/lib/libc/citrus/citrus_lc_numeric.c Sun Mar 4 21:14:55 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_lc_numeric.c,v 1.4 2010/06/13 04:14:57 tnozaki Exp $ */ +/* $NetBSD: citrus_lc_numeric.c,v 1.5 2012/03/04 21:14:55 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint)
CVS commit: src/lib/libc
Module Name:src Committed By: tnozaki Date: Sun Mar 4 21:14:57 UTC 2012 Modified Files: src/lib/libc/citrus: citrus_lc_ctype.c citrus_lc_messages.c citrus_lc_monetary.c citrus_lc_numeric.c citrus_lc_time.c src/lib/libc/locale: dummy_lc_collate.c dummy_lc_template.h generic_lc_all.c generic_lc_template_decl.h nb_lc_template.h setlocale.c setlocale_local.h Removed Files: src/lib/libc/locale: generic_lc_template.h Log Message: don't use __link_set_* stuff for locale implementation. patch reviewed by matt@, thanks. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/lib/libc/citrus/citrus_lc_ctype.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/citrus/citrus_lc_messages.c \ src/lib/libc/citrus/citrus_lc_monetary.c \ src/lib/libc/citrus/citrus_lc_numeric.c cvs rdiff -u -r1.5 -r1.6 src/lib/libc/citrus/citrus_lc_time.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/dummy_lc_collate.c \ src/lib/libc/locale/dummy_lc_template.h \ src/lib/libc/locale/generic_lc_template_decl.h cvs rdiff -u -r1.3 -r1.4 src/lib/libc/locale/generic_lc_all.c \ src/lib/libc/locale/nb_lc_template.h cvs rdiff -u -r1.3 -r0 src/lib/libc/locale/generic_lc_template.h cvs rdiff -u -r1.59 -r1.60 src/lib/libc/locale/setlocale.c cvs rdiff -u -r1.7 -r1.8 src/lib/libc/locale/setlocale_local.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libintl
Module Name:src Committed By: tnozaki Date: Sat Jan 21 13:35:49 UTC 2012 Modified Files: src/lib/libintl: gettext.c Log Message: libintl crash when *.mo file lacks header section(old gettext format). reported by jun@ -san, tested by tsutsui@ -san. thanks! To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/lib/libintl/gettext.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libintl/gettext.c diff -u src/lib/libintl/gettext.c:1.25 src/lib/libintl/gettext.c:1.26 --- src/lib/libintl/gettext.c:1.25 Tue Sep 25 08:19:09 2007 +++ src/lib/libintl/gettext.c Sat Jan 21 13:35:49 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: gettext.c,v 1.25 2007/09/25 08:19:09 junyoung Exp $ */ +/* $NetBSD: gettext.c,v 1.26 2012/01/21 13:35:49 tnozaki Exp $ */ /*- * Copyright (c) 2000, 2001 Citrus Project, @@ -29,7 +29,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: gettext.c,v 1.25 2007/09/25 08:19:09 junyoung Exp $); +__RCSID($NetBSD: gettext.c,v 1.26 2012/01/21 13:35:49 tnozaki Exp $); #include sys/param.h #include sys/stat.h @@ -624,7 +624,8 @@ mapit(const char *path, struct domainbin if (v) *v = '\0'; } - if (_gettext_parse_plural(mohandle-mo.mo_plural, + if (!mohandle-mo.mo_header || + _gettext_parse_plural(mohandle-mo.mo_plural, mohandle-mo.mo_nplurals, mohandle-mo.mo_header, headerlen)) mohandle-mo.mo_plural = NULL;
CVS commit: src/lib/libintl
Module Name:src Committed By: tnozaki Date: Sat Jan 21 13:35:49 UTC 2012 Modified Files: src/lib/libintl: gettext.c Log Message: libintl crash when *.mo file lacks header section(old gettext format). reported by jun@ -san, tested by tsutsui@ -san. thanks! To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/lib/libintl/gettext.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/dist/nvi/ex
Module Name:src Committed By: tnozaki Date: Wed Nov 23 14:14:44 UTC 2011 Modified Files: src/dist/nvi/ex: ex.c Log Message: don't use L prefix directly, for --disable-widechar. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/dist/nvi/ex/ex.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/dist/nvi/ex/ex.c diff -u src/dist/nvi/ex/ex.c:1.7 src/dist/nvi/ex/ex.c:1.8 --- src/dist/nvi/ex/ex.c:1.7 Mon Mar 21 14:53:03 2011 +++ src/dist/nvi/ex/ex.c Wed Nov 23 14:14:43 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ex.c,v 1.7 2011/03/21 14:53:03 tnozaki Exp $ */ +/* $NetBSD: ex.c,v 1.8 2011/11/23 14:14:43 tnozaki Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -1842,7 +1842,7 @@ ex_line(SCR *sp, EXCMD *ecp, MARK *mp, i F_CLR(ecp, E_DELTA); /* No addresses permitted until a file has been read in. */ - if (sp-ep == NULL STRCHR(L$0123456789'\\/?.+-^, *ecp-cp)) { + if (sp-ep == NULL STRCHR(L($0123456789'\\/?.+-^), *ecp-cp)) { ex_badaddr(sp, NULL, A_EMPTY, NUM_OK); *errp = 1; return (0);
CVS commit: src/dist/nvi
Module Name:src Committed By: tnozaki Date: Wed Nov 23 15:43:39 UTC 2011 Modified Files: src/dist/nvi/common: multibyte.h src/dist/nvi/regex: regex2.h Log Message: don't use WEOF directly, for --disable-widechar. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/dist/nvi/common/multibyte.h cvs rdiff -u -r1.4 -r1.5 src/dist/nvi/regex/regex2.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/dist/nvi/common/multibyte.h diff -u src/dist/nvi/common/multibyte.h:1.6 src/dist/nvi/common/multibyte.h:1.7 --- src/dist/nvi/common/multibyte.h:1.6 Mon Mar 21 14:53:02 2011 +++ src/dist/nvi/common/multibyte.h Wed Nov 23 15:43:39 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: multibyte.h,v 1.6 2011/03/21 14:53:02 tnozaki Exp $ */ +/* $NetBSD: multibyte.h,v 1.7 2011/11/23 15:43:39 tnozaki Exp $ */ #ifndef MULTIBYTE_H #define MULTIBYTE_H @@ -37,6 +37,7 @@ #include wctype.h typedef wchar_t RCHAR_T; +#define REOF WEOF typedef wchar_t CHAR_T; typedef wint_t ARG_CHAR_T; typedef wint_t UCHAR_T; @@ -65,7 +66,10 @@ typedef wint_t UCHAR_T; #define WC %lc #else +#include stdio.h + typedef char RCHAR_T; +#define REOF EOF typedef char CHAR_T; typedef int ARG_CHAR_T; typedef unsigned char UCHAR_T; Index: src/dist/nvi/regex/regex2.h diff -u src/dist/nvi/regex/regex2.h:1.4 src/dist/nvi/regex/regex2.h:1.5 --- src/dist/nvi/regex/regex2.h:1.4 Sat Nov 19 17:45:11 2011 +++ src/dist/nvi/regex/regex2.h Wed Nov 23 15:43:39 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: regex2.h,v 1.4 2011/11/19 17:45:11 tnozaki Exp $ */ +/* $NetBSD: regex2.h,v 1.5 2011/11/23 15:43:39 tnozaki Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 Henry Spencer. @@ -170,5 +170,5 @@ struct re_guts { }; /* misc utilities */ -#define OUT WEOF /* a non-character value */ +#define OUT REOF /* a non-character value */ #define ISWORD(c) ((c) == '_' || (ISGRAPH((UCHAR_T)c) !ISPUNCT((UCHAR_T)c)))
CVS commit: src/dist/nvi
Module Name:src Committed By: tnozaki Date: Wed Nov 23 19:18:53 UTC 2011 Modified Files: src/dist/nvi/ex: ex_script.c src/dist/nvi/vi: v_z.c Log Message: use e_key_t instead of u_int. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/dist/nvi/ex/ex_script.c cvs rdiff -u -r1.1.1.2 -r1.2 src/dist/nvi/vi/v_z.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/dist/nvi/ex/ex_script.c diff -u src/dist/nvi/ex/ex_script.c:1.4 src/dist/nvi/ex/ex_script.c:1.5 --- src/dist/nvi/ex/ex_script.c:1.4 Sun Jan 18 03:45:50 2009 +++ src/dist/nvi/ex/ex_script.c Wed Nov 23 19:18:53 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ex_script.c,v 1.4 2009/01/18 03:45:50 lukem Exp $ */ +/* $NetBSD: ex_script.c,v 1.5 2011/11/23 19:18:53 tnozaki Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -210,7 +210,7 @@ sscr_getprompt(SCR *sp) fd_set fdset; db_recno_t lline; size_t llen, len; - u_int value; + e_key_t value; int nr; FD_ZERO(fdset); @@ -472,7 +472,7 @@ sscr_insert(SCR *sp) fd_set rdfd; db_recno_t lno; size_t blen, len = 0, tlen; - u_int value; + e_key_t value; int nr, rval; CHAR_T *bp; Index: src/dist/nvi/vi/v_z.c diff -u src/dist/nvi/vi/v_z.c:1.1.1.2 src/dist/nvi/vi/v_z.c:1.2 --- src/dist/nvi/vi/v_z.c:1.1.1.2 Sun May 18 14:31:48 2008 +++ src/dist/nvi/vi/v_z.c Wed Nov 23 19:18:53 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: v_z.c,v 1.1.1.2 2008/05/18 14:31:48 aymeric Exp $ */ +/* $NetBSD: v_z.c,v 1.2 2011/11/23 19:18:53 tnozaki Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -36,7 +36,7 @@ int v_z(SCR *sp, VICMD *vp) { db_recno_t lno; - u_int value; + e_key_t value; /* * The first count is the line to use. If the value doesn't
CVS commit: src/dist/nvi
Module Name:src Committed By: tnozaki Date: Wed Nov 23 19:25:28 UTC 2011 Modified Files: src/dist/nvi/cl: cl_term.c src/dist/nvi/common: cut.c extern.h put.c screen.h src/dist/nvi/ex: ex.c ex.h ex_at.c src/dist/nvi/vi: v_at.c v_ch.c v_txt.c Log Message: use ARG_CHAR_T instead of CHAR_T for integer promotion. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/dist/nvi/cl/cl_term.c cvs rdiff -u -r1.4 -r1.5 src/dist/nvi/common/cut.c \ src/dist/nvi/common/extern.h cvs rdiff -u -r1.2 -r1.3 src/dist/nvi/common/put.c cvs rdiff -u -r1.1.1.2 -r1.2 src/dist/nvi/common/screen.h cvs rdiff -u -r1.8 -r1.9 src/dist/nvi/ex/ex.c cvs rdiff -u -r1.3 -r1.4 src/dist/nvi/ex/ex.h cvs rdiff -u -r1.2 -r1.3 src/dist/nvi/ex/ex_at.c cvs rdiff -u -r1.3 -r1.4 src/dist/nvi/vi/v_at.c cvs rdiff -u -r1.1.1.2 -r1.2 src/dist/nvi/vi/v_ch.c cvs rdiff -u -r1.7 -r1.8 src/dist/nvi/vi/v_txt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/dist/nvi/cl/cl_term.c diff -u src/dist/nvi/cl/cl_term.c:1.3 src/dist/nvi/cl/cl_term.c:1.4 --- src/dist/nvi/cl/cl_term.c:1.3 Sat Sep 24 18:57:46 2011 +++ src/dist/nvi/cl/cl_term.c Wed Nov 23 19:25:27 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: cl_term.c,v 1.3 2011/09/24 18:57:46 jdc Exp $ */ +/* $NetBSD: cl_term.c,v 1.4 2011/11/23 19:25:27 tnozaki Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -127,8 +127,9 @@ cl_term_init(SCR *sp) MEMCPYW(name, wp, wlen); CHAR2INT(sp, t, strlen(t), wp, wlen); MEMCPYW(ts, wp, wlen); + output[0] = (UCHAR_T)kp-ch; if (seq_set(sp, name, strlen(tkp-name), ts, strlen(t), - kp-ch, 1, SEQ_INPUT, SEQ_NOOVERWRITE | SEQ_SCREEN)) + output, 1, SEQ_INPUT, SEQ_NOOVERWRITE | SEQ_SCREEN)) return (1); } Index: src/dist/nvi/common/cut.c diff -u src/dist/nvi/common/cut.c:1.4 src/dist/nvi/common/cut.c:1.5 --- src/dist/nvi/common/cut.c:1.4 Mon Mar 21 14:53:02 2011 +++ src/dist/nvi/common/cut.c Wed Nov 23 19:25:28 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: cut.c,v 1.4 2011/03/21 14:53:02 tnozaki Exp $ */ +/* $NetBSD: cut.c,v 1.5 2011/11/23 19:25:28 tnozaki Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -63,10 +63,10 @@ static void cb_rotate __P((SCR *)); * replacing the contents. Hopefully it's not worth getting right, and here * we just treat the numeric buffers like any other named buffer. * - * PUBLIC: int cut __P((SCR *, CHAR_T *, MARK *, MARK *, int)); + * PUBLIC: int cut __P((SCR *, ARG_CHAR_T *, MARK *, MARK *, int)); */ int -cut(SCR *sp, CHAR_T *namep, MARK *fm, MARK *tm, int flags) +cut(SCR *sp, ARG_CHAR_T *namep, MARK *fm, MARK *tm, int flags) { CB *cbp; ARG_CHAR_T name = '\0'; @@ -97,7 +97,7 @@ cut(SCR *sp, CHAR_T *namep, MARK *fm, MA */ append = copy_one = copy_def = 0; if (namep != NULL) { - name = (UCHAR_T)*namep; + name = *namep; if (LF_ISSET(CUT_NUMREQ) || (LF_ISSET(CUT_NUMOPT) (LF_ISSET(CUT_LINEMODE) || fm-lno != tm-lno))) { copy_one = 1; Index: src/dist/nvi/common/extern.h diff -u src/dist/nvi/common/extern.h:1.4 src/dist/nvi/common/extern.h:1.5 --- src/dist/nvi/common/extern.h:1.4 Mon Mar 21 14:53:02 2011 +++ src/dist/nvi/common/extern.h Wed Nov 23 19:25:28 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.4 2011/03/21 14:53:02 tnozaki Exp $ */ +/* $NetBSD: extern.h,v 1.5 2011/11/23 19:25:28 tnozaki Exp $ */ /* Do not edit: automatically built by build/distrib. */ SCR *api_fscreen __P((int, char *)); @@ -28,7 +28,7 @@ TAGQ * api_tagq_new __P((SCR*, char*)); void api_tagq_add __P((SCR*, TAGQ*, char*, char *, char *)); int api_tagq_push __P((SCR*, TAGQ**)); void api_tagq_free __P((SCR*, TAGQ*)); -int cut __P((SCR *, CHAR_T *, MARK *, MARK *, int)); +int cut __P((SCR *, ARG_CHAR_T *, MARK *, MARK *, int)); int cut_line __P((SCR *, db_recno_t, size_t, size_t, CB *)); void cut_close __P((WIN *)); TEXT *text_init __P((SCR *, const CHAR_T *, size_t, size_t)); @@ -133,7 +133,7 @@ int f_w9600 __P((SCR *, OPTION *, const int f_window __P((SCR *, OPTION *, const char *, u_long *)); int f_encoding __P((SCR *, OPTION *, const char *, u_long *)); void thread_init __P((GS *gp)); -int put __P((SCR *, CB *, CHAR_T *, MARK *, MARK *, int)); +int put __P((SCR *, CB *, ARG_CHAR_T *, MARK *, MARK *, int)); int rcv_tmp __P((SCR *, EXF *, char *)); int rcv_init __P((SCR *)); int rcv_sync __P((SCR *, u_int)); Index: src/dist/nvi/common/put.c diff -u src/dist/nvi/common/put.c:1.2 src/dist/nvi/common/put.c:1.3 --- src/dist/nvi/common/put.c:1.2 Fri Dec 5 22:51:42 2008 +++ src/dist/nvi/common/put.c Wed Nov 23 19:25:28 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: put.c,v 1.2 2008/12/05 22:51:42 christos Exp $ */ +/* $NetBSD: put.c,v 1.3 2011/11/23 19:25:28 tnozaki Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -34,9 +34,9 @@ static const char sccsid[] = Id: put.c, * PUBLIC: int put __P((SCR *, CB *, CHAR_T *, MARK *, MARK *, int)); */ int -put(SCR *sp, CB *cbp, CHAR_T *namep,
CVS commit: src/dist/nvi/ex
Module Name:src Committed By: tnozaki Date: Wed Nov 23 14:14:44 UTC 2011 Modified Files: src/dist/nvi/ex: ex.c Log Message: don't use L prefix directly, for --disable-widechar. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/dist/nvi/ex/ex.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/dist/nvi
Module Name:src Committed By: tnozaki Date: Wed Nov 23 15:43:39 UTC 2011 Modified Files: src/dist/nvi/common: multibyte.h src/dist/nvi/regex: regex2.h Log Message: don't use WEOF directly, for --disable-widechar. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/dist/nvi/common/multibyte.h cvs rdiff -u -r1.4 -r1.5 src/dist/nvi/regex/regex2.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/dist/nvi
Module Name:src Committed By: tnozaki Date: Wed Nov 23 19:18:53 UTC 2011 Modified Files: src/dist/nvi/ex: ex_script.c src/dist/nvi/vi: v_z.c Log Message: use e_key_t instead of u_int. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/dist/nvi/ex/ex_script.c cvs rdiff -u -r1.1.1.2 -r1.2 src/dist/nvi/vi/v_z.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/dist/nvi
Module Name:src Committed By: tnozaki Date: Wed Nov 23 19:25:28 UTC 2011 Modified Files: src/dist/nvi/cl: cl_term.c src/dist/nvi/common: cut.c extern.h put.c screen.h src/dist/nvi/ex: ex.c ex.h ex_at.c src/dist/nvi/vi: v_at.c v_ch.c v_txt.c Log Message: use ARG_CHAR_T instead of CHAR_T for integer promotion. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/dist/nvi/cl/cl_term.c cvs rdiff -u -r1.4 -r1.5 src/dist/nvi/common/cut.c \ src/dist/nvi/common/extern.h cvs rdiff -u -r1.2 -r1.3 src/dist/nvi/common/put.c cvs rdiff -u -r1.1.1.2 -r1.2 src/dist/nvi/common/screen.h cvs rdiff -u -r1.8 -r1.9 src/dist/nvi/ex/ex.c cvs rdiff -u -r1.3 -r1.4 src/dist/nvi/ex/ex.h cvs rdiff -u -r1.2 -r1.3 src/dist/nvi/ex/ex_at.c cvs rdiff -u -r1.3 -r1.4 src/dist/nvi/vi/v_at.c cvs rdiff -u -r1.1.1.2 -r1.2 src/dist/nvi/vi/v_ch.c cvs rdiff -u -r1.7 -r1.8 src/dist/nvi/vi/v_txt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/dist/nvi/regex
Module Name:src Committed By: tnozaki Date: Sat Nov 19 17:45:11 UTC 2011 Modified Files: src/dist/nvi/regex: engine.c regcomp.c regex2.h Log Message: reliability fix, merge libc/regex fix to avoid memory exhaust problem. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/dist/nvi/regex/engine.c \ src/dist/nvi/regex/regcomp.c cvs rdiff -u -r1.3 -r1.4 src/dist/nvi/regex/regex2.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/dist/nvi/regex/engine.c diff -u src/dist/nvi/regex/engine.c:1.6 src/dist/nvi/regex/engine.c:1.7 --- src/dist/nvi/regex/engine.c:1.6 Sun Apr 12 14:47:51 2009 +++ src/dist/nvi/regex/engine.c Sat Nov 19 17:45:11 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: engine.c,v 1.6 2009/04/12 14:47:51 tnozaki Exp $ */ +/* $NetBSD: engine.c,v 1.7 2011/11/19 17:45:11 tnozaki Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 Henry Spencer. @@ -168,8 +168,8 @@ int eflags; /* prescreening; this does wonders for this rather slow code */ if (g-must != NULL) { for (dp = start; dp stop; dp++) - if (*dp == g-must[0] stop - dp = g-mlen -MEMCMP(dp, g-must, (size_t)g-mlen) == 0) + if (*dp == g-must[0] (size_t)(stop - dp) = g-mlen +MEMCMP(dp, g-must, g-mlen) == 0) break; if (dp == stop) /* we didn't find g-must */ return(REG_NOMATCH); Index: src/dist/nvi/regex/regcomp.c diff -u src/dist/nvi/regex/regcomp.c:1.6 src/dist/nvi/regex/regcomp.c:1.7 --- src/dist/nvi/regex/regcomp.c:1.6 Mon Mar 21 14:53:03 2011 +++ src/dist/nvi/regex/regcomp.c Sat Nov 19 17:45:11 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: regcomp.c,v 1.6 2011/03/21 14:53:03 tnozaki Exp $ */ +/* $NetBSD: regcomp.c,v 1.7 2011/11/19 17:45:11 tnozaki Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 Henry Spencer. @@ -82,11 +82,11 @@ extern C { #endif /* === regcomp.c === */ -static void p_ere __P((struct parse *p, int stop)); -static void p_ere_exp __P((struct parse *p)); +static void p_ere __P((struct parse *p, int stop, size_t reclimit)); +static void p_ere_exp __P((struct parse *p, size_t reclimit)); static void p_str __P((struct parse *p)); -static void p_bre __P((struct parse *p, int end1, int end2)); -static int p_simp_re __P((struct parse *p, int starordinary)); +static void p_bre __P((struct parse *p, int end1, int end2, size_t reclimit)); +static int p_simp_re __P((struct parse *p, int starordinary, size_t reclimit)); static int p_count __P((struct parse *p)); static void p_bracket __P((struct parse *p)); static void p_b_term __P((struct parse *p, cset *cs)); @@ -98,7 +98,7 @@ static char othercase __P((int ch)); static void bothcases __P((struct parse *p, int ch)); static void ordinary __P((struct parse *p, int ch)); static void nonnewline __P((struct parse *p)); -static void repeat __P((struct parse *p, sopno start, int from, int to)); +static void repeat __P((struct parse *p, sopno start, int from, int to, size_t reclimit)); static int seterr __P((struct parse *p, int e)); static cset *allocset __P((struct parse *p)); static void freeset __P((struct parse *p, cset *cs)); @@ -122,7 +122,7 @@ static sopno dupl __P((struct parse *p, static void doemit __P((struct parse *p, sop op, size_t opnd)); static void doinsert __P((struct parse *p, sop op, size_t opnd, sopno pos)); static void dofwd __P((struct parse *p, sopno pos, sop value)); -static void enlarge __P((struct parse *p, sopno size)); +static int enlarge __P((struct parse *p, sopno size)); static void stripsnug __P((struct parse *p, struct re_guts *g)); static void findmust __P((struct parse *p, struct re_guts *g)); static sopno pluscount __P((struct parse *p, struct re_guts *g)); @@ -170,6 +170,13 @@ static int never = 0; /* for use in ass #define never 0 /* some assert.hs have bugs too */ #endif +#define MEMLIMIT 0x800 +#define MEMSIZE(p) \ + ((p)-ncsalloc / CHAR_BIT * (p)-g-csetsize + \ + (p)-ncsalloc * sizeof(cset) + \ + (p)-ssize * sizeof(sop)) +#define RECLIMIT 256 + /* - regcomp - interface for parser and compilation = extern int regcomp(regex_t *, const RCHAR_T *, int); @@ -258,11 +265,11 @@ regcomp(regex_t *preg, const RCHAR_T *pa EMIT(OEND, 0); g-firststate = THERE(); if (cflagsREG_EXTENDED) - p_ere(p, OUT); + p_ere(p, OUT, 0); else if (cflagsREG_NOSPEC) p_str(p); else - p_bre(p, OUT, OUT); + p_bre(p, OUT, OUT, 0); EMIT(OEND, 0); g-laststate = THERE(); @@ -289,10 +296,10 @@ regcomp(regex_t *preg, const RCHAR_T *pa /* - p_ere - ERE parser top level, concatenation and alternation - == static void p_ere(register struct parse *p, int stop); + == static void p_ere(register struct parse *p, int stop, size_t reclimit); */ static void -p_ere(register struct parse *p, int stop) +p_ere(register struct parse *p, int stop, size_t reclimit) /* character this ERE should end at */ { @@ -302,11 +309,16 @@ p_ere(register struct parse *p,
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: tnozaki Date: Sat Nov 19 18:20:13 UTC 2011 Modified Files: src/lib/libc/citrus/modules: citrus_dechanyu.c citrus_viqr.c Log Message: remove unused variable, pointed by nonaka-san, thanks. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/libc/citrus/modules/citrus_dechanyu.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/citrus/modules/citrus_viqr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_dechanyu.c diff -u src/lib/libc/citrus/modules/citrus_dechanyu.c:1.3 src/lib/libc/citrus/modules/citrus_dechanyu.c:1.4 --- src/lib/libc/citrus/modules/citrus_dechanyu.c:1.3 Sat Jun 14 16:01:07 2008 +++ src/lib/libc/citrus/modules/citrus_dechanyu.c Sat Nov 19 18:20:13 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_dechanyu.c,v 1.3 2008/06/14 16:01:07 tnozaki Exp $ */ +/* $NetBSD: citrus_dechanyu.c,v 1.4 2011/11/19 18:20:13 tnozaki Exp $ */ /*- * Copyright (c)2007 Citrus Project, @@ -27,7 +27,7 @@ */ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: citrus_dechanyu.c,v 1.3 2008/06/14 16:01:07 tnozaki Exp $); +__RCSID($NetBSD: citrus_dechanyu.c,v 1.4 2011/11/19 18:20:13 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include sys/types.h @@ -187,7 +187,7 @@ _citrus_DECHanyu_mbrtowc_priv(_DECHanyuE _DECHanyuState * __restrict psenc, size_t * __restrict nresult) { const char *s0; - int ch, i; + int ch; wchar_t wc; /* ei may be unused */ Index: src/lib/libc/citrus/modules/citrus_viqr.c diff -u src/lib/libc/citrus/modules/citrus_viqr.c:1.4 src/lib/libc/citrus/modules/citrus_viqr.c:1.5 --- src/lib/libc/citrus/modules/citrus_viqr.c:1.4 Sat Jun 14 16:01:08 2008 +++ src/lib/libc/citrus/modules/citrus_viqr.c Sat Nov 19 18:20:13 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_viqr.c,v 1.4 2008/06/14 16:01:08 tnozaki Exp $ */ +/* $NetBSD: citrus_viqr.c,v 1.5 2011/11/19 18:20:13 tnozaki Exp $ */ /*- * Copyright (c)2006 Citrus Project, @@ -29,7 +29,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: citrus_viqr.c,v 1.4 2008/06/14 16:01:08 tnozaki Exp $); +__RCSID($NetBSD: citrus_viqr.c,v 1.5 2011/11/19 18:20:13 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include sys/queue.h @@ -360,7 +360,7 @@ _citrus_VIQR_wcrtomb_priv(_VIQREncodingI _VIQRState * __restrict psenc, size_t * __restrict nresult) { mnemonic_t *m; - int ch, escape; + int ch; const char *p; _DIAGASSERT(ei != NULL);
CVS commit: src/lib/libc/citrus
Module Name:src Committed By: tnozaki Date: Sat Nov 19 18:34:22 UTC 2011 Modified Files: src/lib/libc/citrus: citrus_ctype.c citrus_iconv.c Log Message: return EINVAL when module validation failed, pointed by nonaka-san(again). To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/lib/libc/citrus/citrus_ctype.c cvs rdiff -u -r1.9 -r1.10 src/lib/libc/citrus/citrus_iconv.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/citrus_ctype.c diff -u src/lib/libc/citrus/citrus_ctype.c:1.5 src/lib/libc/citrus/citrus_ctype.c:1.6 --- src/lib/libc/citrus/citrus_ctype.c:1.5 Sat Jun 14 16:01:07 2008 +++ src/lib/libc/citrus/citrus_ctype.c Sat Nov 19 18:34:21 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_ctype.c,v 1.5 2008/06/14 16:01:07 tnozaki Exp $ */ +/* $NetBSD: citrus_ctype.c,v 1.6 2011/11/19 18:34:21 tnozaki Exp $ */ /*- * Copyright (c)1999, 2000, 2001, 2002 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: citrus_ctype.c,v 1.5 2008/06/14 16:01:07 tnozaki Exp $); +__RCSID($NetBSD: citrus_ctype.c,v 1.6 2011/11/19 18:34:21 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include sys/types.h @@ -113,8 +113,10 @@ _initctypemodule(_citrus_ctype_t cc, cha cc-cc_ops-co_wcstombs == NULL || cc-cc_ops-co_wctomb == NULL || cc-cc_ops-co_btowc == NULL || - cc-cc_ops-co_wctob == NULL) + cc-cc_ops-co_wctob == NULL) { + ret = EINVAL; goto bad; + } /* init and get closure */ ret = (*cc-cc_ops-co_init)( Index: src/lib/libc/citrus/citrus_iconv.c diff -u src/lib/libc/citrus/citrus_iconv.c:1.9 src/lib/libc/citrus/citrus_iconv.c:1.10 --- src/lib/libc/citrus/citrus_iconv.c:1.9 Wed Mar 30 08:22:01 2011 +++ src/lib/libc/citrus/citrus_iconv.c Sat Nov 19 18:34:21 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_iconv.c,v 1.9 2011/03/30 08:22:01 jruoho Exp $ */ +/* $NetBSD: citrus_iconv.c,v 1.10 2011/11/19 18:34:21 tnozaki Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: citrus_iconv.c,v 1.9 2011/03/30 08:22:01 jruoho Exp $); +__RCSID($NetBSD: citrus_iconv.c,v 1.10 2011/11/19 18:34:21 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h @@ -222,8 +222,10 @@ open_shared(struct _citrus_iconv_shared ci-ci_ops-io_uninit_shared == NULL || ci-ci_ops-io_init_context == NULL || ci-ci_ops-io_uninit_context == NULL || - ci-ci_ops-io_convert == NULL) + ci-ci_ops-io_convert == NULL) { + ret = EINVAL; goto err; + } /* initialize the converter */ ret = (*ci-ci_ops-io_init_shared)(ci, basedir, src, dst,
CVS commit: src/lib/libc/citrus
Module Name:src Committed By: tnozaki Date: Sat Nov 19 18:43:40 UTC 2011 Modified Files: src/lib/libc/citrus: citrus_mapper.c Log Message: remove useless free(), pointed by nonaka-san(again^2). To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/libc/citrus/citrus_mapper.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/citrus_mapper.c diff -u src/lib/libc/citrus/citrus_mapper.c:1.8 src/lib/libc/citrus/citrus_mapper.c:1.9 --- src/lib/libc/citrus/citrus_mapper.c:1.8 Sat Nov 19 18:39:58 2011 +++ src/lib/libc/citrus/citrus_mapper.c Sat Nov 19 18:43:40 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_mapper.c,v 1.8 2011/11/19 18:39:58 tnozaki Exp $ */ +/* $NetBSD: citrus_mapper.c,v 1.9 2011/11/19 18:43:40 tnozaki Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: citrus_mapper.c,v 1.8 2011/11/19 18:39:58 tnozaki Exp $); +__RCSID($NetBSD: citrus_mapper.c,v 1.9 2011/11/19 18:43:40 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h @@ -103,7 +103,6 @@ _citrus_mapper_create_area( ma-ma_dir = strdup(area); if (ma-ma_dir == NULL) { ret = errno; - free(ma-ma_dir); goto quit; } _CITRUS_HASH_INIT(ma-ma_cache, CM_HASH_SIZE);
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: tnozaki Date: Sat Nov 19 18:48:39 UTC 2011 Modified Files: src/lib/libc/citrus/modules: citrus_mapper_std.c Log Message: fix memory leak, pointed by nonaka-san(again^3). To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/lib/libc/citrus/modules/citrus_mapper_std.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_mapper_std.c diff -u src/lib/libc/citrus/modules/citrus_mapper_std.c:1.9 src/lib/libc/citrus/modules/citrus_mapper_std.c:1.10 --- src/lib/libc/citrus/modules/citrus_mapper_std.c:1.9 Sun Oct 30 21:48:27 2011 +++ src/lib/libc/citrus/modules/citrus_mapper_std.c Sat Nov 19 18:48:39 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_mapper_std.c,v 1.9 2011/10/30 21:48:27 wiz Exp $ */ +/* $NetBSD: citrus_mapper_std.c,v 1.10 2011/11/19 18:48:39 tnozaki Exp $ */ /*- * Copyright (c)2003, 2006 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: citrus_mapper_std.c,v 1.9 2011/10/30 21:48:27 wiz Exp $); +__RCSID($NetBSD: citrus_mapper_std.c,v 1.10 2011/11/19 18:48:39 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include assert.h @@ -185,8 +185,11 @@ rowcol_parse_variable_compat(struct _cit n = be32toh(rcx-rcx_src_row_end); if (m + n 0) { ret = set_linear_zone(lz, m, n); - if (ret != 0) + if (ret != 0) { + free(rc-rc_src_rowcol); + rc-rc_src_rowcol = NULL; return ret; + } ++rc-rc_src_rowcol_len, ++lz; } m = be32toh(rcx-rcx_src_col_begin);
CVS commit: src/lib/libc/citrus
Module Name:src Committed By: tnozaki Date: Sat Nov 19 18:39:58 UTC 2011 Modified Files: src/lib/libc/citrus: citrus_mapper.c citrus_stdenc.c Log Message: return EINVAL when module validation failed, pointed by nonaka-san(again). To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libc/citrus/citrus_mapper.c cvs rdiff -u -r1.3 -r1.4 src/lib/libc/citrus/citrus_stdenc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/citrus_mapper.c diff -u src/lib/libc/citrus/citrus_mapper.c:1.7 src/lib/libc/citrus/citrus_mapper.c:1.8 --- src/lib/libc/citrus/citrus_mapper.c:1.7 Fri Jul 25 14:05:25 2008 +++ src/lib/libc/citrus/citrus_mapper.c Sat Nov 19 18:39:58 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_mapper.c,v 1.7 2008/07/25 14:05:25 christos Exp $ */ +/* $NetBSD: citrus_mapper.c,v 1.8 2011/11/19 18:39:58 tnozaki Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: citrus_mapper.c,v 1.7 2008/07/25 14:05:25 christos Exp $); +__RCSID($NetBSD: citrus_mapper.c,v 1.8 2011/11/19 18:39:58 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h @@ -251,8 +251,10 @@ mapper_open(struct _citrus_mapper_area * if (!cm-cm_ops-mo_init || !cm-cm_ops-mo_uninit || !cm-cm_ops-mo_convert || - !cm-cm_ops-mo_init_state) + !cm-cm_ops-mo_init_state) { + ret = EINVAL; goto err; + } /* allocate traits structure */ cm-cm_traits = malloc(sizeof(*cm-cm_traits)); Index: src/lib/libc/citrus/citrus_stdenc.c diff -u src/lib/libc/citrus/citrus_stdenc.c:1.3 src/lib/libc/citrus/citrus_stdenc.c:1.4 --- src/lib/libc/citrus/citrus_stdenc.c:1.3 Sat Oct 29 18:02:04 2005 +++ src/lib/libc/citrus/citrus_stdenc.c Sat Nov 19 18:39:58 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_stdenc.c,v 1.3 2005/10/29 18:02:04 tshiozak Exp $ */ +/* $NetBSD: citrus_stdenc.c,v 1.4 2011/11/19 18:39:58 tnozaki Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: citrus_stdenc.c,v 1.3 2005/10/29 18:02:04 tshiozak Exp $); +__RCSID($NetBSD: citrus_stdenc.c,v 1.4 2011/11/19 18:39:58 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h @@ -128,8 +128,10 @@ _citrus_stdenc_open(struct _citrus_stden ce-ce_ops-eo_cstomb == NULL || ce-ce_ops-eo_mbtowc == NULL || ce-ce_ops-eo_wctomb == NULL || - ce-ce_ops-eo_get_state_desc == NULL) + ce-ce_ops-eo_get_state_desc == NULL) { + ret = EINVAL; goto bad; + } /* allocate traits */ ce-ce_traits = malloc(sizeof(*ce-ce_traits));
CVS commit: src/lib/libc/citrus
Module Name:src Committed By: tnozaki Date: Sun Nov 20 07:43:53 UTC 2011 Modified Files: src/lib/libc/citrus: citrus_csmapper.c Log Message: add comment about r1.6 - r1.7 change. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/lib/libc/citrus/citrus_csmapper.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/citrus_csmapper.c diff -u src/lib/libc/citrus/citrus_csmapper.c:1.10 src/lib/libc/citrus/citrus_csmapper.c:1.11 --- src/lib/libc/citrus/citrus_csmapper.c:1.10 Sun Jan 11 02:46:24 2009 +++ src/lib/libc/citrus/citrus_csmapper.c Sun Nov 20 07:43:52 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_csmapper.c,v 1.10 2009/01/11 02:46:24 christos Exp $ */ +/* $NetBSD: citrus_csmapper.c,v 1.11 2011/11/20 07:43:52 tnozaki Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: citrus_csmapper.c,v 1.10 2009/01/11 02:46:24 christos Exp $); +__RCSID($NetBSD: citrus_csmapper.c,v 1.11 2011/11/20 07:43:52 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h @@ -142,6 +142,7 @@ find_best_pivot_pvdb(const char *src, co if (ret) goto quit3; if (_db_lookup_by_s(db3, dst, r2, NULL) != 0) + /* don't break the loop, test all src/dst pairs. */ goto quit4; /* r2: norm among pivot and dst */ ret = get32(r2, val32);
CVS commit: src/dist/nvi/regex
Module Name:src Committed By: tnozaki Date: Sat Nov 19 17:45:11 UTC 2011 Modified Files: src/dist/nvi/regex: engine.c regcomp.c regex2.h Log Message: reliability fix, merge libc/regex fix to avoid memory exhaust problem. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/dist/nvi/regex/engine.c \ src/dist/nvi/regex/regcomp.c cvs rdiff -u -r1.3 -r1.4 src/dist/nvi/regex/regex2.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: tnozaki Date: Sat Nov 19 18:20:13 UTC 2011 Modified Files: src/lib/libc/citrus/modules: citrus_dechanyu.c citrus_viqr.c Log Message: remove unused variable, pointed by nonaka-san, thanks. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/libc/citrus/modules/citrus_dechanyu.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/citrus/modules/citrus_viqr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/citrus
Module Name:src Committed By: tnozaki Date: Sat Nov 19 18:39:58 UTC 2011 Modified Files: src/lib/libc/citrus: citrus_mapper.c citrus_stdenc.c Log Message: return EINVAL when module validation failed, pointed by nonaka-san(again). To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libc/citrus/citrus_mapper.c cvs rdiff -u -r1.3 -r1.4 src/lib/libc/citrus/citrus_stdenc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/citrus
Module Name:src Committed By: tnozaki Date: Sat Nov 19 18:43:40 UTC 2011 Modified Files: src/lib/libc/citrus: citrus_mapper.c Log Message: remove useless free(), pointed by nonaka-san(again^2). To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/libc/citrus/citrus_mapper.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: tnozaki Date: Sat Nov 19 18:48:39 UTC 2011 Modified Files: src/lib/libc/citrus/modules: citrus_mapper_std.c Log Message: fix memory leak, pointed by nonaka-san(again^3). To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/lib/libc/citrus/modules/citrus_mapper_std.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/citrus
Module Name:src Committed By: tnozaki Date: Sun Nov 20 07:43:53 UTC 2011 Modified Files: src/lib/libc/citrus: citrus_csmapper.c Log Message: add comment about r1.6 - r1.7 change. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/lib/libc/citrus/citrus_csmapper.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/dist/nvi/vi
Module Name:src Committed By: tnozaki Date: Wed Nov 16 14:24:43 UTC 2011 Modified Files: src/dist/nvi/vi: vs_line.c Log Message: use ARG_CHAR_T instead of CHAR_T for integer promotion. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/dist/nvi/vi/vs_line.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/dist/nvi/vi/vs_line.c diff -u src/dist/nvi/vi/vs_line.c:1.5 src/dist/nvi/vi/vs_line.c:1.6 --- src/dist/nvi/vi/vs_line.c:1.5 Sun Apr 19 02:28:19 2009 +++ src/dist/nvi/vi/vs_line.c Wed Nov 16 14:24:43 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: vs_line.c,v 1.5 2009/04/19 02:28:19 tnozaki Exp $ */ +/* $NetBSD: vs_line.c,v 1.6 2011/11/16 14:24:43 tnozaki Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -52,7 +52,7 @@ vs_line(SCR *sp, SMAP *smp, size_t *yp, int list_tab, list_dollar; CHAR_T *p; CHAR_T *cbp, *ecbp, cbuf[128]; - CHAR_T ch = '\0'; + ARG_CHAR_T ch = L('\0'); #if defined(DEBUG) 0 vtrace(sp, vs_line: row %u: line: %u off: %u\n, @@ -268,7 +268,7 @@ empty: (void)gp-scr_addstr(sp, /* Do it the hard way, for leftright scrolling screens. */ if (O_ISSET(sp, O_LEFTRIGHT)) { for (; offset_in_line len; ++offset_in_line) { - chlen = (ch = *p++) == L('\t') !list_tab ? + chlen = (ch = (UCHAR_T)*p++) == L('\t') !list_tab ? TAB_OFF(scno) : KEY_COL(sp, ch); if ((scno += chlen) = skip_cols) break; @@ -295,7 +295,7 @@ empty: (void)gp-scr_addstr(sp, /* Do it the hard way, for historic line-folding screens. */ else { for (; offset_in_line len; ++offset_in_line) { - chlen = (ch = *p++) == L('\t') !list_tab ? + chlen = (ch = (UCHAR_T)*p++) == L('\t') !list_tab ? TAB_OFF(scno) : KEY_COL(sp, ch); if ((scno += chlen) cols_per_screen) continue; @@ -345,7 +345,7 @@ display: ecbp = (cbp = cbuf) + sizeof(cbuf)/sizeof(CHAR_T) - 1; for (is_partial = 0, scno = 0; offset_in_line len; ++offset_in_line, offset_in_char = 0) { - if ((ch = *p++) == L('\t') !list_tab) { + if ((ch = (UCHAR_T)*p++) == L('\t') !list_tab) { scno += chlen = TAB_OFF(scno) - offset_in_char; is_tab = 1; } else { @@ -465,10 +465,10 @@ display: if (list_dollar) { ++scno; - chlen = KEY_LEN(sp, '$'); + chlen = KEY_LEN(sp, L('$')); if (cbp + chlen = ecbp) FLUSH; - for (kp = KEY_NAME(sp, '$'); chlen--;) + for (kp = KEY_NAME(sp, L('$')); chlen--;) *cbp++ = *kp++; }
CVS commit: src/dist/nvi/vi
Module Name:src Committed By: tnozaki Date: Wed Nov 16 14:24:43 UTC 2011 Modified Files: src/dist/nvi/vi: vs_line.c Log Message: use ARG_CHAR_T instead of CHAR_T for integer promotion. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/dist/nvi/vi/vs_line.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/dist/nvi/common
Module Name:src Committed By: tnozaki Date: Mon Nov 14 13:29:07 UTC 2011 Modified Files: src/dist/nvi/common: key.h Log Message: nvi cannot display international character(west european accented chars). reported by Ian D. Leroux at current-users, thanks a lot! To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/dist/nvi/common/key.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/dist/nvi/common/key.h diff -u src/dist/nvi/common/key.h:1.2 src/dist/nvi/common/key.h:1.3 --- src/dist/nvi/common/key.h:1.2 Mon Mar 21 14:53:02 2011 +++ src/dist/nvi/common/key.h Mon Nov 14 13:29:07 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: key.h,v 1.2 2011/03/21 14:53:02 tnozaki Exp $ */ +/* $NetBSD: key.h,v 1.3 2011/11/14 13:29:07 tnozaki Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -28,7 +28,7 @@ sp-conv.input2int(sp, n, nlen, (cw), wlen, w) #define CONST #define CHAR_WIDTH(sp, ch) wcwidth(ch) -#define INTISWIDE(c) (!!(c 8)) /* XXX wrong name */ +#define INTISWIDE(c) (wctob(c) == EOF) /* XXX wrong name */ #else #define FILE2INT5(sp,buf,n,nlen,w,wlen) \ (w = n, wlen = nlen, 0)
CVS commit: src/dist/nvi/common
Module Name:src Committed By: tnozaki Date: Mon Nov 14 13:29:07 UTC 2011 Modified Files: src/dist/nvi/common: key.h Log Message: nvi cannot display international character(west european accented chars). reported by Ian D. Leroux at current-users, thanks a lot! To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/dist/nvi/common/key.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: tnozaki Date: Mon Oct 10 22:45:45 UTC 2011 Modified Files: src/lib/libc/citrus/modules: citrus_iso2022.c Log Message: revert r1.21, still problem exists for posix2008 mbsnrtowcs(not yet commited), but i have no time to investigate t_mbrtowc failure. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/lib/libc/citrus/modules/citrus_iso2022.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: tnozaki Date: Fri Oct 7 18:59:13 UTC 2011 Modified Files: src/lib/libc/citrus/modules: citrus_iso2022.c Log Message: update string pointer when input is partial escape sequence or multibyte. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/lib/libc/citrus/modules/citrus_iso2022.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/modules/citrus_iso2022.c diff -u src/lib/libc/citrus/modules/citrus_iso2022.c:1.20 src/lib/libc/citrus/modules/citrus_iso2022.c:1.21 --- src/lib/libc/citrus/modules/citrus_iso2022.c:1.20 Tue Dec 7 22:01:45 2010 +++ src/lib/libc/citrus/modules/citrus_iso2022.c Fri Oct 7 18:59:13 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_iso2022.c,v 1.20 2010/12/07 22:01:45 joerg Exp $ */ +/* $NetBSD: citrus_iso2022.c,v 1.21 2011/10/07 18:59:13 tnozaki Exp $ */ /*- * Copyright (c)1999, 2002 Citrus Project, @@ -30,7 +30,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: citrus_iso2022.c,v 1.20 2010/12/07 22:01:45 joerg Exp $); +__RCSID($NetBSD: citrus_iso2022.c,v 1.21 2011/10/07 18:59:13 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include assert.h @@ -695,7 +695,7 @@ _ISO2022_sgetwchar(_ISO2022EncodingInfo if (n sp-len) { if (nmatch == n) { if (result) - *result = string; + *result = string + n; return (_ISO2022INVALID); } } else { @@ -755,7 +755,7 @@ asis: /* we still need to wait for more characters to come */ if (result) - *result = string; + *result = string + n; return (_ISO2022INVALID); case CS94: @@ -765,7 +765,7 @@ asis: /* we still need to wait for more characters to come */ if (result) - *result = string; + *result = string + n; return (_ISO2022INVALID); }
CVS commit: src/lib/libc/citrus/modules
Module Name:src Committed By: tnozaki Date: Fri Oct 7 18:59:13 UTC 2011 Modified Files: src/lib/libc/citrus/modules: citrus_iso2022.c Log Message: update string pointer when input is partial escape sequence or multibyte. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/lib/libc/citrus/modules/citrus_iso2022.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/dist/nvi
Module Name:src Committed By: tnozaki Date: Mon Mar 21 14:53:04 UTC 2011 Modified Files: src/dist/nvi/clib: mkstemp.c src/dist/nvi/common: cut.c cut.h extern.h gs.h key.c key.h msg.c multibyte.h options.c seq.c util.c src/dist/nvi/ex: ex.c ex_abbrev.c ex_argv.c ex_cscope.c ex_display.c ex_global.c ex_join.c ex_map.c ex_perl.c ex_shell.c ex_subst.c ex_tag.c ex_tcl.c ex_txt.c ex_usage.c ex_write.c src/dist/nvi/ip: ip_main.c src/dist/nvi/motif_l: m_vi.c src/dist/nvi/regex: regcomp.c regex2.h src/dist/nvi/vi: getc.c v_increment.c v_match.c v_replace.c v_search.c v_sentence.c v_txt.c v_ulcase.c v_util.c v_word.c vi.c vi.h Log Message: 1. fix PR/44455, nonprintable character doesn't show hex-visual under big endian. 2. :set octal with nonprintable character causes nbwcurses move error. 3. moving (big)words by wW/eE/bB can't handle non-ascii characters. 4. toggle uppercase/lowercase by ~ can't handle non-ascii characters. 5. don't feed CHAR_T(=wchar_t) to is* function directly. is* funcs with over UCHAR_MAX value may cause undefined behavior. some ctype implementation(such as FreeBSD) return unexpected result(same result as isw* func). 6. using non-ascii digit character with count/line number of ex/vi command may causes unexpeced result. To generate a diff of this commit: cvs rdiff -u -r1.1.1.2 -r1.2 src/dist/nvi/clib/mkstemp.c cvs rdiff -u -r1.3 -r1.4 src/dist/nvi/common/cut.c src/dist/nvi/common/cut.h \ src/dist/nvi/common/extern.h src/dist/nvi/common/msg.c \ src/dist/nvi/common/util.c cvs rdiff -u -r1.4 -r1.5 src/dist/nvi/common/gs.h cvs rdiff -u -r1.5 -r1.6 src/dist/nvi/common/key.c \ src/dist/nvi/common/multibyte.h cvs rdiff -u -r1.1.1.2 -r1.2 src/dist/nvi/common/key.h cvs rdiff -u -r1.9 -r1.10 src/dist/nvi/common/options.c cvs rdiff -u -r1.2 -r1.3 src/dist/nvi/common/seq.c cvs rdiff -u -r1.6 -r1.7 src/dist/nvi/ex/ex.c src/dist/nvi/ex/ex_cscope.c cvs rdiff -u -r1.1.1.2 -r1.2 src/dist/nvi/ex/ex_abbrev.c \ src/dist/nvi/ex/ex_map.c src/dist/nvi/ex/ex_perl.c \ src/dist/nvi/ex/ex_tcl.c cvs rdiff -u -r1.3 -r1.4 src/dist/nvi/ex/ex_argv.c \ src/dist/nvi/ex/ex_global.c src/dist/nvi/ex/ex_subst.c \ src/dist/nvi/ex/ex_write.c cvs rdiff -u -r1.2 -r1.3 src/dist/nvi/ex/ex_display.c \ src/dist/nvi/ex/ex_join.c cvs rdiff -u -r1.4 -r1.5 src/dist/nvi/ex/ex_shell.c cvs rdiff -u -r1.8 -r1.9 src/dist/nvi/ex/ex_tag.c cvs rdiff -u -r1.5 -r1.6 src/dist/nvi/ex/ex_txt.c src/dist/nvi/ex/ex_usage.c cvs rdiff -u -r1.1.1.2 -r1.2 src/dist/nvi/ip/ip_main.c cvs rdiff -u -r1.1.1.2 -r1.2 src/dist/nvi/motif_l/m_vi.c cvs rdiff -u -r1.5 -r1.6 src/dist/nvi/regex/regcomp.c cvs rdiff -u -r1.2 -r1.3 src/dist/nvi/regex/regex2.h cvs rdiff -u -r1.2 -r1.3 src/dist/nvi/vi/getc.c src/dist/nvi/vi/v_replace.c \ src/dist/nvi/vi/v_sentence.c src/dist/nvi/vi/v_ulcase.c \ src/dist/nvi/vi/v_util.c src/dist/nvi/vi/v_word.c cvs rdiff -u -r1.4 -r1.5 src/dist/nvi/vi/v_increment.c \ src/dist/nvi/vi/v_match.c cvs rdiff -u -r1.3 -r1.4 src/dist/nvi/vi/v_search.c src/dist/nvi/vi/vi.c \ src/dist/nvi/vi/vi.h cvs rdiff -u -r1.6 -r1.7 src/dist/nvi/vi/v_txt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Tue Nov 30 15:25:05 UTC 2010 Modified Files: src/lib/libc/locale: rune.c Log Message: variable must to be nul terminated before CODESET=foo. ISO2022 module doesn't understand this and may fail setlocale(3). To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/lib/libc/locale/rune.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/locale/rune.c diff -u src/lib/libc/locale/rune.c:1.40 src/lib/libc/locale/rune.c:1.41 --- src/lib/libc/locale/rune.c:1.40 Sat Jun 19 14:48:16 2010 +++ src/lib/libc/locale/rune.c Tue Nov 30 15:25:05 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rune.c,v 1.40 2010/06/19 14:48:16 tnozaki Exp $ */ +/* $NetBSD: rune.c,v 1.41 2010/11/30 15:25:05 tnozaki Exp $ */ /*- * Copyright (c)2010 Citrus Project, @@ -107,14 +107,18 @@ static __inline void _rune_find_codeset(char *s, size_t n, -const char *var, size_t lenvar) +char *var, size_t *plenvar) { + size_t lenvar; const char *endvar; #define _RUNE_CODESET_LEN (sizeof(_RUNE_CODESET)-1) + lenvar = *plenvar; for (/**/; lenvar _RUNE_CODESET_LEN; ++var, --lenvar) { if (!memcmp(var, _RUNE_CODESET, _RUNE_CODESET_LEN)) { + *var = '\0'; + *plenvar -= lenvar; endvar = var[_RUNE_CODESET_LEN]; while (n-- 1 lenvar-- _RUNE_CODESET_LEN) { if (*endvar == ' ' || *endvar == '\t') @@ -226,7 +230,7 @@ } _rune_find_codeset(rlp-rlp_codeset, sizeof(rlp-rlp_codeset), - (const char *)rl-rl_variable, rl-rl_variable_len); + (char *)rl-rl_variable, rl-rl_variable_len); ret = _citrus_ctype_open(rl-rl_citrus_ctype, frl-frl_encoding, rl-rl_variable, rl-rl_variable_len, _PRIVSIZE);
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Tue Nov 30 15:25:05 UTC 2010 Modified Files: src/lib/libc/locale: rune.c Log Message: variable must to be nul terminated before CODESET=foo. ISO2022 module doesn't understand this and may fail setlocale(3). To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/lib/libc/locale/rune.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libcurses
Module Name:src Committed By: tnozaki Date: Tue Nov 23 05:38:35 UTC 2010 Modified Files: src/lib/libcurses: addbytes.c Log Message: to initialize mbstate_t, use memset instead mbrtowc. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/lib/libcurses/addbytes.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libcurses/addbytes.c diff -u src/lib/libcurses/addbytes.c:1.36 src/lib/libcurses/addbytes.c:1.37 --- src/lib/libcurses/addbytes.c:1.36 Tue Feb 23 19:48:26 2010 +++ src/lib/libcurses/addbytes.c Tue Nov 23 05:38:35 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: addbytes.c,v 1.36 2010/02/23 19:48:26 drochner Exp $ */ +/* $NetBSD: addbytes.c,v 1.37 2010/11/23 05:38:35 tnozaki Exp $ */ /* * Copyright (c) 1987, 1993, 1994 @@ -34,11 +34,12 @@ #if 0 static char sccsid[] = @(#)addbytes.c 8.4 (Berkeley) 5/4/94; #else -__RCSID($NetBSD: addbytes.c,v 1.36 2010/02/23 19:48:26 drochner Exp $); +__RCSID($NetBSD: addbytes.c,v 1.37 2010/11/23 05:38:35 tnozaki Exp $); #endif #endif/* not lint */ #include stdlib.h +#include string.h #include curses.h #include curses_private.h #ifdef DEBUG @@ -129,7 +130,7 @@ lp = win-alines[y]; #ifdef HAVE_WCHAR - (void)mbrtowc(NULL, NULL, (size_t)0, st); + (void)memset(st, 0, sizeof(st)); #endif while (count 0) { #ifndef HAVE_WCHAR @@ -156,7 +157,7 @@ /* not a valid conversion just eat a char */ wc = *bytes; n = 1; - (void)mbrtowc(NULL, NULL, (size_t)0, st); + (void)memset(st, 0, sizeof(st)); } else if (wc == 0) { break; }
CVS commit: src/lib/libcurses
Module Name:src Committed By: tnozaki Date: Tue Nov 23 05:38:35 UTC 2010 Modified Files: src/lib/libcurses: addbytes.c Log Message: to initialize mbstate_t, use memset instead mbrtowc. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/lib/libcurses/addbytes.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/stdio
Module Name:src Committed By: tnozaki Date: Mon Sep 27 16:50:13 UTC 2010 Modified Files: src/lib/libc/stdio: fmemopen.c Log Message: fix off-by-one, pointed out by enami-san, thanks! To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/libc/stdio/fmemopen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/stdio/fmemopen.c diff -u src/lib/libc/stdio/fmemopen.c:1.3 src/lib/libc/stdio/fmemopen.c:1.4 --- src/lib/libc/stdio/fmemopen.c:1.3 Sat Sep 25 14:00:30 2010 +++ src/lib/libc/stdio/fmemopen.c Mon Sep 27 16:50:13 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: fmemopen.c,v 1.3 2010/09/25 14:00:30 tron Exp $ */ +/* $NetBSD: fmemopen.c,v 1.4 2010/09/27 16:50:13 tnozaki Exp $ */ /*- * Copyright (c)2007, 2010 Takehiko NOZAKI, @@ -29,7 +29,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: fmemopen.c,v 1.3 2010/09/25 14:00:30 tron Exp $); +__RCSID($NetBSD: fmemopen.c,v 1.4 2010/09/27 16:50:13 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include assert.h @@ -70,7 +70,7 @@ fmemopen_write(void *cookie, const char *buf, int nbytes) { struct fmemopen_cookie *p; - char *s, *t; + char *s; _DIAGASSERT(cookie != NULL); _DIAGASSERT(buf != NULL nbytes 0); @@ -79,16 +79,18 @@ if (p-cur = p-tail) return 0; s = p-cur; - t = p-tail - 1; do { - if (p-cur == t) { - if (*buf == '\0') -*p-cur++ = *buf++; + if (p-cur == p-tail - 1) { + if (*buf == '\0') { +*p-cur++ = '\0'; +goto ok; + } break; } *p-cur++ = *buf++; } while (--nbytes 0); *p-cur = '\0'; +ok: if (p-cur p-eob) p-eob = p-cur;
CVS commit: src/lib/libc/stdio
Module Name:src Committed By: tnozaki Date: Mon Sep 27 17:08:29 UTC 2010 Modified Files: src/lib/libc/stdio: fmemopen.c Log Message: validate flags/oflags from __sflag() befere call __sfp(). reviewed by enami-san, thanks. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/libc/stdio/fmemopen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/stdio/fmemopen.c diff -u src/lib/libc/stdio/fmemopen.c:1.4 src/lib/libc/stdio/fmemopen.c:1.5 --- src/lib/libc/stdio/fmemopen.c:1.4 Mon Sep 27 16:50:13 2010 +++ src/lib/libc/stdio/fmemopen.c Mon Sep 27 17:08:29 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: fmemopen.c,v 1.4 2010/09/27 16:50:13 tnozaki Exp $ */ +/* $NetBSD: fmemopen.c,v 1.5 2010/09/27 17:08:29 tnozaki Exp $ */ /*- * Copyright (c)2007, 2010 Takehiko NOZAKI, @@ -29,7 +29,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: fmemopen.c,v 1.4 2010/09/27 16:50:13 tnozaki Exp $); +__RCSID($NetBSD: fmemopen.c,v 1.5 2010/09/27 17:08:29 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include assert.h @@ -154,29 +154,25 @@ FILE * fmemopen(void * __restrict buf, size_t size, const char * __restrict mode) { - int oflags; + int flags, oflags; FILE *fp; struct fmemopen_cookie *cookie; - if (size (size_t)1) { - errno = EINVAL; + if (size (size_t)1) + goto invalid; + + flags = __sflags(mode, oflags); + if (flags == 0) return NULL; - } + + if ((oflags O_RDWR) == 0 buf == NULL) + goto invalid; fp = __sfp(); if (fp == NULL) return NULL; fp-_file = -1; - fp-_flags = __sflags(mode, oflags); - if (fp-_flags == 0) - return NULL; - - if ((oflags O_RDWR) == 0 buf == NULL) { - errno = EINVAL; - goto release; - } - cookie = malloc(sizeof(*cookie)); if (cookie == NULL) goto release; @@ -206,13 +202,18 @@ cookie-cur = (oflags O_APPEND) ? cookie-eob : cookie-head; - fp-_write = (fp-_flags __SRD) ? NULL : fmemopen_write; - fp-_read = (fp-_flags __SWR) ? NULL : fmemopen_read; + fp-_flags = flags; + fp-_write = (flags __SRD) ? NULL : fmemopen_write; + fp-_read = (flags __SWR) ? NULL : fmemopen_read; fp-_seek = fmemopen_seek; fp-_cookie = (void *)cookie; return fp; +invalid: + errno = EINVAL; + return NULL; + release: fp-_flags = 0; return NULL;
CVS commit: src/lib/libc/stdio
Module Name:src Committed By: tnozaki Date: Mon Sep 27 16:50:13 UTC 2010 Modified Files: src/lib/libc/stdio: fmemopen.c Log Message: fix off-by-one, pointed out by enami-san, thanks! To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/libc/stdio/fmemopen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/stdio
Module Name:src Committed By: tnozaki Date: Mon Sep 27 17:08:29 UTC 2010 Modified Files: src/lib/libc/stdio: fmemopen.c Log Message: validate flags/oflags from __sflag() befere call __sfp(). reviewed by enami-san, thanks. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/libc/stdio/fmemopen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: tnozaki Date: Fri Sep 24 09:21:53 UTC 2010 Modified Files: src/include: stdio.h src/lib/libc: shlib_version src/lib/libc/stdio: Makefile.inc Added Files: src/lib/libc/stdio: fmemopen.c src/tests/lib/libc/stdio: Makefile t_fmemopen.c Log Message: add fmemopen(3) derrived from POSIX:2008. libc minor bump. To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/include/stdio.h cvs rdiff -u -r1.218 -r1.219 src/lib/libc/shlib_version cvs rdiff -u -r1.37 -r1.38 src/lib/libc/stdio/Makefile.inc cvs rdiff -u -r0 -r1.1 src/lib/libc/stdio/fmemopen.c cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/stdio/Makefile \ src/tests/lib/libc/stdio/t_fmemopen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/include/stdio.h diff -u src/include/stdio.h:1.77 src/include/stdio.h:1.78 --- src/include/stdio.h:1.77 Mon Sep 6 14:52:26 2010 +++ src/include/stdio.h Fri Sep 24 09:21:53 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: stdio.h,v 1.77 2010/09/06 14:52:26 christos Exp $ */ +/* $NetBSD: stdio.h,v 1.78 2010/09/24 09:21:53 tnozaki Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -508,6 +508,11 @@ #define putchar_unlocked(x) putc_unlocked(x, stdout) #endif /* _POSIX_C_SOURCE = 199506 || _XOPEN_SOURCE = 500 || _REENTRANT... */ +#if (_POSIX_C_SOURCE - 0) = 200809L || (_XOPEN_SOURCE - 0) = 700 || \ +defined(_NETBSD_SOURCE) +FILE *fmemopen(void * __restrict, size_t, const char * __restrict); +#endif + #if _FORTIFY_SOURCE 0 #include ssp/stdio.h #endif Index: src/lib/libc/shlib_version diff -u src/lib/libc/shlib_version:1.218 src/lib/libc/shlib_version:1.219 --- src/lib/libc/shlib_version:1.218 Mon Jun 7 13:52:29 2010 +++ src/lib/libc/shlib_version Fri Sep 24 09:21:53 2010 @@ -1,4 +1,4 @@ -# $NetBSD: shlib_version,v 1.218 2010/06/07 13:52:29 tnozaki Exp $ +# $NetBSD: shlib_version,v 1.219 2010/09/24 09:21:53 tnozaki Exp $ # Remember to update distrib/sets/lists/base/shl.* when changing # # things we wish to do on next major version bump: @@ -31,4 +31,4 @@ # it's insufficient bitwidth to implement all ctype class. # see isblank's comment in ctype.h. major=12 -minor=173 +minor=174 Index: src/lib/libc/stdio/Makefile.inc diff -u src/lib/libc/stdio/Makefile.inc:1.37 src/lib/libc/stdio/Makefile.inc:1.38 --- src/lib/libc/stdio/Makefile.inc:1.37 Mon Sep 6 14:52:55 2010 +++ src/lib/libc/stdio/Makefile.inc Fri Sep 24 09:21:53 2010 @@ -1,5 +1,5 @@ # from: @(#)Makefile.inc 5.7 (Berkeley) 6/27/91 -# $NetBSD: Makefile.inc,v 1.37 2010/09/06 14:52:55 christos Exp $ +# $NetBSD: Makefile.inc,v 1.38 2010/09/24 09:21:53 tnozaki Exp $ # stdio sources .PATH: ${.CURDIR}/stdio @@ -20,6 +20,7 @@ vasprintf.c vdprintf.c vfprintf.c vfscanf.c vfwprintf.c vfwscanf.c \ vprintf.c vscanf.c vsnprintf.c vsnprintf_ss.c vsscanf.c vswprintf.c \ vswscanf.c vwprintf.c vwscanf.c wbuf.c wprintf.c wscanf.c wsetup.c +SRCS+= fmemopen.c .if !defined(AUDIT) SRCS+= gets.c sprintf.c vsprintf.c tempnam.c tmpnam.c mktemp.c Added files: Index: src/lib/libc/stdio/fmemopen.c diff -u /dev/null src/lib/libc/stdio/fmemopen.c:1.1 --- /dev/null Fri Sep 24 09:21:53 2010 +++ src/lib/libc/stdio/fmemopen.c Fri Sep 24 09:21:53 2010 @@ -0,0 +1,216 @@ +/* $NetBSD: fmemopen.c,v 1.1 2010/09/24 09:21:53 tnozaki Exp $ */ + +/*- + * Copyright (c)2007, 2010 Takehiko NOZAKI, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include sys/cdefs.h +#if defined(LIBC_SCCS) !defined(lint) +__RCSID($NetBSD: fmemopen.c,v 1.1 2010/09/24 09:21:53 tnozaki Exp $); +#endif /* LIBC_SCCS and not lint */ + +#include assert.h +#include
CVS commit: src
Module Name:src Committed By: tnozaki Date: Fri Sep 24 09:21:53 UTC 2010 Modified Files: src/include: stdio.h src/lib/libc: shlib_version src/lib/libc/stdio: Makefile.inc Added Files: src/lib/libc/stdio: fmemopen.c src/tests/lib/libc/stdio: Makefile t_fmemopen.c Log Message: add fmemopen(3) derrived from POSIX:2008. libc minor bump. To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/include/stdio.h cvs rdiff -u -r1.218 -r1.219 src/lib/libc/shlib_version cvs rdiff -u -r1.37 -r1.38 src/lib/libc/stdio/Makefile.inc cvs rdiff -u -r0 -r1.1 src/lib/libc/stdio/fmemopen.c cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/stdio/Makefile \ src/tests/lib/libc/stdio/t_fmemopen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/stdio
Module Name:src Committed By: tnozaki Date: Sat Jul 31 08:47:34 UTC 2010 Modified Files: src/lib/libc/stdio: vfwprintf.c Log Message: initialize fake FILE, not fp. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/lib/libc/stdio/vfwprintf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/stdio/vfwprintf.c diff -u src/lib/libc/stdio/vfwprintf.c:1.20 src/lib/libc/stdio/vfwprintf.c:1.21 --- src/lib/libc/stdio/vfwprintf.c:1.20 Sat Jul 31 07:58:22 2010 +++ src/lib/libc/stdio/vfwprintf.c Sat Jul 31 08:47:34 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: vfwprintf.c,v 1.20 2010/07/31 07:58:22 christos Exp $ */ +/* $NetBSD: vfwprintf.c,v 1.21 2010/07/31 08:47:34 tnozaki Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -38,7 +38,7 @@ static char sccsid[] = @(#)vfprintf.c 8.1 (Berkeley) 6/4/93; __FBSDID($FreeBSD: src/lib/libc/stdio/vfwprintf.c,v 1.27 2007/01/09 00:28:08 imp Exp $); #else -__RCSID($NetBSD: vfwprintf.c,v 1.20 2010/07/31 07:58:22 christos Exp $); +__RCSID($NetBSD: vfwprintf.c,v 1.21 2010/07/31 08:47:34 tnozaki Exp $); #endif #endif /* LIBC_SCCS and not lint */ @@ -163,7 +163,7 @@ _DIAGASSERT(fmt != NULL); _FILEEXT_SETUP(fake, fakeext); - memset(WCIO_GET(fp), 0, sizeof(struct wchar_io_data)); + memset(WCIO_GET(fake), 0, sizeof(struct wchar_io_data)); /* copy the important variables */ fake._flags = fp-_flags ~__SNBF;
CVS commit: src/lib/libc/stdio
Module Name:src Committed By: tnozaki Date: Sat Jul 31 07:24:53 UTC 2010 Modified Files: src/lib/libc/stdio: vfwprintf.c Log Message: fix coredump vfwprintf(stderr) reported in current-user@ rework rev1.9, _FILEEXT_SETUP() doesn't care wcio_data. so initialize it. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/lib/libc/stdio/vfwprintf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/stdio
Module Name:src Committed By: tnozaki Date: Sat Jul 31 08:47:34 UTC 2010 Modified Files: src/lib/libc/stdio: vfwprintf.c Log Message: initialize fake FILE, not fp. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/lib/libc/stdio/vfwprintf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc
Module Name:src Committed By: tnozaki Date: Sat Jun 19 13:26:52 UTC 2010 Modified Files: src/lib/libc/citrus: citrus_lc_ctype.c src/lib/libc/locale: Makefile.inc bsdctype.c bsdctype_local.h global_locale.c localeio.c localeio.h localeio_lc_ctype.c rune.c runetable.c runetype_file.h runetype_local.h Removed Files: src/lib/libc/locale: runeglue.c Log Message: 1. refactoring new locale-db(RuneCT10) loading method with mmap(2). 2. remove unused field from _RuneLocale. 3. localeio(CITRUS=no) can read new locale-db(RuneCT10) now. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/libc/citrus/citrus_lc_ctype.c cvs rdiff -u -r1.57 -r1.58 src/lib/libc/locale/Makefile.inc cvs rdiff -u -r1.7 -r1.8 src/lib/libc/locale/bsdctype.c cvs rdiff -u -r1.1 -r1.2 src/lib/libc/locale/bsdctype_local.h \ src/lib/libc/locale/runetype_file.h cvs rdiff -u -r1.10 -r1.11 src/lib/libc/locale/global_locale.c \ src/lib/libc/locale/runetype_local.h cvs rdiff -u -r1.4 -r1.5 src/lib/libc/locale/localeio.c cvs rdiff -u -r1.3 -r1.4 src/lib/libc/locale/localeio.h cvs rdiff -u -r1.5 -r1.6 src/lib/libc/locale/localeio_lc_ctype.c cvs rdiff -u -r1.38 -r1.39 src/lib/libc/locale/rune.c cvs rdiff -u -r1.20 -r0 src/lib/libc/locale/runeglue.c cvs rdiff -u -r1.26 -r1.27 src/lib/libc/locale/runetable.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/citrus_lc_ctype.c diff -u src/lib/libc/citrus/citrus_lc_ctype.c:1.8 src/lib/libc/citrus/citrus_lc_ctype.c:1.9 --- src/lib/libc/citrus/citrus_lc_ctype.c:1.8 Sun Jun 13 04:14:56 2010 +++ src/lib/libc/citrus/citrus_lc_ctype.c Sat Jun 19 13:26:51 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_lc_ctype.c,v 1.8 2010/06/13 04:14:56 tnozaki Exp $ */ +/* $NetBSD: citrus_lc_ctype.c,v 1.9 2010/06/19 13:26:51 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: citrus_lc_ctype.c,v 1.8 2010/06/13 04:14:56 tnozaki Exp $); +__RCSID($NetBSD: citrus_lc_ctype.c,v 1.9 2010/06/19 13:26:51 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include reentrant.h @@ -56,6 +56,7 @@ #include citrus_aliasname_local.h #include citrus_module.h #include citrus_ctype.h +#include citrus_mmap.h #include runetype_local.h #include multibyte.h @@ -77,9 +78,8 @@ const char * __restrict name, _RuneLocale ** __restrict pdata) { char path[PATH_MAX + 1]; - FILE *fp; - _RuneLocale *data; int ret; + struct _region r; _DIAGASSERT(root != NULL); _DIAGASSERT(name != NULL); @@ -87,37 +87,12 @@ snprintf(path, sizeof(path), %s/%s/LC_CTYPE, root, name); - fp = fopen(path, r); - if (fp == NULL) - return ENOENT; - data = _Read_RuneMagi(fp); - if (data == NULL) { - data = _Read_CTypeAsRune(fp); - if (data == NULL) { - fclose(fp); - return EFTYPE; - } + ret = _citrus_map_file(r, path); + if (!ret) { + ret = _rune_load((const char *)r.r_head, r.r_size, pdata); + _citrus_unmap_file(r); } - fclose(fp); - ret = _citrus_ctype_open(data-rl_citrus_ctype, data-rl_encoding, - data-rl_variable, data-rl_variable_len, _PRIVSIZE); - if (!ret) - ret = __runetable_to_netbsd_ctype(data); - if (ret || __mb_len_max_runtime - _citrus_ctype_get_mb_cur_max(data-rl_citrus_ctype)) { - _NukeRune(data); - return EINVAL; - } - data-rl_wctrans[_WCTRANS_INDEX_LOWER].te_name = tolower; - data-rl_wctrans[_WCTRANS_INDEX_LOWER].te_cached = data-rl_maplower[0]; - data-rl_wctrans[_WCTRANS_INDEX_LOWER].te_extmap = data-rl_maplower_ext; - - data-rl_wctrans[_WCTRANS_INDEX_UPPER].te_name = toupper; - data-rl_wctrans[_WCTRANS_INDEX_UPPER].te_cached = data-rl_mapupper[0]; - data-rl_wctrans[_WCTRANS_INDEX_UPPER].te_extmap = data-rl_mapupper_ext; - - *pdata = data; - return 0; + return ret; } static __inline void Index: src/lib/libc/locale/Makefile.inc diff -u src/lib/libc/locale/Makefile.inc:1.57 src/lib/libc/locale/Makefile.inc:1.58 --- src/lib/libc/locale/Makefile.inc:1.57 Mon Jun 7 13:52:30 2010 +++ src/lib/libc/locale/Makefile.inc Sat Jun 19 13:26:52 2010 @@ -1,5 +1,5 @@ # from: @(#)Makefile.inc 5.1 (Berkeley) 2/18/91 -# $NetBSD: Makefile.inc,v 1.57 2010/06/07 13:52:30 tnozaki Exp $ +# $NetBSD: Makefile.inc,v 1.58 2010/06/19 13:26:52 tnozaki Exp $ # locale sources .PATH: ${ARCHDIR}/locale ${.CURDIR}/locale @@ -16,10 +16,9 @@ # citrus multibyte locale support # we have quirk for libc.a - see the last part of lib/libc/Makefile CPPFLAGS+= -DWITH_RUNE -I${.CURDIR} -SRCS+= _wctrans.c _wctype.c rune.c runeglue.c runetable.c \ +SRCS+= _wctrans.c _wctype.c rune.c runetable.c \ multibyte_c90.c multibyte_amd1.c iswctype_mb.c CPPFLAGS.rune.c+= -I${LIBCDIR}/citrus -CPPFLAGS.runeglue.c+= -I${LIBCDIR}/citrus CPPFLAGS.runetable.c+= -I${LIBCDIR}/citrus CPPFLAGS.multibyte_c90.c+= -I${LIBCDIR}/citrus CPPFLAGS.multibyte_amd1.c+=
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Sun Jun 20 02:23:15 UTC 2010 Modified Files: src/lib/libc/locale: bsdctype.c runetype_file.h runetype_local.h Added Files: src/lib/libc/locale: runetype_misc.h Log Message: fix cross build breakage mklocale(1). move inline finction that uses sys/ctype_bits.h to runetype_misc.h. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/libc/locale/bsdctype.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/runetype_file.h cvs rdiff -u -r1.11 -r1.12 src/lib/libc/locale/runetype_local.h cvs rdiff -u -r0 -r1.1 src/lib/libc/locale/runetype_misc.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/locale/bsdctype.c diff -u src/lib/libc/locale/bsdctype.c:1.8 src/lib/libc/locale/bsdctype.c:1.9 --- src/lib/libc/locale/bsdctype.c:1.8 Sat Jun 19 13:26:52 2010 +++ src/lib/libc/locale/bsdctype.c Sun Jun 20 02:23:15 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: bsdctype.c,v 1.8 2010/06/19 13:26:52 tnozaki Exp $ */ +/* $NetBSD: bsdctype.c,v 1.9 2010/06/20 02:23:15 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: bsdctype.c,v 1.8 2010/06/19 13:26:52 tnozaki Exp $); +__RCSID($NetBSD: bsdctype.c,v 1.9 2010/06/20 02:23:15 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include sys/endian.h @@ -41,7 +41,7 @@ #include unistd.h #include bsdctype_local.h -#include runetype_file.h +#include runetype_misc.h const _BSDCTypeLocale _DefaultBSDCTypeLocale = { _C_ctype_, Index: src/lib/libc/locale/runetype_file.h diff -u src/lib/libc/locale/runetype_file.h:1.2 src/lib/libc/locale/runetype_file.h:1.3 --- src/lib/libc/locale/runetype_file.h:1.2 Sat Jun 19 13:26:52 2010 +++ src/lib/libc/locale/runetype_file.h Sun Jun 20 02:23:15 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: runetype_file.h,v 1.2 2010/06/19 13:26:52 tnozaki Exp $ */ +/* $NetBSD: runetype_file.h,v 1.3 2010/06/20 02:23:15 tnozaki Exp $ */ /*- * Copyright (c) 1993 @@ -39,7 +39,6 @@ #include sys/cdefs.h #include sys/types.h -#include sys/ctype_bits.h #include ctype_local.h @@ -79,93 +78,6 @@ #define _RUNETYPE_SW2 UINT32_C(0x8000) /* 2 width character */ #define _RUNETYPE_SW3 UINT32_C(0xc000) /* 3 width character */ -static __inline int -_runetype_to_ctype(_RuneType bits) -{ - int ret; - - if (bits == (_RuneType)0) - return 0; - ret = 0; - if (bits _RUNETYPE_U) - ret |= _U; - if (bits _RUNETYPE_L) - ret |= _L; - if (bits _RUNETYPE_D) - ret |= _N; - if (bits _RUNETYPE_S) - ret |= _S; - if (bits _RUNETYPE_P) - ret |= _P; - if (bits _RUNETYPE_C) - ret |= _C; - if (bits _RUNETYPE_X) - ret |= _X; - /* - * TWEAK! _B has been used incorrectly (or with older - * declaration) in ctype.h isprint() macro. - * _B does not mean isblank, it means isprint !isgraph. - * the following is okay since isblank() was hardcoded in - * function (i.e. isblank() is inherently locale unfriendly). - */ -#if 1 - if ((bits (_RUNETYPE_R | _RUNETYPE_G)) == _RUNETYPE_R) - ret |= _B; -#else - if (bits _RUNETYPE_B) - ret |= _B; -#endif - return ret; -} - -static __inline _RuneType -_runetype_from_ctype(int bits, int ch) -{ -_RuneType ret; - - /* - * TWEAKS! - * - old locale file declarations do not have proper _B - * in many cases. - * - isprint() declaration in ctype.h incorrectly uses _B. - * _B means isprint but !isgraph, not isblank with the - * declaration. - * - _X and _RUNETYPE_X have negligible difference in meaning. - * - we don't set digit value, fearing that it would be - * too much of hardcoding. we may need to revisit it. - */ - - ret = (_RuneType)0; - if (bits _U) - ret |= _RUNETYPE_U; - if (bits _L) - ret |= _RUNETYPE_L; - if (bits _N) - ret |= _RUNETYPE_D; - if (bits _S) - ret |= _RUNETYPE_S; - if (bits _P) - ret |= _RUNETYPE_P; - if (bits _C) - ret |= _RUNETYPE_C; - /* derived flag bits, duplicate of ctype.h */ - if (bits (_U|_L)) - ret |= _RUNETYPE_A; - if (bits (_N|_X)) - ret |= _RUNETYPE_X; - if (bits (_P|_U|_L|_N)) - ret |= _RUNETYPE_G; - /* we don't really trust _B in the file. see above. */ - if (bits _B) - ret |= _RUNETYPE_B; - if ((bits (_P|_U|_L|_N|_B)) || ch == ' ') - ret |= (_RUNETYPE_R | _RUNETYPE_SW1); - if (ch == ' ' || ch == '\t') - ret |= _RUNETYPE_B; - return ret; -} - - /* * rune file format. network endian. */ Index: src/lib/libc/locale/runetype_local.h diff -u src/lib/libc/locale/runetype_local.h:1.11 src/lib/libc/locale/runetype_local.h:1.12 --- src/lib/libc/locale/runetype_local.h:1.11 Sat Jun 19 13:26:52 2010 +++ src/lib/libc/locale/runetype_local.h Sun Jun 20 02:23:15 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: runetype_local.h,v 1.11 2010/06/19 13:26:52 tnozaki Exp $ */ +/* $NetBSD: runetype_local.h,v 1.12 2010/06/20 02:23:15 tnozaki Exp $ */ /*- * Copyright (c) 1993 @@ -42,7
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Sat Jun 19 14:48:17 UTC 2010 Modified Files: src/lib/libc/locale: rune.c Log Message: null terminate To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/lib/libc/locale/rune.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/chrtbl
Module Name:src Committed By: tnozaki Date: Sat Jun 12 18:02:31 UTC 2010 Modified Files: src/usr.sbin/chrtbl: ctypeio.c Log Message: s/_CTYPE_NUM_CHARS/_CTYPE_CACHE_SIZE/ To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/chrtbl/ctypeio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/chrtbl/ctypeio.c diff -u src/usr.sbin/chrtbl/ctypeio.c:1.3 src/usr.sbin/chrtbl/ctypeio.c:1.4 --- src/usr.sbin/chrtbl/ctypeio.c:1.3 Sat May 22 06:38:16 2010 +++ src/usr.sbin/chrtbl/ctypeio.c Sat Jun 12 18:02:31 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ctypeio.c,v 1.3 2010/05/22 06:38:16 tnozaki Exp $ */ +/* $NetBSD: ctypeio.c,v 1.4 2010/06/12 18:02:31 tnozaki Exp $ */ /* * Copyright (c) 1997 Christos Zoulas. All rights reserved. @@ -26,7 +26,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: ctypeio.c,v 1.3 2010/05/22 06:38:16 tnozaki Exp $); +__RCSID($NetBSD: ctypeio.c,v 1.4 2010/06/12 18:02:31 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include sys/types.h @@ -46,7 +46,7 @@ short *new_toupper, short *new_tolower) { FILE *fp; - uint32_t i, len = _CTYPE_NUM_CHARS; + uint32_t i, len = _CTYPE_CACHE_SIZE; _DIAGASSERT(name != NULL); _DIAGASSERT(new_ctype != NULL);
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Sat Jun 12 18:03:09 UTC 2010 Modified Files: src/lib/libc/locale: bsdctype.h Log Message: s/_CTYPE_NUM_CHARS/_CTYPE_CACHE_SIZE/ To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/libc/locale/bsdctype.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/locale/bsdctype.h diff -u src/lib/libc/locale/bsdctype.h:1.4 src/lib/libc/locale/bsdctype.h:1.5 --- src/lib/libc/locale/bsdctype.h:1.4 Tue Jun 1 18:00:28 2010 +++ src/lib/libc/locale/bsdctype.h Sat Jun 12 18:03:09 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: bsdctype.h,v 1.4 2010/06/01 18:00:28 tnozaki Exp $ */ +/* $NetBSD: bsdctype.h,v 1.5 2010/06/12 18:03:09 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -35,9 +35,9 @@ char fbl_id[8]; uint32_t fbl_rev; uint32_t fbl_num_chars; - uint8_t fbl_ctype_tab [_CTYPE_NUM_CHARS]; - int16_t fbl_tolower_tab[_CTYPE_NUM_CHARS]; - int16_t fbl_toupper_tab[_CTYPE_NUM_CHARS]; + uint8_t fbl_ctype_tab [_CTYPE_CACHE_SIZE]; + int16_t fbl_tolower_tab[_CTYPE_CACHE_SIZE]; + int16_t fbl_toupper_tab[_CTYPE_CACHE_SIZE]; } __packed _FileBSDCTypeLocale; typedef struct {
CVS commit: src
Module Name:src Committed By: tnozaki Date: Sun Jun 13 04:14:57 UTC 2010 Modified Files: src/lib/libc/citrus: citrus_lc_ctype.c citrus_lc_messages.c citrus_lc_monetary.c citrus_lc_numeric.c citrus_lc_time.c src/lib/libc/locale: _wctrans.c _wctype.c bsdctype.c ctype_local.h global_locale.c iswctype_mb.c localeio_lc_ctype.c multibyte_amd1.c multibyte_c90.c rune.c runeglue.c runetable.c runetype_local.h src/usr.bin/mklocale: lex.l yacc.y src/usr.sbin/chrtbl: ctypeio.c Added Files: src/lib/libc/locale: bsdctype_file.h bsdctype_local.h runetype_file.h Removed Files: src/lib/libc/locale: bsdctype.h rune_local.h Log Message: 1. split runetype_local.h - runetype_file.h and remove renameing _Rune* - _NBRune* namespace protection. FreeBSD traditionaly exposes struct _Rune* in runetype.h which included by ctype.h. it may cause conflicting type error in our cross build process, former we use renaming namespace to avoid this problem, now i reworked more resonable way. 2. merge rune_local.h to runetype_local.h, and remove it. 3. split bsdctype.h - bsdctype_{file,local}.h To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libc/citrus/citrus_lc_ctype.c cvs rdiff -u -r1.3 -r1.4 src/lib/libc/citrus/citrus_lc_messages.c \ src/lib/libc/citrus/citrus_lc_monetary.c \ src/lib/libc/citrus/citrus_lc_numeric.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/citrus/citrus_lc_time.c cvs rdiff -u -r1.16 -r1.17 src/lib/libc/locale/_wctrans.c cvs rdiff -u -r1.8 -r1.9 src/lib/libc/locale/_wctype.c \ src/lib/libc/locale/multibyte_amd1.c cvs rdiff -u -r1.6 -r1.7 src/lib/libc/locale/bsdctype.c cvs rdiff -u -r1.5 -r0 src/lib/libc/locale/bsdctype.h cvs rdiff -u -r0 -r1.1 src/lib/libc/locale/bsdctype_file.h \ src/lib/libc/locale/bsdctype_local.h src/lib/libc/locale/runetype_file.h cvs rdiff -u -r1.3 -r1.4 src/lib/libc/locale/ctype_local.h cvs rdiff -u -r1.9 -r1.10 src/lib/libc/locale/global_locale.c \ src/lib/libc/locale/runetype_local.h cvs rdiff -u -r1.10 -r1.11 src/lib/libc/locale/iswctype_mb.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/locale/localeio_lc_ctype.c cvs rdiff -u -r1.7 -r1.8 src/lib/libc/locale/multibyte_c90.c cvs rdiff -u -r1.37 -r1.38 src/lib/libc/locale/rune.c cvs rdiff -u -r1.16 -r0 src/lib/libc/locale/rune_local.h cvs rdiff -u -r1.19 -r1.20 src/lib/libc/locale/runeglue.c cvs rdiff -u -r1.25 -r1.26 src/lib/libc/locale/runetable.c cvs rdiff -u -r1.17 -r1.18 src/usr.bin/mklocale/lex.l cvs rdiff -u -r1.30 -r1.31 src/usr.bin/mklocale/yacc.y cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/chrtbl/ctypeio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/citrus_lc_ctype.c diff -u src/lib/libc/citrus/citrus_lc_ctype.c:1.7 src/lib/libc/citrus/citrus_lc_ctype.c:1.8 --- src/lib/libc/citrus/citrus_lc_ctype.c:1.7 Mon Jun 7 13:52:29 2010 +++ src/lib/libc/citrus/citrus_lc_ctype.c Sun Jun 13 04:14:56 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_lc_ctype.c,v 1.7 2010/06/07 13:52:29 tnozaki Exp $ */ +/* $NetBSD: citrus_lc_ctype.c,v 1.8 2010/06/13 04:14:56 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: citrus_lc_ctype.c,v 1.7 2010/06/07 13:52:29 tnozaki Exp $); +__RCSID($NetBSD: citrus_lc_ctype.c,v 1.8 2010/06/13 04:14:56 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include reentrant.h @@ -57,7 +57,7 @@ #include citrus_module.h #include citrus_ctype.h -#include rune_local.h +#include runetype_local.h #include multibyte.h /* Index: src/lib/libc/citrus/citrus_lc_messages.c diff -u src/lib/libc/citrus/citrus_lc_messages.c:1.3 src/lib/libc/citrus/citrus_lc_messages.c:1.4 --- src/lib/libc/citrus/citrus_lc_messages.c:1.3 Sat May 22 08:13:18 2010 +++ src/lib/libc/citrus/citrus_lc_messages.c Sun Jun 13 04:14:57 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_lc_messages.c,v 1.3 2010/05/22 08:13:18 tnozaki Exp $ */ +/* $NetBSD: citrus_lc_messages.c,v 1.4 2010/06/13 04:14:57 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: citrus_lc_messages.c,v 1.3 2010/05/22 08:13:18 tnozaki Exp $); +__RCSID($NetBSD: citrus_lc_messages.c,v 1.4 2010/06/13 04:14:57 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h @@ -61,7 +61,7 @@ #include citrus_db.h #include citrus_db_hash.h #include citrus_memstream.h -#include rune_local.h +#include runetype_local.h /* * macro required by all template headers Index: src/lib/libc/citrus/citrus_lc_monetary.c diff -u src/lib/libc/citrus/citrus_lc_monetary.c:1.3 src/lib/libc/citrus/citrus_lc_monetary.c:1.4 --- src/lib/libc/citrus/citrus_lc_monetary.c:1.3 Sat May 22 08:13:18 2010 +++ src/lib/libc/citrus/citrus_lc_monetary.c Sun
CVS commit: src/usr.sbin/chrtbl
Module Name:src Committed By: tnozaki Date: Sat Jun 12 18:02:31 UTC 2010 Modified Files: src/usr.sbin/chrtbl: ctypeio.c Log Message: s/_CTYPE_NUM_CHARS/_CTYPE_CACHE_SIZE/ To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/chrtbl/ctypeio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Sat Jun 12 18:03:09 UTC 2010 Modified Files: src/lib/libc/locale: bsdctype.h Log Message: s/_CTYPE_NUM_CHARS/_CTYPE_CACHE_SIZE/ To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/libc/locale/bsdctype.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: tnozaki Date: Sun Jun 13 04:14:57 UTC 2010 Modified Files: src/lib/libc/citrus: citrus_lc_ctype.c citrus_lc_messages.c citrus_lc_monetary.c citrus_lc_numeric.c citrus_lc_time.c src/lib/libc/locale: _wctrans.c _wctype.c bsdctype.c ctype_local.h global_locale.c iswctype_mb.c localeio_lc_ctype.c multibyte_amd1.c multibyte_c90.c rune.c runeglue.c runetable.c runetype_local.h src/usr.bin/mklocale: lex.l yacc.y src/usr.sbin/chrtbl: ctypeio.c Added Files: src/lib/libc/locale: bsdctype_file.h bsdctype_local.h runetype_file.h Removed Files: src/lib/libc/locale: bsdctype.h rune_local.h Log Message: 1. split runetype_local.h - runetype_file.h and remove renameing _Rune* - _NBRune* namespace protection. FreeBSD traditionaly exposes struct _Rune* in runetype.h which included by ctype.h. it may cause conflicting type error in our cross build process, former we use renaming namespace to avoid this problem, now i reworked more resonable way. 2. merge rune_local.h to runetype_local.h, and remove it. 3. split bsdctype.h - bsdctype_{file,local}.h To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libc/citrus/citrus_lc_ctype.c cvs rdiff -u -r1.3 -r1.4 src/lib/libc/citrus/citrus_lc_messages.c \ src/lib/libc/citrus/citrus_lc_monetary.c \ src/lib/libc/citrus/citrus_lc_numeric.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/citrus/citrus_lc_time.c cvs rdiff -u -r1.16 -r1.17 src/lib/libc/locale/_wctrans.c cvs rdiff -u -r1.8 -r1.9 src/lib/libc/locale/_wctype.c \ src/lib/libc/locale/multibyte_amd1.c cvs rdiff -u -r1.6 -r1.7 src/lib/libc/locale/bsdctype.c cvs rdiff -u -r1.5 -r0 src/lib/libc/locale/bsdctype.h cvs rdiff -u -r0 -r1.1 src/lib/libc/locale/bsdctype_file.h \ src/lib/libc/locale/bsdctype_local.h src/lib/libc/locale/runetype_file.h cvs rdiff -u -r1.3 -r1.4 src/lib/libc/locale/ctype_local.h cvs rdiff -u -r1.9 -r1.10 src/lib/libc/locale/global_locale.c \ src/lib/libc/locale/runetype_local.h cvs rdiff -u -r1.10 -r1.11 src/lib/libc/locale/iswctype_mb.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/locale/localeio_lc_ctype.c cvs rdiff -u -r1.7 -r1.8 src/lib/libc/locale/multibyte_c90.c cvs rdiff -u -r1.37 -r1.38 src/lib/libc/locale/rune.c cvs rdiff -u -r1.16 -r0 src/lib/libc/locale/rune_local.h cvs rdiff -u -r1.19 -r1.20 src/lib/libc/locale/runeglue.c cvs rdiff -u -r1.25 -r1.26 src/lib/libc/locale/runetable.c cvs rdiff -u -r1.17 -r1.18 src/usr.bin/mklocale/lex.l cvs rdiff -u -r1.30 -r1.31 src/usr.bin/mklocale/yacc.y cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/chrtbl/ctypeio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/mklocale
Module Name:src Committed By: tnozaki Date: Sat Jun 12 02:51:35 UTC 2010 Modified Files: src/usr.bin/mklocale: lex.l yacc.y Log Message: use _FileRune* instead of _Rune*. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/usr.bin/mklocale/lex.l cvs rdiff -u -r1.29 -r1.30 src/usr.bin/mklocale/yacc.y Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/mklocale/lex.l diff -u src/usr.bin/mklocale/lex.l:1.16 src/usr.bin/mklocale/lex.l:1.17 --- src/usr.bin/mklocale/lex.l:1.16 Mon Jan 5 06:11:43 2009 +++ src/usr.bin/mklocale/lex.l Sat Jun 12 02:51:34 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: lex.l,v 1.16 2009/01/05 06:11:43 tnozaki Exp $ */ +/* $NetBSD: lex.l,v 1.17 2010/06/12 02:51:34 tnozaki Exp $ */ %{ /*- @@ -42,17 +42,18 @@ #if 0 static char sccsid[] = @(#)lex.l 8.1 (Berkeley) 6/6/93; #else -__RCSID($NetBSD: lex.l,v 1.16 2009/01/05 06:11:43 tnozaki Exp $); +__RCSID($NetBSD: lex.l,v 1.17 2010/06/12 02:51:34 tnozaki Exp $); #endif #endif /* not lint */ -#include runetype_local.h #include stdio.h #include stdlib.h #include citrus_namespace.h #include citrus_bcs.h +#include runetype_local.h + #include ldef.h #include yacc.h Index: src/usr.bin/mklocale/yacc.y diff -u src/usr.bin/mklocale/yacc.y:1.29 src/usr.bin/mklocale/yacc.y:1.30 --- src/usr.bin/mklocale/yacc.y:1.29 Sat May 22 17:43:29 2010 +++ src/usr.bin/mklocale/yacc.y Sat Jun 12 02:51:34 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: yacc.y,v 1.29 2010/05/22 17:43:29 tnozaki Exp $ */ +/* $NetBSD: yacc.y,v 1.30 2010/06/12 02:51:34 tnozaki Exp $ */ %{ /*- @@ -43,7 +43,7 @@ static char sccsid[] = @(#)yacc.y 8.1 (Berkeley) 6/6/93; static char rcsid[] = $FreeBSD$; #else -__RCSID($NetBSD: yacc.y,v 1.29 2010/05/22 17:43:29 tnozaki Exp $); +__RCSID($NetBSD: yacc.y,v 1.30 2010/06/12 02:51:34 tnozaki Exp $); #endif #endif /* not lint */ @@ -52,7 +52,6 @@ #include arpa/inet.h /* Needed for htonl on POSIX systems. */ #include err.h -#include runetype_local.h #include locale.h #include stddef.h #include stdio.h @@ -61,6 +60,8 @@ #include unistd.h #include ctype.h +#include runetype_local.h + #include ldef.h const char *locale_file = stdout; @@ -69,7 +70,10 @@ rune_map mapupper = { { 0, }, }; rune_map types = { { 0, }, }; -_NBRuneLocale new_locale = { { 0, }, }; +_FileRuneLocale new_locale = { { 0, }, }; + +size_t rl_variable_len = (size_t)0; +void *rl_variable = NULL; __nbrune_t charsetbits = (__nbrune_t)0x; #if 0 @@ -134,10 +138,11 @@ ; entry : ENCODING STRING - { strncpy(new_locale.rl_encoding, $2, sizeof(new_locale.rl_encoding)); } + { strncpy(new_locale.frl_encoding, $2, sizeof(new_locale.frl_encoding)); } | VARIABLE - { new_locale.rl_variable_len = strlen($1) + 1; - new_locale.rl_variable = strdup($1); + { rl_variable_len = strlen($1) + 1; + rl_variable = strdup($1); + new_locale.frl_variable_len = htonl((u_int32_t)rl_variable_len); } | CHARSET RUNE { charsetbits = $2; charsetmask = 0x007f; } @@ -176,7 +181,7 @@ } } | INVALID RUNE - { new_locale.rl_invalid_rune = $2; } + { new_locale.frl_invalid_rune = htonl((u_int32_t)$2); } | LIST list { set_map(types, $2, $1); } | MAPLOWER map @@ -308,8 +313,8 @@ maplower.map[x] = x; } -new_locale.rl_invalid_rune = _NB_DEFAULT_INVALID_RUNE; -memcpy(new_locale.rl_magic, _NB_RUNE_MAGIC_1, sizeof(new_locale.rl_magic)); +new_locale.frl_invalid_rune = htonl((u_int32_t)_NB_DEFAULT_INVALID_RUNE); +memcpy(new_locale.frl_magic, _NB_RUNE_MAGIC_1, sizeof(new_locale.frl_magic)); yyparse(); @@ -624,10 +629,8 @@ { int x, n; rune_list *list; -_FileRuneLocale file_new_locale; FILE *fp = ofile; - -memset(file_new_locale, 0, sizeof(file_new_locale)); +u_int32_t nranges; /* * See if we can compress some of the istype arrays @@ -642,13 +645,6 @@ } } -memcpy(file_new_locale.frl_magic, new_locale.rl_magic, - sizeof(file_new_locale.frl_magic)); -memcpy(file_new_locale.frl_encoding, new_locale.rl_encoding, - sizeof(file_new_locale.frl_encoding)); - -file_new_locale.frl_invalid_rune = htonl(new_locale.rl_invalid_rune); - /* * Fill in our tables. Do this in network order so that * diverse machines have a chance of sharing data. @@ -656,9 +652,9 @@ * word size. Sigh. We tried.) */ for (x = 0; x _CTYPE_CACHE_SIZE; ++x) { - file_new_locale.frl_runetype[x] = htonl(types.map[x]); - file_new_locale.frl_maplower[x] = htonl(maplower.map[x]); - file_new_locale.frl_mapupper[x] = htonl(mapupper.map[x]); + new_locale.frl_runetype[x] = htonl(types.map[x]); + new_locale.frl_maplower[x] = htonl(maplower.map[x]); + new_locale.frl_mapupper[x] = htonl(mapupper.map[x]); } /* @@ -666,32 +662,33 @@ */ list = types.root; +nranges = (u_int32_t)0; while (list) { -
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Sat Jun 12 05:54:05 UTC 2010 Modified Files: src/lib/libc/locale: iswctype_mb.c rune.c rune_local.h runeglue.c runetable.c Log Message: stop to renaming _CTYPE_* - _RUNETYPE_*. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/lib/libc/locale/iswctype_mb.c cvs rdiff -u -r1.36 -r1.37 src/lib/libc/locale/rune.c cvs rdiff -u -r1.15 -r1.16 src/lib/libc/locale/rune_local.h cvs rdiff -u -r1.18 -r1.19 src/lib/libc/locale/runeglue.c cvs rdiff -u -r1.24 -r1.25 src/lib/libc/locale/runetable.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/locale/iswctype_mb.c diff -u src/lib/libc/locale/iswctype_mb.c:1.9 src/lib/libc/locale/iswctype_mb.c:1.10 --- src/lib/libc/locale/iswctype_mb.c:1.9 Wed Jun 2 15:47:25 2010 +++ src/lib/libc/locale/iswctype_mb.c Sat Jun 12 05:54:05 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: iswctype_mb.c,v 1.9 2010/06/02 15:47:25 tnozaki Exp $ */ +/* $NetBSD: iswctype_mb.c,v 1.10 2010/06/12 05:54:05 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: iswctype_mb.c,v 1.9 2010/06/02 15:47:25 tnozaki Exp $); +__RCSID($NetBSD: iswctype_mb.c,v 1.10 2010/06/12 05:54:05 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h @@ -156,8 +156,8 @@ return 0; rl = _RUNE_LOCALE(); x = _runetype_priv(rl, wc); - if (x _CTYPE_R) - return ((unsigned)x _CTYPE_SWM) _CTYPE_SWS; + if (x _RUNETYPE_R) + return ((unsigned)x _RUNETYPE_SWM) _RUNETYPE_SWS; return -1; } @@ -174,9 +174,9 @@ width = 0; while (wn 0 *ws != L'\0') { x = _runetype_priv(rl, *ws); - if ((x _CTYPE_R) == 0) + if ((x _RUNETYPE_R) == 0) return -1; - width += ((unsigned)x _CTYPE_SWM) _CTYPE_SWS; + width += ((unsigned)x _RUNETYPE_SWM) _RUNETYPE_SWS; ++ws, --wn; } return width; Index: src/lib/libc/locale/rune.c diff -u src/lib/libc/locale/rune.c:1.36 src/lib/libc/locale/rune.c:1.37 --- src/lib/libc/locale/rune.c:1.36 Tue Jun 1 13:52:08 2010 +++ src/lib/libc/locale/rune.c Sat Jun 12 05:54:05 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rune.c,v 1.36 2010/06/01 13:52:08 tnozaki Exp $ */ +/* $NetBSD: rune.c,v 1.37 2010/06/12 05:54:05 tnozaki Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -63,7 +63,7 @@ #if 0 static char sccsid[] = @(#)rune.c 8.1 (Berkeley) 6/4/93; #else -__RCSID($NetBSD: rune.c,v 1.36 2010/06/01 13:52:08 tnozaki Exp $); +__RCSID($NetBSD: rune.c,v 1.37 2010/06/12 05:54:05 tnozaki Exp $); #endif #endif /* LIBC_SCCS and not lint */ @@ -433,37 +433,37 @@ * - isprint() declaration in ctype.h incorrectly uses _B. * _B means isprint but !isgraph, not isblank with the * declaration. - * - _X and _CTYPE_X have negligible difference in meaning. + * - _X and _RUNETYPE_X have negligible difference in meaning. * - we don't set digit value, fearing that it would be * too much of hardcoding. we may need to revisit it. */ if (new_ctype[1 + x] _U) - rl-rl_runetype[x] |= _CTYPE_U; + rl-rl_runetype[x] |= _RUNETYPE_U; if (new_ctype[1 + x] _L) - rl-rl_runetype[x] |= _CTYPE_L; + rl-rl_runetype[x] |= _RUNETYPE_L; if (new_ctype[1 + x] _N) - rl-rl_runetype[x] |= _CTYPE_D; + rl-rl_runetype[x] |= _RUNETYPE_D; if (new_ctype[1 + x] _S) - rl-rl_runetype[x] |= _CTYPE_S; + rl-rl_runetype[x] |= _RUNETYPE_S; if (new_ctype[1 + x] _P) - rl-rl_runetype[x] |= _CTYPE_P; + rl-rl_runetype[x] |= _RUNETYPE_P; if (new_ctype[1 + x] _C) - rl-rl_runetype[x] |= _CTYPE_C; + rl-rl_runetype[x] |= _RUNETYPE_C; /* derived flag bits, duplicate of ctype.h */ if (new_ctype[1 + x] (_U | _L)) - rl-rl_runetype[x] |= _CTYPE_A; + rl-rl_runetype[x] |= _RUNETYPE_A; if (new_ctype[1 + x] (_N | _X)) - rl-rl_runetype[x] |= _CTYPE_X; + rl-rl_runetype[x] |= _RUNETYPE_X; if (new_ctype[1 + x] (_P|_U|_L|_N)) - rl-rl_runetype[x] |= _CTYPE_G; + rl-rl_runetype[x] |= _RUNETYPE_G; /* we don't really trust _B in the file. see above. */ if (new_ctype[1 + x] _B) - rl-rl_runetype[x] |= _CTYPE_B; + rl-rl_runetype[x] |= _RUNETYPE_B; if ((new_ctype[1 + x] (_P|_U|_L|_N|_B)) || x == ' ') - rl-rl_runetype[x] |= (_CTYPE_R | _CTYPE_SW1); + rl-rl_runetype[x] |= (_RUNETYPE_R | _RUNETYPE_SW1); if (x == ' ' || x == '\t') - rl-rl_runetype[x] |= _CTYPE_B; + rl-rl_runetype[x] |= _RUNETYPE_B; /* XXX may fail on non-8bit encoding only */ rl-rl_mapupper[x] = ntohs(new_toupper[1 + x]); Index: src/lib/libc/locale/rune_local.h diff -u src/lib/libc/locale/rune_local.h:1.15 src/lib/libc/locale/rune_local.h:1.16 --- src/lib/libc/locale/rune_local.h:1.15 Sat Jun 5 16:37:13 2010 +++ src/lib/libc/locale/rune_local.h Sat Jun 12 05:54:05 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rune_local.h,v 1.15 2010/06/05 16:37:13 tnozaki Exp $ */ +/*
CVS commit: src/usr.bin/mklocale
Module Name:src Committed By: tnozaki Date: Sat Jun 12 02:51:35 UTC 2010 Modified Files: src/usr.bin/mklocale: lex.l yacc.y Log Message: use _FileRune* instead of _Rune*. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/usr.bin/mklocale/lex.l cvs rdiff -u -r1.29 -r1.30 src/usr.bin/mklocale/yacc.y Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Sat Jun 12 05:54:05 UTC 2010 Modified Files: src/lib/libc/locale: iswctype_mb.c rune.c rune_local.h runeglue.c runetable.c Log Message: stop to renaming _CTYPE_* - _RUNETYPE_*. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/lib/libc/locale/iswctype_mb.c cvs rdiff -u -r1.36 -r1.37 src/lib/libc/locale/rune.c cvs rdiff -u -r1.15 -r1.16 src/lib/libc/locale/rune_local.h cvs rdiff -u -r1.18 -r1.19 src/lib/libc/locale/runeglue.c cvs rdiff -u -r1.24 -r1.25 src/lib/libc/locale/runetable.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/distrib/utils/libhack
Module Name:src Committed By: tnozaki Date: Tue Jun 8 17:12:32 UTC 2010 Modified Files: src/distrib/utils/libhack: setlocale.c Log Message: fix build breakage by multiple definition of __mb_cur_max. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/distrib/utils/libhack/setlocale.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/utils/libhack/setlocale.c diff -u src/distrib/utils/libhack/setlocale.c:1.4 src/distrib/utils/libhack/setlocale.c:1.5 --- src/distrib/utils/libhack/setlocale.c:1.4 Sat Jul 26 17:07:36 2003 +++ src/distrib/utils/libhack/setlocale.c Tue Jun 8 17:12:32 2010 @@ -1,13 +1,11 @@ -/* $NetBSD: setlocale.c,v 1.4 2003/07/26 17:07:36 salo Exp $ */ +/* $NetBSD: setlocale.c,v 1.5 2010/06/08 17:12:32 tnozaki Exp $ */ /* * Written by Gordon W. Ross g...@netbsd.org * Public domain. */ -#include sys/localedef.h #include stdlib.h -#define __SETLOCALE_SOURCE__ #include locale.h /* @@ -19,10 +17,8 @@ static char current_locale[32] = { C }; -size_t __mb_cur_max = 1; - char * -__setlocale_mb_len_max_32(category, locale) +setlocale(category, locale) int category; const char *locale; {
CVS commit: src/distrib/utils/libhack
Module Name:src Committed By: tnozaki Date: Tue Jun 8 17:12:32 UTC 2010 Modified Files: src/distrib/utils/libhack: setlocale.c Log Message: fix build breakage by multiple definition of __mb_cur_max. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/distrib/utils/libhack/setlocale.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: tnozaki Date: Mon Jun 7 13:52:31 UTC 2010 Modified Files: src/distrib/sets/lists/base: ad.mips64eb ad.mips64el md.amd64 md.sparc64 shl.mi src/distrib/sets/lists/comp: md.amd64 md.sparc64 shl.mi src/include: limits.h locale.h src/lib/libc: shlib_version src/lib/libc/citrus: citrus_lc_ctype.c src/lib/libc/compat: Makefile Makefile.inc src/lib/libc/locale: Makefile.inc setlocale.c setlocale_local.h src/sys/arch/alpha/include: limits.h src/sys/arch/amd64/include: limits.h src/sys/arch/arm/include: limits.h src/sys/arch/hpc/stand/include/machine: limits.h src/sys/arch/hppa/include: limits.h src/sys/arch/i386/include: limits.h src/sys/arch/ia64/include: limits.h src/sys/arch/m68k/include: limits.h src/sys/arch/mips/include: limits.h src/sys/arch/powerpc/include: limits.h src/sys/arch/sh3/include: limits.h src/sys/arch/sparc/include: limits.h src/sys/arch/vax/include: limits.h Added Files: src/lib/libc/compat/arch/hppa/locale: compat_setlocale32.c src/lib/libc/compat/include: locale.h src/lib/libc/compat/locale: Makefile.inc compat_setlocale1.c compat_setlocale32.c Removed Files: src/lib/libc/locale: setlocale1.c setlocale32.c Log Message: 1. MB_LEN_MAX switch MD to MI. 2. unfortunately hppa's MB_LEN_MAX is defined incorrectly 6 instead of 32 so we have to add more setlocale(3) __RENAME func, __setlocale50. 3. move setlocale1.c and setlocale32.c to lib/libc/compat/locale/* prepareing for next libc major crunk. 4. bump libc minor version. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/distrib/sets/lists/base/ad.mips64eb \ src/distrib/sets/lists/base/ad.mips64el cvs rdiff -u -r1.89 -r1.90 src/distrib/sets/lists/base/md.amd64 cvs rdiff -u -r1.83 -r1.84 src/distrib/sets/lists/base/md.sparc64 cvs rdiff -u -r1.537 -r1.538 src/distrib/sets/lists/base/shl.mi cvs rdiff -u -r1.67 -r1.68 src/distrib/sets/lists/comp/md.amd64 cvs rdiff -u -r1.57 -r1.58 src/distrib/sets/lists/comp/md.sparc64 cvs rdiff -u -r1.118 -r1.119 src/distrib/sets/lists/comp/shl.mi cvs rdiff -u -r1.28 -r1.29 src/include/limits.h cvs rdiff -u -r1.16 -r1.17 src/include/locale.h cvs rdiff -u -r1.217 -r1.218 src/lib/libc/shlib_version cvs rdiff -u -r1.6 -r1.7 src/lib/libc/citrus/citrus_lc_ctype.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/compat/Makefile cvs rdiff -u -r1.5 -r1.6 src/lib/libc/compat/Makefile.inc cvs rdiff -u -r0 -r1.1 \ src/lib/libc/compat/arch/hppa/locale/compat_setlocale32.c cvs rdiff -u -r0 -r1.1 src/lib/libc/compat/include/locale.h cvs rdiff -u -r0 -r1.1 src/lib/libc/compat/locale/Makefile.inc \ src/lib/libc/compat/locale/compat_setlocale1.c \ src/lib/libc/compat/locale/compat_setlocale32.c cvs rdiff -u -r1.56 -r1.57 src/lib/libc/locale/Makefile.inc cvs rdiff -u -r1.57 -r1.58 src/lib/libc/locale/setlocale.c cvs rdiff -u -r1.4 -r0 src/lib/libc/locale/setlocale1.c cvs rdiff -u -r1.6 -r0 src/lib/libc/locale/setlocale32.c cvs rdiff -u -r1.6 -r1.7 src/lib/libc/locale/setlocale_local.h cvs rdiff -u -r1.12 -r1.13 src/sys/arch/alpha/include/limits.h cvs rdiff -u -r1.10 -r1.11 src/sys/arch/amd64/include/limits.h cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/include/limits.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hpc/stand/include/machine/limits.h cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hppa/include/limits.h cvs rdiff -u -r1.21 -r1.22 src/sys/arch/i386/include/limits.h cvs rdiff -u -r1.4 -r1.5 src/sys/arch/ia64/include/limits.h cvs rdiff -u -r1.19 -r1.20 src/sys/arch/m68k/include/limits.h cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mips/include/limits.h cvs rdiff -u -r1.15 -r1.16 src/sys/arch/powerpc/include/limits.h cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sh3/include/limits.h cvs rdiff -u -r1.18 -r1.19 src/sys/arch/sparc/include/limits.h cvs rdiff -u -r1.17 -r1.18 src/sys/arch/vax/include/limits.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/base/ad.mips64eb diff -u src/distrib/sets/lists/base/ad.mips64eb:1.14 src/distrib/sets/lists/base/ad.mips64eb:1.15 --- src/distrib/sets/lists/base/ad.mips64eb:1.14 Fri May 21 11:07:20 2010 +++ src/distrib/sets/lists/base/ad.mips64eb Mon Jun 7 13:52:28 2010 @@ -1,4 +1,4 @@ -# $NetBSD: ad.mips64eb,v 1.14 2010/05/21 11:07:20 pooka Exp $ +# $NetBSD: ad.mips64eb,v 1.15 2010/06/07 13:52:28 tnozaki Exp $ ./libexec/ld.elf_so-64base-compat-shlib compat,pic ./libexec/ld.elf_so-o32base-sysutil-bin compat,pic ./usr/lib/64 base-compat-lib compat @@ -62,7 +62,7 @@ ./usr/lib/64/libbz2.so.1 base-compat-shlib compat,pic ./usr/lib/64/libbz2.so.1.1 base-compat-shlib compat,pic ./usr/lib/64/libc.so.12base-compat-shlib compat,pic -./usr/lib/64/libc.so.12.172 base-compat-shlib compat,pic
CVS commit: src
Module Name:src Committed By: tnozaki Date: Mon Jun 7 13:52:31 UTC 2010 Modified Files: src/distrib/sets/lists/base: ad.mips64eb ad.mips64el md.amd64 md.sparc64 shl.mi src/distrib/sets/lists/comp: md.amd64 md.sparc64 shl.mi src/include: limits.h locale.h src/lib/libc: shlib_version src/lib/libc/citrus: citrus_lc_ctype.c src/lib/libc/compat: Makefile Makefile.inc src/lib/libc/locale: Makefile.inc setlocale.c setlocale_local.h src/sys/arch/alpha/include: limits.h src/sys/arch/amd64/include: limits.h src/sys/arch/arm/include: limits.h src/sys/arch/hpc/stand/include/machine: limits.h src/sys/arch/hppa/include: limits.h src/sys/arch/i386/include: limits.h src/sys/arch/ia64/include: limits.h src/sys/arch/m68k/include: limits.h src/sys/arch/mips/include: limits.h src/sys/arch/powerpc/include: limits.h src/sys/arch/sh3/include: limits.h src/sys/arch/sparc/include: limits.h src/sys/arch/vax/include: limits.h Added Files: src/lib/libc/compat/arch/hppa/locale: compat_setlocale32.c src/lib/libc/compat/include: locale.h src/lib/libc/compat/locale: Makefile.inc compat_setlocale1.c compat_setlocale32.c Removed Files: src/lib/libc/locale: setlocale1.c setlocale32.c Log Message: 1. MB_LEN_MAX switch MD to MI. 2. unfortunately hppa's MB_LEN_MAX is defined incorrectly 6 instead of 32 so we have to add more setlocale(3) __RENAME func, __setlocale50. 3. move setlocale1.c and setlocale32.c to lib/libc/compat/locale/* prepareing for next libc major crunk. 4. bump libc minor version. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/distrib/sets/lists/base/ad.mips64eb \ src/distrib/sets/lists/base/ad.mips64el cvs rdiff -u -r1.89 -r1.90 src/distrib/sets/lists/base/md.amd64 cvs rdiff -u -r1.83 -r1.84 src/distrib/sets/lists/base/md.sparc64 cvs rdiff -u -r1.537 -r1.538 src/distrib/sets/lists/base/shl.mi cvs rdiff -u -r1.67 -r1.68 src/distrib/sets/lists/comp/md.amd64 cvs rdiff -u -r1.57 -r1.58 src/distrib/sets/lists/comp/md.sparc64 cvs rdiff -u -r1.118 -r1.119 src/distrib/sets/lists/comp/shl.mi cvs rdiff -u -r1.28 -r1.29 src/include/limits.h cvs rdiff -u -r1.16 -r1.17 src/include/locale.h cvs rdiff -u -r1.217 -r1.218 src/lib/libc/shlib_version cvs rdiff -u -r1.6 -r1.7 src/lib/libc/citrus/citrus_lc_ctype.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/compat/Makefile cvs rdiff -u -r1.5 -r1.6 src/lib/libc/compat/Makefile.inc cvs rdiff -u -r0 -r1.1 \ src/lib/libc/compat/arch/hppa/locale/compat_setlocale32.c cvs rdiff -u -r0 -r1.1 src/lib/libc/compat/include/locale.h cvs rdiff -u -r0 -r1.1 src/lib/libc/compat/locale/Makefile.inc \ src/lib/libc/compat/locale/compat_setlocale1.c \ src/lib/libc/compat/locale/compat_setlocale32.c cvs rdiff -u -r1.56 -r1.57 src/lib/libc/locale/Makefile.inc cvs rdiff -u -r1.57 -r1.58 src/lib/libc/locale/setlocale.c cvs rdiff -u -r1.4 -r0 src/lib/libc/locale/setlocale1.c cvs rdiff -u -r1.6 -r0 src/lib/libc/locale/setlocale32.c cvs rdiff -u -r1.6 -r1.7 src/lib/libc/locale/setlocale_local.h cvs rdiff -u -r1.12 -r1.13 src/sys/arch/alpha/include/limits.h cvs rdiff -u -r1.10 -r1.11 src/sys/arch/amd64/include/limits.h cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/include/limits.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hpc/stand/include/machine/limits.h cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hppa/include/limits.h cvs rdiff -u -r1.21 -r1.22 src/sys/arch/i386/include/limits.h cvs rdiff -u -r1.4 -r1.5 src/sys/arch/ia64/include/limits.h cvs rdiff -u -r1.19 -r1.20 src/sys/arch/m68k/include/limits.h cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mips/include/limits.h cvs rdiff -u -r1.15 -r1.16 src/sys/arch/powerpc/include/limits.h cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sh3/include/limits.h cvs rdiff -u -r1.18 -r1.19 src/sys/arch/sparc/include/limits.h cvs rdiff -u -r1.17 -r1.18 src/sys/arch/vax/include/limits.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/lib/libc/locale
hi, all I was just wondering why this change was made? It seems to be a backwards step to me? my intension is quite paranoia. changing uint8_t - unsigned char / int16_t - short is because _ctype_ / _tolower_tab_ / _toupper_tab_ in ctype.h (now splitted sys/ctype_bits.h) declared as unsigned char / short. ctype.h(rev1.29) -- http://tinyurl.com/365ycfq extern const unsigned char *_ctype_; extern const short *_tolower_tab_; extern const short *_toupper_tab_; but ctypeio.c read them from LC_CTYPE as uint8_t / int16_t and network endian and directly cast to unsigned char/short. ctypeio.c(rev1.11) -- http://tinyurl.com/22my4t8 if (fread((void *)ptr, sizeof(uint8_t), len, fp) != len) ... if (fread((void *)ptr, sizeof(int16_t), len, fp) != len) ... if (fread((void *)ptr, sizeof(int16_t), len, fp) != len) ... #if BYTE_ORDER == LITTLE_ENDIAN for (i = 1; i = len; i++) { new_toupper[i] = ntohs(new_toupper[i]); new_tolower[i] = ntohs(new_tolower[i]); } #endif ... data-ctype_tab = (const unsigned char *)new_ctype; data-toupper_tab = (const short *)new_toupper; data-tolower_tab = (const short *)new_tolower; if the case, someone port to the machine that sizeof(unsigned char) != sizeof(uint8_t) or sizeof(short) != sizeof(int16_t), is*/to* function doesn't work correctlly. # such as NetBSD/pdp10(9bit char), or cray1(64bit char) If you ever port to a 36-bit machine, you are going to have to lie and define int32_t as 'int' anyway intN_t is not portable type, these are optimal: ISO/IEC9899:1999 7.18.1.1 3 These types are optional. However, if an implementation provides integer types with widths of 8, 16, 32, or 64 bits, no padding bits, and (for the signed types) that have a two’s complement representation, it shall define the corresponding typedef names. NetBSD/pdp10 seems that providing them by using gcc extension __attribute__((size N)). The [u]int_leastN_t types may be useful in this sort of code. exactly, but it require C99 stdint.h(or sys/types.h). ctype.h should keep C90 namespace, i'm not willing to include it. P.S. i'm now attempting increase _ctype_ bits 8 - 16 before branching netbsd-6. because these ancient code(delived from 4BSD) have two bugs: 1. _B bit desn't means isblank(3) but isprint(3) !isgraph(3). so we have to provide real isblank bit, but there is no bit space left. 2. isprint(3) doesn't recognize some japanese half-width character and vietnamese's phonogram character, we have to provide phonogram bit too. i'll post patch to tech-userlevel@, this weekend or next week. very truly yours. -- Takehiko NOZAKI tnoz...@netbsd.org
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Sat Jun 5 16:37:13 UTC 2010 Modified Files: src/lib/libc/locale: rune_local.h runetype_local.h Log Message: remove unused magic. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/lib/libc/locale/rune_local.h cvs rdiff -u -r1.8 -r1.9 src/lib/libc/locale/runetype_local.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/locale/rune_local.h diff -u src/lib/libc/locale/rune_local.h:1.14 src/lib/libc/locale/rune_local.h:1.15 --- src/lib/libc/locale/rune_local.h:1.14 Sat May 22 13:50:02 2010 +++ src/lib/libc/locale/rune_local.h Sat Jun 5 16:37:13 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rune_local.h,v 1.14 2010/05/22 13:50:02 tnozaki Exp $ */ +/* $NetBSD: rune_local.h,v 1.15 2010/06/05 16:37:13 tnozaki Exp $ */ /*- * Copyright (c) 2000 Citrus Project, @@ -105,7 +105,6 @@ #define _RuneRange _NBRuneRange #define _RuneLocale _NBRuneLocale #define _RUNE_MAGIC_1 _NB_RUNE_MAGIC_1 -#define _RUNE_MODULE_1 _NB_RUNE_MODULE_1 #define _RUNE_CODESET _NB_RUNE_CODESET /* Index: src/lib/libc/locale/runetype_local.h diff -u src/lib/libc/locale/runetype_local.h:1.8 src/lib/libc/locale/runetype_local.h:1.9 --- src/lib/libc/locale/runetype_local.h:1.8 Sat May 22 18:15:21 2010 +++ src/lib/libc/locale/runetype_local.h Sat Jun 5 16:37:13 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: runetype_local.h,v 1.8 2010/05/22 18:15:21 tnozaki Exp $ */ +/* $NetBSD: runetype_local.h,v 1.9 2010/06/05 16:37:13 tnozaki Exp $ */ /*- * Copyright (c) 1993 @@ -218,9 +218,6 @@ /* magic number for LC_CTYPE (rune)locale declaration */ #define _NB_RUNE_MAGIC_1 RuneCT10 /* Indicates version 0 of RuneLocale */ -/* magic string for dynamic link module - type should be like LC_CTYPE */ -#define _NB_RUNE_MODULE_1(type) RuneModule10. type - /* codeset tag */ #define _NB_RUNE_CODESET CODESET=
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Sat Jun 5 16:37:13 UTC 2010 Modified Files: src/lib/libc/locale: rune_local.h runetype_local.h Log Message: remove unused magic. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/lib/libc/locale/rune_local.h cvs rdiff -u -r1.8 -r1.9 src/lib/libc/locale/runetype_local.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Wed Jun 2 15:47:25 UTC 2010 Modified Files: src/lib/libc/locale: _wctrans.c _wctrans_local.h _wctype.c _wctype_local.h iswctype_mb.c Log Message: remove duplicated towctrans internal function. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/lib/libc/locale/_wctrans.c cvs rdiff -u -r1.8 -r1.9 src/lib/libc/locale/_wctrans_local.h \ src/lib/libc/locale/iswctype_mb.c cvs rdiff -u -r1.7 -r1.8 src/lib/libc/locale/_wctype.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/_wctype_local.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/locale/_wctrans.c diff -u src/lib/libc/locale/_wctrans.c:1.15 src/lib/libc/locale/_wctrans.c:1.16 --- src/lib/libc/locale/_wctrans.c:1.15 Tue Jun 1 13:52:08 2010 +++ src/lib/libc/locale/_wctrans.c Wed Jun 2 15:47:25 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: _wctrans.c,v 1.15 2010/06/01 13:52:08 tnozaki Exp $ */ +/* $NetBSD: _wctrans.c,v 1.16 2010/06/02 15:47:25 tnozaki Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -60,7 +60,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: _wctrans.c,v 1.15 2010/06/01 13:52:08 tnozaki Exp $); +__RCSID($NetBSD: _wctrans.c,v 1.16 2010/06/02 15:47:25 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h @@ -77,7 +77,7 @@ * translate a character (extended part) */ wint_t -_towctrans_ext(wint_t c, struct _WCTransEntry *te) +_towctrans_ext(wint_t c, struct _WCTransEntry const *te) { __nbrune_t c0; uint32_t x; Index: src/lib/libc/locale/_wctrans_local.h diff -u src/lib/libc/locale/_wctrans_local.h:1.8 src/lib/libc/locale/_wctrans_local.h:1.9 --- src/lib/libc/locale/_wctrans_local.h:1.8 Thu Feb 12 05:00:46 2009 +++ src/lib/libc/locale/_wctrans_local.h Wed Jun 2 15:47:25 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: _wctrans_local.h,v 1.8 2009/02/12 05:00:46 lukem Exp $ */ +/* $NetBSD: _wctrans_local.h,v 1.9 2010/06/02 15:47:25 tnozaki Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -30,11 +30,11 @@ #define _WCTRANS_LOCAL_H_ __BEGIN_DECLS -wint_t _towctrans_ext(wint_t, _WCTransEntry *); +wint_t _towctrans_ext(wint_t, _WCTransEntry const *); __END_DECLS static __inline wint_t -_towctrans(wint_t c, _WCTransEntry *te) +_towctrans_priv(wint_t c, _WCTransEntry const *te) { return (_RUNE_ISCACHED(c) ? (wint_t)te-te_cached[(size_t)c] Index: src/lib/libc/locale/iswctype_mb.c diff -u src/lib/libc/locale/iswctype_mb.c:1.8 src/lib/libc/locale/iswctype_mb.c:1.9 --- src/lib/libc/locale/iswctype_mb.c:1.8 Tue Jun 1 13:52:08 2010 +++ src/lib/libc/locale/iswctype_mb.c Wed Jun 2 15:47:25 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: iswctype_mb.c,v 1.8 2010/06/01 13:52:08 tnozaki Exp $ */ +/* $NetBSD: iswctype_mb.c,v 1.9 2010/06/02 15:47:25 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: iswctype_mb.c,v 1.8 2010/06/01 13:52:08 tnozaki Exp $); +__RCSID($NetBSD: iswctype_mb.c,v 1.9 2010/06/02 15:47:25 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h @@ -82,7 +82,7 @@ \ rl = _RUNE_LOCALE();\ te = rl-rl_wctrans[index]; \ - return _towctrans_priv(rl, wc, te); \ + return _towctrans_priv(wc, te); \ } _TOWCTRANS_FUNC(upper, _WCTRANS_INDEX_UPPER) _TOWCTRANS_FUNC(lower, _WCTRANS_INDEX_LOWER) @@ -134,16 +134,14 @@ wint_t towctrans(wint_t wc, wctrans_t charmap) { - _RuneLocale const *rl; _WCTransEntry const *te; if (charmap == NULL) { errno = EINVAL; return wc; } - rl = _RUNE_LOCALE(); te = (_WCTransEntry const *)(void *)charmap; - return _towctrans_priv(rl, wc, te); + return _towctrans_priv(wc, te); } __weak_alias(wcwidth,_wcwidth) Index: src/lib/libc/locale/_wctype.c diff -u src/lib/libc/locale/_wctype.c:1.7 src/lib/libc/locale/_wctype.c:1.8 --- src/lib/libc/locale/_wctype.c:1.7 Tue Jun 1 13:52:08 2010 +++ src/lib/libc/locale/_wctype.c Wed Jun 2 15:47:25 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: _wctype.c,v 1.7 2010/06/01 13:52:08 tnozaki Exp $ */ +/* $NetBSD: _wctype.c,v 1.8 2010/06/02 15:47:25 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -60,7 +60,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: _wctype.c,v 1.7 2010/06/01 13:52:08 tnozaki Exp $); +__RCSID($NetBSD: _wctype.c,v 1.8 2010/06/02 15:47:25 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include sys/types.h @@ -110,37 +110,3 @@ { return !!(_runetype_priv(rl, wc) te-te_mask); } - -wint_t -/*ARGSUSED*/ -_towctrans_priv(_RuneLocale const *rl, -wint_t wc, _WCTransEntry const *te) -{ - __nbrune_t wc0; - _RuneRange *rr; - _RuneEntry *base, *re; - uint32_t x; - - _DIAGASSERT(rl != NULL); - _DIAGASSERT(te != NULL); - - if (wc == WEOF) - return wc; - _DIAGASSERT(te-te_name != NULL); - if
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Wed Jun 2 16:04:52 UTC 2010 Modified Files: src/lib/libc/locale: bsdctype.c Log Message: uint8_t - unsigned char, int16_t - short. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/lib/libc/locale/bsdctype.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/locale/bsdctype.c diff -u src/lib/libc/locale/bsdctype.c:1.5 src/lib/libc/locale/bsdctype.c:1.6 --- src/lib/libc/locale/bsdctype.c:1.5 Tue Jun 1 18:00:28 2010 +++ src/lib/libc/locale/bsdctype.c Wed Jun 2 16:04:52 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: bsdctype.c,v 1.5 2010/06/01 18:00:28 tnozaki Exp $ */ +/* $NetBSD: bsdctype.c,v 1.6 2010/06/02 16:04:52 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: bsdctype.c,v 1.5 2010/06/01 18:00:28 tnozaki Exp $); +__RCSID($NetBSD: bsdctype.c,v 1.6 2010/06/02 16:04:52 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include sys/stat.h @@ -52,18 +52,18 @@ const _BSDCTypeLocale *_CurrentBSDCTypeLocale = _DefaultBSDCTypeLocale; typedef struct { - _BSDCTypeLocale bl; - uint8_t blp_ctype_tab [_CTYPE_NUM_CHARS + 1]; - int16_t blp_tolower_tab[_CTYPE_NUM_CHARS + 1]; - int16_t blp_toupper_tab[_CTYPE_NUM_CHARS + 1]; + _BSDCTypeLocale bl; + unsigned char blp_ctype_tab [_CTYPE_NUM_CHARS + 1]; + short blp_tolower_tab[_CTYPE_NUM_CHARS + 1]; + short blp_toupper_tab[_CTYPE_NUM_CHARS + 1]; } _BSDCTypeLocalePriv; static __inline void _bsdctype_init_priv(_BSDCTypeLocalePriv *blp) { - blp-blp_ctype_tab [0] = (uint8_t)0; - blp-blp_tolower_tab[0] = (int16_t)EOF; - blp-blp_toupper_tab[0] = (int16_t)EOF; + blp-blp_ctype_tab [0] = 0; + blp-blp_tolower_tab[0] = EOF; + blp-blp_toupper_tab[0] = EOF; blp-bl.bl_ctype_tab = blp-blp_ctype_tab [0]; blp-bl.bl_tolower_tab = blp-blp_tolower_tab[0]; blp-bl.bl_toupper_tab = blp-blp_toupper_tab[0];
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Wed Jun 2 16:04:52 UTC 2010 Modified Files: src/lib/libc/locale: bsdctype.c Log Message: uint8_t - unsigned char, int16_t - short. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/lib/libc/locale/bsdctype.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: tnozaki Date: Tue Jun 1 13:52:08 UTC 2010 Modified Files: src/distrib/sets/lists/comp: mi src/include: ctype.h src/lib/libc/citrus: citrus_lc_ctype.c src/lib/libc/gen: ctype_.c isascii.c isctype.c tolower_.c toupper_.c src/lib/libc/locale: _wctrans.c _wctype.c ctypeio.c fix_grouping.c global_locale.c iswctype_mb.c iswctype_sb.c localeio_lc_ctype.c rune.c runeglue.c runetable.c src/sys/sys: Makefile Added Files: src/sys/sys: ctype_bits.h ctype_inline.h Log Message: more split ctype.h - sys/ctype_inline.h, sys/ctype_bits.h To generate a diff of this commit: cvs rdiff -u -r1.1454 -r1.1455 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.30 -r1.31 src/include/ctype.h cvs rdiff -u -r1.5 -r1.6 src/lib/libc/citrus/citrus_lc_ctype.c cvs rdiff -u -r1.17 -r1.18 src/lib/libc/gen/ctype_.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/gen/isascii.c cvs rdiff -u -r1.19 -r1.20 src/lib/libc/gen/isctype.c cvs rdiff -u -r1.12 -r1.13 src/lib/libc/gen/tolower_.c \ src/lib/libc/gen/toupper_.c cvs rdiff -u -r1.14 -r1.15 src/lib/libc/locale/_wctrans.c cvs rdiff -u -r1.6 -r1.7 src/lib/libc/locale/_wctype.c cvs rdiff -u -r1.12 -r1.13 src/lib/libc/locale/ctypeio.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/locale/fix_grouping.c cvs rdiff -u -r1.8 -r1.9 src/lib/libc/locale/global_locale.c cvs rdiff -u -r1.7 -r1.8 src/lib/libc/locale/iswctype_mb.c cvs rdiff -u -r1.9 -r1.10 src/lib/libc/locale/iswctype_sb.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/localeio_lc_ctype.c cvs rdiff -u -r1.35 -r1.36 src/lib/libc/locale/rune.c cvs rdiff -u -r1.17 -r1.18 src/lib/libc/locale/runeglue.c cvs rdiff -u -r1.23 -r1.24 src/lib/libc/locale/runetable.c cvs rdiff -u -r1.126 -r1.127 src/sys/sys/Makefile cvs rdiff -u -r0 -r1.1 src/sys/sys/ctype_bits.h src/sys/sys/ctype_inline.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.1454 src/distrib/sets/lists/comp/mi:1.1455 --- src/distrib/sets/lists/comp/mi:1.1454 Fri May 21 21:46:48 2010 +++ src/distrib/sets/lists/comp/mi Tue Jun 1 13:52:07 2010 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1454 2010/05/21 21:46:48 njoly Exp $ +# $NetBSD: mi,v 1.1455 2010/06/01 13:52:07 tnozaki Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -1973,6 +1973,8 @@ ./usr/include/sys/core.h comp-c-include ./usr/include/sys/cpu_data.h comp-obsolete obsolete ./usr/include/sys/cpuio.h comp-c-include +./usr/include/sys/ctype_bits.h comp-c-include +./usr/include/sys/ctype_inline.h comp-c-include ./usr/include/sys/device.h comp-c-include ./usr/include/sys/device_if.h comp-c-include ./usr/include/sys/dir.hcomp-c-include Index: src/include/ctype.h diff -u src/include/ctype.h:1.30 src/include/ctype.h:1.31 --- src/include/ctype.h:1.30 Sat May 22 06:38:15 2010 +++ src/include/ctype.h Tue Jun 1 13:52:08 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ctype.h,v 1.30 2010/05/22 06:38:15 tnozaki Exp $ */ +/* $NetBSD: ctype.h,v 1.31 2010/06/01 13:52:08 tnozaki Exp $ */ /* * Copyright (c) 1989 The Regents of the University of California. @@ -42,20 +42,6 @@ #include sys/cdefs.h #include sys/featuretest.h -#define _U 0x01 -#define _L 0x02 -#define _N 0x04 -#define _S 0x08 -#define _P 0x10 -#define _C 0x20 -#define _X 0x40 -#define _B 0x80 - -extern const unsigned char *_ctype_; -extern const short *_tolower_tab_; -extern const short *_toupper_tab_; - - __BEGIN_DECLS int isalnum(int); int isalpha(int); @@ -84,38 +70,8 @@ #endif __END_DECLS -#define isdigit(c) ((int)((_ctype_ + 1)[(c)] _N)) -#define islower(c) ((int)((_ctype_ + 1)[(c)] _L)) -#define isspace(c) ((int)((_ctype_ + 1)[(c)] _S)) -#define ispunct(c) ((int)((_ctype_ + 1)[(c)] _P)) -#define isupper(c) ((int)((_ctype_ + 1)[(c)] _U)) -#define isalpha(c) ((int)((_ctype_ + 1)[(c)] (_U|_L))) -#define isxdigit(c) ((int)((_ctype_ + 1)[(c)] (_N|_X))) -#define isalnum(c) ((int)((_ctype_ + 1)[(c)] (_U|_L|_N))) -#define isprint(c) ((int)((_ctype_ + 1)[(c)] (_P|_U|_L|_N|_B))) -#define isgraph(c) ((int)((_ctype_ + 1)[(c)] (_P|_U|_L|_N))) -#define iscntrl(c) ((int)((_ctype_ + 1)[(c)] _C)) -#define tolower(c) ((int)((_tolower_tab_ + 1)[(c)])) -#define toupper(c) ((int)((_toupper_tab_ + 1)[(c)])) - -#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE) -#define isascii(c) ((unsigned)(c) = 0177) -#define toascii(c) ((c) 0177) -#define _tolower(c) ((c) - 'A' + 'a') -#define _toupper(c) ((c) - 'a' + 'A') -#endif - -#if defined(_ISO_C99_SOURCE) || (_POSIX_C_SOURCE - 0) 200112L || \ -(_XOPEN_SOURCE - 0) 600 || defined(_NETBSD_SOURCE) - -/* - * isblank() is implemented as C function, due to insufficient bitwidth in - * _ctype_. Note that _B does not mean isblank - it means isprint !isgraph. - */ -#if 0 -#define isblank(c) ((int)((_ctype_ + 1)[(c)] _B))
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Tue Jun 1 18:00:28 UTC 2010 Modified Files: src/lib/libc/locale: Makefile.inc bsdctype.c bsdctype.h iswctype_sb.c localeio_lc_ctype.c Removed Files: src/lib/libc/locale: ctypeio.c ctypeio.h Log Message: refactoring old locale-db(BSDCTYPE) loading method with mmap(2). To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/lib/libc/locale/Makefile.inc cvs rdiff -u -r1.4 -r1.5 src/lib/libc/locale/bsdctype.c cvs rdiff -u -r1.3 -r1.4 src/lib/libc/locale/bsdctype.h \ src/lib/libc/locale/localeio_lc_ctype.c cvs rdiff -u -r1.13 -r0 src/lib/libc/locale/ctypeio.c cvs rdiff -u -r1.4 -r0 src/lib/libc/locale/ctypeio.h cvs rdiff -u -r1.10 -r1.11 src/lib/libc/locale/iswctype_sb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/locale/Makefile.inc diff -u src/lib/libc/locale/Makefile.inc:1.55 src/lib/libc/locale/Makefile.inc:1.56 --- src/lib/libc/locale/Makefile.inc:1.55 Sun May 30 08:28:53 2010 +++ src/lib/libc/locale/Makefile.inc Tue Jun 1 18:00:28 2010 @@ -1,5 +1,5 @@ # from: @(#)Makefile.inc 5.1 (Berkeley) 2/18/91 -# $NetBSD: Makefile.inc,v 1.55 2010/05/30 08:28:53 tnozaki Exp $ +# $NetBSD: Makefile.inc,v 1.56 2010/06/01 18:00:28 tnozaki Exp $ # locale sources .PATH: ${ARCHDIR}/locale ${.CURDIR}/locale @@ -29,7 +29,7 @@ SRCS+= aliasname.c bsdctype.c localeio.c \ multibyte_sb.c iswctype_sb.c \ localeio_lc_ctype.c localeio_lc_monetary.c \ - localeio_lc_numeric.c localeio_lc_time.c + localeio_lc_numeric.c localeio_lc_time.c localeio_lc_messages.c .endif MAN+= setlocale.3 nl_langinfo.3 Index: src/lib/libc/locale/bsdctype.c diff -u src/lib/libc/locale/bsdctype.c:1.4 src/lib/libc/locale/bsdctype.c:1.5 --- src/lib/libc/locale/bsdctype.c:1.4 Sun May 30 08:28:53 2010 +++ src/lib/libc/locale/bsdctype.c Tue Jun 1 18:00:28 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: bsdctype.c,v 1.4 2010/05/30 08:28:53 tnozaki Exp $ */ +/* $NetBSD: bsdctype.c,v 1.5 2010/06/01 18:00:28 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,9 +28,19 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: bsdctype.c,v 1.4 2010/05/30 08:28:53 tnozaki Exp $); +__RCSID($NetBSD: bsdctype.c,v 1.5 2010/06/01 18:00:28 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ +#include sys/stat.h +#include sys/mman.h +#include assert.h +#include errno.h +#include fcntl.h +#include stdio.h +#include stdlib.h +#include string.h +#include unistd.h + #include bsdctype.h const _BSDCTypeLocale _DefaultBSDCTypeLocale = { @@ -40,3 +50,130 @@ }; const _BSDCTypeLocale *_CurrentBSDCTypeLocale = _DefaultBSDCTypeLocale; + +typedef struct { + _BSDCTypeLocale bl; + uint8_t blp_ctype_tab [_CTYPE_NUM_CHARS + 1]; + int16_t blp_tolower_tab[_CTYPE_NUM_CHARS + 1]; + int16_t blp_toupper_tab[_CTYPE_NUM_CHARS + 1]; +} _BSDCTypeLocalePriv; + +static __inline void +_bsdctype_init_priv(_BSDCTypeLocalePriv *blp) +{ + blp-blp_ctype_tab [0] = (uint8_t)0; + blp-blp_tolower_tab[0] = (int16_t)EOF; + blp-blp_toupper_tab[0] = (int16_t)EOF; + blp-bl.bl_ctype_tab = blp-blp_ctype_tab [0]; + blp-bl.bl_tolower_tab = blp-blp_tolower_tab[0]; + blp-bl.bl_toupper_tab = blp-blp_toupper_tab[0]; +} + +static __inline int +_bsdctype_read_file(const char * __restrict var, size_t lenvar, +_BSDCTypeLocalePriv * __restrict blp) +{ + const _FileBSDCTypeLocale *fbl; + uint32_t value; + int i; + + if (lenvar sizeof(*fbl)) + return EFTYPE; + fbl = (const _FileBSDCTypeLocale *)(const void *)var; + if (memcmp(fbl-fbl_id[0], _CTYPE_ID, sizeof(fbl-fbl_id))) + return EFTYPE; + value = ntohl(fbl-fbl_rev); + if (value != _CTYPE_REV) + return EFTYPE; + value = ntohl(fbl-fbl_num_chars); + if (value != _CTYPE_CACHE_SIZE) + return EFTYPE; + for (i = 0; i _CTYPE_CACHE_SIZE; ++i) { + blp-blp_ctype_tab [i + 1] = fbl-fbl_ctype_tab[i]; + blp-blp_tolower_tab[i + 1] = ntohs(fbl-fbl_tolower_tab[i]); + blp-blp_toupper_tab[i + 1] = ntohs(fbl-fbl_toupper_tab[i]); + } +#if _CTYPE_CACHE_SIZE != _CTYPE_NUM_CHARS + for (i = _CTYPE_CACHE_SIZE; i _CTYPE_NUM_CHARS; ++i) { + blp-blp_ctype_tab [i + 1] = 0; + blp-blp_tolower_tab[i + 1] = i; + blp-blp_toupper_tab[i + 1] = i; + } +#endif + return 0; +} + +static __inline int +_bsdctype_load_priv(const char * __restrict path, +_BSDCTypeLocalePriv * __restrict blp) +{ + int fd, ret; + struct stat st; + size_t lenvar; + char *var; + + fd = open(path, O_RDONLY); + if (fd == -1) + goto err; + if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) + goto err; + if (fstat(fd, st) == -1) + goto err; + if (!S_ISREG(st.st_mode)) { + close(fd); + return EBADF; + } + lenvar = (size_t)st.st_size; + if (lenvar 1) { + close(fd); + return EFTYPE; + } + var = mmap(NULL, lenvar, PROT_READ, + MAP_FILE|MAP_PRIVATE, fd, (off_t)0); + if (var == MAP_FAILED) + goto err; + if (close(fd) == -1) { + ret = errno; + munmap(var,
CVS commit: src
Module Name:src Committed By: tnozaki Date: Tue Jun 1 13:52:08 UTC 2010 Modified Files: src/distrib/sets/lists/comp: mi src/include: ctype.h src/lib/libc/citrus: citrus_lc_ctype.c src/lib/libc/gen: ctype_.c isascii.c isctype.c tolower_.c toupper_.c src/lib/libc/locale: _wctrans.c _wctype.c ctypeio.c fix_grouping.c global_locale.c iswctype_mb.c iswctype_sb.c localeio_lc_ctype.c rune.c runeglue.c runetable.c src/sys/sys: Makefile Added Files: src/sys/sys: ctype_bits.h ctype_inline.h Log Message: more split ctype.h - sys/ctype_inline.h, sys/ctype_bits.h To generate a diff of this commit: cvs rdiff -u -r1.1454 -r1.1455 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.30 -r1.31 src/include/ctype.h cvs rdiff -u -r1.5 -r1.6 src/lib/libc/citrus/citrus_lc_ctype.c cvs rdiff -u -r1.17 -r1.18 src/lib/libc/gen/ctype_.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/gen/isascii.c cvs rdiff -u -r1.19 -r1.20 src/lib/libc/gen/isctype.c cvs rdiff -u -r1.12 -r1.13 src/lib/libc/gen/tolower_.c \ src/lib/libc/gen/toupper_.c cvs rdiff -u -r1.14 -r1.15 src/lib/libc/locale/_wctrans.c cvs rdiff -u -r1.6 -r1.7 src/lib/libc/locale/_wctype.c cvs rdiff -u -r1.12 -r1.13 src/lib/libc/locale/ctypeio.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/locale/fix_grouping.c cvs rdiff -u -r1.8 -r1.9 src/lib/libc/locale/global_locale.c cvs rdiff -u -r1.7 -r1.8 src/lib/libc/locale/iswctype_mb.c cvs rdiff -u -r1.9 -r1.10 src/lib/libc/locale/iswctype_sb.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/localeio_lc_ctype.c cvs rdiff -u -r1.35 -r1.36 src/lib/libc/locale/rune.c cvs rdiff -u -r1.17 -r1.18 src/lib/libc/locale/runeglue.c cvs rdiff -u -r1.23 -r1.24 src/lib/libc/locale/runetable.c cvs rdiff -u -r1.126 -r1.127 src/sys/sys/Makefile cvs rdiff -u -r0 -r1.1 src/sys/sys/ctype_bits.h src/sys/sys/ctype_inline.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Tue Jun 1 18:00:28 UTC 2010 Modified Files: src/lib/libc/locale: Makefile.inc bsdctype.c bsdctype.h iswctype_sb.c localeio_lc_ctype.c Removed Files: src/lib/libc/locale: ctypeio.c ctypeio.h Log Message: refactoring old locale-db(BSDCTYPE) loading method with mmap(2). To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/lib/libc/locale/Makefile.inc cvs rdiff -u -r1.4 -r1.5 src/lib/libc/locale/bsdctype.c cvs rdiff -u -r1.3 -r1.4 src/lib/libc/locale/bsdctype.h \ src/lib/libc/locale/localeio_lc_ctype.c cvs rdiff -u -r1.13 -r0 src/lib/libc/locale/ctypeio.c cvs rdiff -u -r1.4 -r0 src/lib/libc/locale/ctypeio.h cvs rdiff -u -r1.10 -r1.11 src/lib/libc/locale/iswctype_sb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc
Module Name:src Committed By: tnozaki Date: Sun May 30 08:28:54 UTC 2010 Modified Files: src/lib/libc: Makefile Makefile.inc src/lib/libc/citrus: Makefile.inc src/lib/libc/locale: Makefile.inc bsdctype.c bsdctype.h iswctype_sb.c localeio.c Log Message: 1. fix build problem CITRUS=no 2. make CITRUS={yes,no} knob friendly with libc/compat. To generate a diff of this commit: cvs rdiff -u -r1.141 -r1.142 src/lib/libc/Makefile cvs rdiff -u -r1.5 -r1.6 src/lib/libc/Makefile.inc cvs rdiff -u -r1.7 -r1.8 src/lib/libc/citrus/Makefile.inc cvs rdiff -u -r1.54 -r1.55 src/lib/libc/locale/Makefile.inc cvs rdiff -u -r1.3 -r1.4 src/lib/libc/locale/bsdctype.c \ src/lib/libc/locale/localeio.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/bsdctype.h cvs rdiff -u -r1.8 -r1.9 src/lib/libc/locale/iswctype_sb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/Makefile diff -u src/lib/libc/Makefile:1.141 src/lib/libc/Makefile:1.142 --- src/lib/libc/Makefile:1.141 Sun Apr 25 00:54:46 2010 +++ src/lib/libc/Makefile Sun May 30 08:28:53 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.141 2010/04/25 00:54:46 joerg Exp $ +# $NetBSD: Makefile,v 1.142 2010/05/30 08:28:53 tnozaki Exp $ # @(#)Makefile 8.2 (Berkeley) 2/3/94 # # All library objects contain sccsid strings by default; they may be @@ -57,7 +57,9 @@ .include ${.CURDIR}/atomic/Makefile.inc .include ${.CURDIR}/cdb/Makefile.inc .include ${.CURDIR}/db/Makefile.inc +.if (${CITRUS} == yes) .include ${.CURDIR}/citrus/Makefile.inc +.endif .include ${.CURDIR}/compat-43/Makefile.inc .include ${.CURDIR}/dlfcn/Makefile.inc .include ${.CURDIR}/gdtoa/Makefile.inc @@ -132,7 +134,9 @@ # workaround for I18N stuffs: build singlebyte setlocale() for libc.a, # multibyte for libc.so. the quirk should be removed when we support # dlopen() from within statically linked binaries. +.if (${CITRUS} == yes) CSHLIBFLAGS+= -D_I18N_DYNAMIC +.endif .include bsd.lib.mk Index: src/lib/libc/Makefile.inc diff -u src/lib/libc/Makefile.inc:1.5 src/lib/libc/Makefile.inc:1.6 --- src/lib/libc/Makefile.inc:1.5 Mon Mar 22 01:29:29 2010 +++ src/lib/libc/Makefile.inc Sun May 30 08:28:53 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.5 2010/03/22 01:29:29 mrg Exp $ +# $NetBSD: Makefile.inc,v 1.6 2010/05/30 08:28:53 tnozaki Exp $ # @(#)Makefile 8.2 (Berkeley) 2/3/94 # # All library objects contain sccsid strings by default; they may be @@ -21,6 +21,8 @@ USE_SHLIBDIR= yes +CITRUS?= yes + .include bsd.own.mk WARNS=4 Index: src/lib/libc/citrus/Makefile.inc diff -u src/lib/libc/citrus/Makefile.inc:1.7 src/lib/libc/citrus/Makefile.inc:1.8 --- src/lib/libc/citrus/Makefile.inc:1.7 Sun Jan 11 02:46:24 2009 +++ src/lib/libc/citrus/Makefile.inc Sun May 30 08:28:53 2010 @@ -1,11 +1,8 @@ -# $NetBSD: Makefile.inc,v 1.7 2009/01/11 02:46:24 christos Exp $ +# $NetBSD: Makefile.inc,v 1.8 2010/05/30 08:28:53 tnozaki Exp $ # sources .PATH: ${ARCHDIR}/citrus ${.CURDIR}/citrus -CITRUS?= yes - -.if ${CITRUS} == yes MODULE_SHLIB_MAJOR!= . ${NETBSDSRCDIR}/lib/i18n_module/shlib_version ; echo $$major CPPFLAGS.citrus_module.c+=-DI18NMODULE_MAJOR=${MODULE_SHLIB_MAJOR} SRCS+= citrus_bcs.c citrus_bcs_strtol.c citrus_bcs_strtoul.c \ @@ -26,4 +23,3 @@ CPPFLAGS.citrus_lc_numeric.c+= -I${LIBCDIR}/locale CPPFLAGS.citrus_lc_time.c+= -I${LIBCDIR}/locale CPPFLAGS.citrus_lc_messages.c+= -I${LIBCDIR}/locale -.endif Index: src/lib/libc/locale/Makefile.inc diff -u src/lib/libc/locale/Makefile.inc:1.54 src/lib/libc/locale/Makefile.inc:1.55 --- src/lib/libc/locale/Makefile.inc:1.54 Sun Jan 11 02:46:28 2009 +++ src/lib/libc/locale/Makefile.inc Sun May 30 08:28:53 2010 @@ -1,5 +1,5 @@ # from: @(#)Makefile.inc 5.1 (Berkeley) 2/18/91 -# $NetBSD: Makefile.inc,v 1.54 2009/01/11 02:46:28 christos Exp $ +# $NetBSD: Makefile.inc,v 1.55 2010/05/30 08:28:53 tnozaki Exp $ # locale sources .PATH: ${ARCHDIR}/locale ${.CURDIR}/locale @@ -12,20 +12,7 @@ wcstol.c wcstoll.c wcstoimax.c wcstoul.c wcstoull.c wcstoumax.c \ wcstod.c wcstof.c wcstold.c wcscoll.c wcsxfrm.c wcsftime.c -.if ${CITRUS} == no -RUNE= no -.endif - -RUNE?= yes - -.if ${RUNE} == no -# singlebyte locale - dummy -CPPFLAGS+= -UWITH_RUNE -SRCS+= aliasname.c bsdctype.c localeio.c \ - multibyte_sb.c iswctype_sb.c \ - localeio_lc_ctype.c localeio_lc_monetary.c \ - localeio_lc_numeric.c localeio_lc_time.c -.else +.if (${CITRUS} == yes) # citrus multibyte locale support # we have quirk for libc.a - see the last part of lib/libc/Makefile CPPFLAGS+= -DWITH_RUNE -I${.CURDIR} @@ -36,6 +23,13 @@ CPPFLAGS.runetable.c+= -I${LIBCDIR}/citrus CPPFLAGS.multibyte_c90.c+= -I${LIBCDIR}/citrus CPPFLAGS.multibyte_amd1.c+= -I${LIBCDIR}/citrus +.else +# singlebyte locale - dummy +CPPFLAGS+= -UWITH_RUNE +SRCS+= aliasname.c bsdctype.c localeio.c \ + multibyte_sb.c iswctype_sb.c \ + localeio_lc_ctype.c
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Sun May 30 11:36:12 UTC 2010 Modified Files: src/lib/libc/locale: ctype_local.h Log Message: remove redundant guard. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/ctype_local.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/locale/ctype_local.h diff -u src/lib/libc/locale/ctype_local.h:1.2 src/lib/libc/locale/ctype_local.h:1.3 --- src/lib/libc/locale/ctype_local.h:1.2 Sat May 22 18:15:21 2010 +++ src/lib/libc/locale/ctype_local.h Sun May 30 11:36:12 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ctype_local.h,v 1.2 2010/05/22 18:15:21 tnozaki Exp $ */ +/* $NetBSD: ctype_local.h,v 1.3 2010/05/30 11:36:12 tnozaki Exp $ */ /*- * Copyright (c) 2010 Citrus Project, @@ -40,8 +40,4 @@ extern const short _C_toupper_[]; extern const short _C_tolower_[]; -#endif -#ifndef _CTYPE_LOCAL_H_ -#define _CTYPE_LOCAL_H_ - #endif /*_CTYPE_LOCAL_H_*/
CVS commit: src/lib/libc
Module Name:src Committed By: tnozaki Date: Sun May 30 08:28:54 UTC 2010 Modified Files: src/lib/libc: Makefile Makefile.inc src/lib/libc/citrus: Makefile.inc src/lib/libc/locale: Makefile.inc bsdctype.c bsdctype.h iswctype_sb.c localeio.c Log Message: 1. fix build problem CITRUS=no 2. make CITRUS={yes,no} knob friendly with libc/compat. To generate a diff of this commit: cvs rdiff -u -r1.141 -r1.142 src/lib/libc/Makefile cvs rdiff -u -r1.5 -r1.6 src/lib/libc/Makefile.inc cvs rdiff -u -r1.7 -r1.8 src/lib/libc/citrus/Makefile.inc cvs rdiff -u -r1.54 -r1.55 src/lib/libc/locale/Makefile.inc cvs rdiff -u -r1.3 -r1.4 src/lib/libc/locale/bsdctype.c \ src/lib/libc/locale/localeio.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/bsdctype.h cvs rdiff -u -r1.8 -r1.9 src/lib/libc/locale/iswctype_sb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch
Module Name:src Committed By: tnozaki Date: Sat May 29 17:33:58 UTC 2010 Modified Files: src/sys/arch/alpha/include: int_const.h src/sys/arch/amd64/include: int_const.h src/sys/arch/arm/include: int_const.h src/sys/arch/hppa/include: int_const.h src/sys/arch/i386/include: int_const.h src/sys/arch/ia64/include: int_const.h src/sys/arch/m68k/include: int_const.h src/sys/arch/mips/include: int_const.h src/sys/arch/powerpc/include: int_const.h src/sys/arch/sh3/include: int_const.h src/sys/arch/sparc/include: int_const.h Log Message: fix wrong integer promotion rule(removed U suffix from UINT{8,16}_C). see ISO/IEC 9899:1999 7.18.4.3. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/alpha/include/int_const.h cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amd64/include/int_const.h cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/include/int_const.h cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hppa/include/int_const.h cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/include/int_const.h cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/include/int_const.h cvs rdiff -u -r1.2 -r1.3 src/sys/arch/m68k/include/int_const.h cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/include/int_const.h cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/include/int_const.h cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sh3/include/int_const.h cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sparc/include/int_const.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/alpha/include/int_const.h diff -u src/sys/arch/alpha/include/int_const.h:1.2 src/sys/arch/alpha/include/int_const.h:1.3 --- src/sys/arch/alpha/include/int_const.h:1.2 Mon Apr 28 20:23:11 2008 +++ src/sys/arch/alpha/include/int_const.h Sat May 29 17:33:57 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: int_const.h,v 1.2 2008/04/28 20:23:11 martin Exp $ */ +/* $NetBSD: int_const.h,v 1.3 2010/05/29 17:33:57 tnozaki Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -43,8 +43,8 @@ #define INT32_C(c) c #define INT64_C(c) c ## L -#define UINT8_C(c) c ## U -#define UINT16_C(c) c ## U +#define UINT8_C(c) c +#define UINT16_C(c) c #define UINT32_C(c) c ## U #define UINT64_C(c) c ## UL Index: src/sys/arch/amd64/include/int_const.h diff -u src/sys/arch/amd64/include/int_const.h:1.3 src/sys/arch/amd64/include/int_const.h:1.4 --- src/sys/arch/amd64/include/int_const.h:1.3 Sun Oct 26 00:08:15 2008 +++ src/sys/arch/amd64/include/int_const.h Sat May 29 17:33:57 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: int_const.h,v 1.3 2008/10/26 00:08:15 mrg Exp $ */ +/* $NetBSD: int_const.h,v 1.4 2010/05/29 17:33:57 tnozaki Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -45,8 +45,8 @@ #define INT32_C(c) c #define INT64_C(c) c ## L -#define UINT8_C(c) c ## U -#define UINT16_C(c) c ## U +#define UINT8_C(c) c +#define UINT16_C(c) c #define UINT32_C(c) c ## U #define UINT64_C(c) c ## UL Index: src/sys/arch/arm/include/int_const.h diff -u src/sys/arch/arm/include/int_const.h:1.2 src/sys/arch/arm/include/int_const.h:1.3 --- src/sys/arch/arm/include/int_const.h:1.2 Mon Apr 28 20:23:14 2008 +++ src/sys/arch/arm/include/int_const.h Sat May 29 17:33:57 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: int_const.h,v 1.2 2008/04/28 20:23:14 martin Exp $ */ +/* $NetBSD: int_const.h,v 1.3 2010/05/29 17:33:57 tnozaki Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -43,8 +43,8 @@ #define INT32_C(c) c #define INT64_C(c) c ## LL -#define UINT8_C(c) c ## U -#define UINT16_C(c) c ## U +#define UINT8_C(c) c +#define UINT16_C(c) c #define UINT32_C(c) c ## U #define UINT64_C(c) c ## ULL Index: src/sys/arch/hppa/include/int_const.h diff -u src/sys/arch/hppa/include/int_const.h:1.2 src/sys/arch/hppa/include/int_const.h:1.3 --- src/sys/arch/hppa/include/int_const.h:1.2 Mon Apr 28 20:23:23 2008 +++ src/sys/arch/hppa/include/int_const.h Sat May 29 17:33:57 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: int_const.h,v 1.2 2008/04/28 20:23:23 martin Exp $ */ +/* $NetBSD: int_const.h,v 1.3 2010/05/29 17:33:57 tnozaki Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -43,8 +43,8 @@ #define INT32_C(c) c #define INT64_C(c) c ## LL -#define UINT8_C(c) c ## U -#define UINT16_C(c) c ## U +#define UINT8_C(c) c +#define UINT16_C(c) c #define UINT32_C(c) c ## U #define UINT64_C(c) c ## ULL Index: src/sys/arch/i386/include/int_const.h diff -u src/sys/arch/i386/include/int_const.h:1.2 src/sys/arch/i386/include/int_const.h:1.3 --- src/sys/arch/i386/include/int_const.h:1.2 Mon Apr 28 20:23:24 2008 +++ src/sys/arch/i386/include/int_const.h Sat May 29 17:33:57 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: int_const.h,v 1.2 2008/04/28 20:23:24 martin Exp $ */ +/* $NetBSD: int_const.h,v 1.3 2010/05/29 17:33:57 tnozaki Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -43,8 +43,8 @@ #define INT32_C(c) c #define
CVS commit: src/sys/arch/vax/include
Module Name:src Committed By: tnozaki Date: Sat May 29 17:45:15 UTC 2010 Modified Files: src/sys/arch/vax/include: int_const.h Log Message: fix wrong integer promotion rule(removed U suffix from UINT{8,16}_C). see ISO/IEC 9899:1999 7.18.4.3. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/vax/include/int_const.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/vax/include/int_const.h diff -u src/sys/arch/vax/include/int_const.h:1.2 src/sys/arch/vax/include/int_const.h:1.3 --- src/sys/arch/vax/include/int_const.h:1.2 Mon Apr 28 20:23:39 2008 +++ src/sys/arch/vax/include/int_const.h Sat May 29 17:45:15 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: int_const.h,v 1.2 2008/04/28 20:23:39 martin Exp $ */ +/* $NetBSD: int_const.h,v 1.3 2010/05/29 17:45:15 tnozaki Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -43,8 +43,8 @@ #define INT32_C(c) c #define INT64_C(c) c ## LL -#define UINT8_C(c) c ## U -#define UINT16_C(c) c ## U +#define UINT8_C(c) c +#define UINT16_C(c) c #define UINT32_C(c) c ## U #define UINT64_C(c) c ## ULL
CVS commit: src/sys/arch
Module Name:src Committed By: tnozaki Date: Sat May 29 17:33:58 UTC 2010 Modified Files: src/sys/arch/alpha/include: int_const.h src/sys/arch/amd64/include: int_const.h src/sys/arch/arm/include: int_const.h src/sys/arch/hppa/include: int_const.h src/sys/arch/i386/include: int_const.h src/sys/arch/ia64/include: int_const.h src/sys/arch/m68k/include: int_const.h src/sys/arch/mips/include: int_const.h src/sys/arch/powerpc/include: int_const.h src/sys/arch/sh3/include: int_const.h src/sys/arch/sparc/include: int_const.h Log Message: fix wrong integer promotion rule(removed U suffix from UINT{8,16}_C). see ISO/IEC 9899:1999 7.18.4.3. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/alpha/include/int_const.h cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amd64/include/int_const.h cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/include/int_const.h cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hppa/include/int_const.h cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/include/int_const.h cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/include/int_const.h cvs rdiff -u -r1.2 -r1.3 src/sys/arch/m68k/include/int_const.h cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/include/int_const.h cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/include/int_const.h cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sh3/include/int_const.h cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sparc/include/int_const.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: tnozaki Date: Sat May 22 06:38:16 UTC 2010 Modified Files: src/include: ctype.h src/lib/libc/gen: Makefile.inc ctype_.c tolower_.c toupper_.c src/lib/libc/locale: bsdctype.c ctypeio.c global_locale.c rune.c rune.h runeglue.c runetable.c runetype_local.h src/usr.bin/mklocale: ldef.h yacc.y src/usr.sbin/chrtbl: Makefile ctypeio.c Added Files: src/lib/libc/locale: ctype_local.h Log Message: 1. hide _CTYPE_PRIVATE section in ctype.h, move them to private header ctype_local.h. 2. do not use _CTYPE_NUM_CHARS macro to read data from LC_CTYPE(old BSDCTYPE style) database. because 1CHAR_BIT is MD, so i added MI macro _CTYPE_CACHE_SIZE(18). 3. remove _NB_CACHED_RUNE macro, use _CTYPE_CACHE_SIZE instead. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/include/ctype.h cvs rdiff -u -r1.169 -r1.170 src/lib/libc/gen/Makefile.inc cvs rdiff -u -r1.16 -r1.17 src/lib/libc/gen/ctype_.c cvs rdiff -u -r1.11 -r1.12 src/lib/libc/gen/tolower_.c \ src/lib/libc/gen/toupper_.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/bsdctype.c cvs rdiff -u -r0 -r1.1 src/lib/libc/locale/ctype_local.h cvs rdiff -u -r1.11 -r1.12 src/lib/libc/locale/ctypeio.c cvs rdiff -u -r1.5 -r1.6 src/lib/libc/locale/global_locale.c \ src/lib/libc/locale/runetype_local.h cvs rdiff -u -r1.33 -r1.34 src/lib/libc/locale/rune.c cvs rdiff -u -r1.17 -r1.18 src/lib/libc/locale/rune.h cvs rdiff -u -r1.15 -r1.16 src/lib/libc/locale/runeglue.c cvs rdiff -u -r1.21 -r1.22 src/lib/libc/locale/runetable.c cvs rdiff -u -r1.4 -r1.5 src/usr.bin/mklocale/ldef.h cvs rdiff -u -r1.27 -r1.28 src/usr.bin/mklocale/yacc.y cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/chrtbl/Makefile cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/chrtbl/ctypeio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/include/ctype.h diff -u src/include/ctype.h:1.29 src/include/ctype.h:1.30 --- src/include/ctype.h:1.29 Mon Dec 26 19:01:47 2005 +++ src/include/ctype.h Sat May 22 06:38:15 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ctype.h,v 1.29 2005/12/26 19:01:47 perry Exp $ */ +/* $NetBSD: ctype.h,v 1.30 2010/05/22 06:38:15 tnozaki Exp $ */ /* * Copyright (c) 1989 The Regents of the University of California. @@ -118,17 +118,4 @@ #endif -#ifdef _CTYPE_PRIVATE -#include machine/limits.h /* for CHAR_BIT */ - -#define _CTYPE_NUM_CHARS (1 CHAR_BIT) - -#define _CTYPE_ID BSDCTYPE -#define _CTYPE_REV 2 - -extern const uint8_t _C_ctype_[]; -extern const int16_t _C_toupper_[]; -extern const int16_t _C_tolower_[]; -#endif - #endif /* !_CTYPE_H_ */ Index: src/lib/libc/gen/Makefile.inc diff -u src/lib/libc/gen/Makefile.inc:1.169 src/lib/libc/gen/Makefile.inc:1.170 --- src/lib/libc/gen/Makefile.inc:1.169 Thu May 13 17:48:50 2010 +++ src/lib/libc/gen/Makefile.inc Sat May 22 06:38:15 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.169 2010/05/13 17:48:50 jruoho Exp $ +# $NetBSD: Makefile.inc,v 1.170 2010/05/22 06:38:15 tnozaki Exp $ # from: @(#)Makefile.inc 8.6 (Berkeley) 5/4/95 # gen sources @@ -158,4 +158,7 @@ MLINKS+=vis.3 svis.3 vis.3 strvis.3 vis.3 strvisx.3 vis.3 strsvis.3 \ vis.3 strsvisx.3 +CPPFLAGS.ctype_.c+= -I${LIBCDIR}/locale CPPFLAGS.isctype.c+= -I${LIBCDIR}/locale +CPPFLAGS.tolower_.c+= -I${LIBCDIR}/locale +CPPFLAGS.toupper_.c+= -I${LIBCDIR}/locale Index: src/lib/libc/gen/ctype_.c diff -u src/lib/libc/gen/ctype_.c:1.16 src/lib/libc/gen/ctype_.c:1.17 --- src/lib/libc/gen/ctype_.c:1.16 Thu Aug 7 16:42:46 2003 +++ src/lib/libc/gen/ctype_.c Sat May 22 06:38:15 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ctype_.c,v 1.16 2003/08/07 16:42:46 agc Exp $ */ +/* $NetBSD: ctype_.c,v 1.17 2010/05/22 06:38:15 tnozaki Exp $ */ /* * Copyright (c) 1989 The Regents of the University of California. @@ -39,15 +39,17 @@ #if 0 /*static char *sccsid = from: @(#)ctype_.c 5.6 (Berkeley) 6/1/90;*/ #else -__RCSID($NetBSD: ctype_.c,v 1.16 2003/08/07 16:42:46 agc Exp $); +__RCSID($NetBSD: ctype_.c,v 1.17 2010/05/22 06:38:15 tnozaki Exp $); #endif #endif /* LIBC_SCCS and not lint */ -#define _CTYPE_PRIVATE - -#include sys/types.h -#include limits.h #include ctype.h +#include stdio.h +#include ctype_local.h + +#if EOF != -1 +#error EOF != -1 +#endif const unsigned char _C_ctype_[1 + _CTYPE_NUM_CHARS] = { 0, @@ -69,4 +71,4 @@ _L, _L, _L, _P, _P, _P, _P, _C }; -const unsigned char *_ctype_ = _C_ctype_; +const unsigned char *_ctype_ = _C_ctype_[0]; Index: src/lib/libc/gen/tolower_.c diff -u src/lib/libc/gen/tolower_.c:1.11 src/lib/libc/gen/tolower_.c:1.12 --- src/lib/libc/gen/tolower_.c:1.11 Sun Jan 11 02:46:27 2009 +++ src/lib/libc/gen/tolower_.c Sat May 22 06:38:15 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: tolower_.c,v 1.11 2009/01/11 02:46:27 christos Exp $ */ +/* $NetBSD: tolower_.c,v 1.12 2010/05/22 06:38:15 tnozaki Exp $ */ /* * Written by J.T. Conklin j...@netbsd.org. @@ -7,17 +7,18 @@
CVS commit: src
Module Name:src Committed By: tnozaki Date: Sat May 22 07:18:44 UTC 2010 Modified Files: src/lib/libc/locale: _wctrans.c _wctype.c global_locale.c iswctype_mb.c multibyte_amd1.c multibyte_c90.c rune.c rune_local.h runeglue.c runetable.c setlocale1.c setlocale32.c src/usr.bin/mklocale: ldef.h Removed Files: src/lib/libc/locale: rune.h Log Message: include ctype_local.h To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/lib/libc/locale/_wctrans.c cvs rdiff -u -r1.5 -r1.6 src/lib/libc/locale/_wctype.c cvs rdiff -u -r1.6 -r1.7 src/lib/libc/locale/global_locale.c \ src/lib/libc/locale/iswctype_mb.c src/lib/libc/locale/multibyte_c90.c cvs rdiff -u -r1.7 -r1.8 src/lib/libc/locale/multibyte_amd1.c cvs rdiff -u -r1.34 -r1.35 src/lib/libc/locale/rune.c cvs rdiff -u -r1.18 -r0 src/lib/libc/locale/rune.h cvs rdiff -u -r1.12 -r1.13 src/lib/libc/locale/rune_local.h cvs rdiff -u -r1.16 -r1.17 src/lib/libc/locale/runeglue.c cvs rdiff -u -r1.22 -r1.23 src/lib/libc/locale/runetable.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/setlocale1.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/locale/setlocale32.c cvs rdiff -u -r1.5 -r1.6 src/usr.bin/mklocale/ldef.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/locale/_wctrans.c diff -u src/lib/libc/locale/_wctrans.c:1.13 src/lib/libc/locale/_wctrans.c:1.14 --- src/lib/libc/locale/_wctrans.c:1.13 Sun Jan 18 22:03:19 2009 +++ src/lib/libc/locale/_wctrans.c Sat May 22 07:18:43 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: _wctrans.c,v 1.13 2009/01/18 22:03:19 tnozaki Exp $ */ +/* $NetBSD: _wctrans.c,v 1.14 2010/05/22 07:18:43 tnozaki Exp $ */ /*- * Copyright (c)2003 Citrus Project, @@ -60,7 +60,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: _wctrans.c,v 1.13 2009/01/18 22:03:19 tnozaki Exp $); +__RCSID($NetBSD: _wctrans.c,v 1.14 2010/05/22 07:18:43 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h @@ -69,7 +69,6 @@ #include wctype.h #include stdlib.h #include string.h -#include rune.h #include rune_local.h #include _wctrans_local.h Index: src/lib/libc/locale/_wctype.c diff -u src/lib/libc/locale/_wctype.c:1.5 src/lib/libc/locale/_wctype.c:1.6 --- src/lib/libc/locale/_wctype.c:1.5 Sun Jan 18 22:03:19 2009 +++ src/lib/libc/locale/_wctype.c Sat May 22 07:18:43 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: _wctype.c,v 1.5 2009/01/18 22:03:19 tnozaki Exp $ */ +/* $NetBSD: _wctype.c,v 1.6 2010/05/22 07:18:43 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -60,7 +60,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: _wctype.c,v 1.5 2009/01/18 22:03:19 tnozaki Exp $); +__RCSID($NetBSD: _wctype.c,v 1.6 2010/05/22 07:18:43 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include assert.h @@ -68,7 +68,7 @@ #include errno.h #include string.h -#include rune.h +#include rune_local.h #include _wctrans_local.h #include _wctype_local.h Index: src/lib/libc/locale/global_locale.c diff -u src/lib/libc/locale/global_locale.c:1.6 src/lib/libc/locale/global_locale.c:1.7 --- src/lib/libc/locale/global_locale.c:1.6 Sat May 22 06:38:15 2010 +++ src/lib/libc/locale/global_locale.c Sat May 22 07:18:43 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: global_locale.c,v 1.6 2010/05/22 06:38:15 tnozaki Exp $ */ +/* $NetBSD: global_locale.c,v 1.7 2010/05/22 07:18:43 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: global_locale.c,v 1.6 2010/05/22 06:38:15 tnozaki Exp $); +__RCSID($NetBSD: global_locale.c,v 1.7 2010/05/22 07:18:43 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include sys/types.h @@ -40,7 +40,7 @@ #include locale.h #include stdlib.h #ifdef WITH_RUNE -#include rune.h +#include rune_local.h #else #include bsdctype.h #endif Index: src/lib/libc/locale/iswctype_mb.c diff -u src/lib/libc/locale/iswctype_mb.c:1.6 src/lib/libc/locale/iswctype_mb.c:1.7 --- src/lib/libc/locale/iswctype_mb.c:1.6 Sat Mar 27 22:14:09 2010 +++ src/lib/libc/locale/iswctype_mb.c Sat May 22 07:18:43 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: iswctype_mb.c,v 1.6 2010/03/27 22:14:09 tnozaki Exp $ */ +/* $NetBSD: iswctype_mb.c,v 1.7 2010/05/22 07:18:43 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: iswctype_mb.c,v 1.6 2010/03/27 22:14:09 tnozaki Exp $); +__RCSID($NetBSD: iswctype_mb.c,v 1.7 2010/05/22 07:18:43 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h @@ -45,7 +45,7 @@ #include setlocale_local.h -#include rune.h +#include rune_local.h #include _wctype_local.h #include _wctrans_local.h Index: src/lib/libc/locale/multibyte_c90.c diff -u src/lib/libc/locale/multibyte_c90.c:1.6
CVS commit: src/lib/libc/citrus
Module Name:src Committed By: tnozaki Date: Sat May 22 08:13:18 UTC 2010 Modified Files: src/lib/libc/citrus: citrus_lc_ctype.c citrus_lc_messages.c citrus_lc_monetary.c citrus_lc_numeric.c citrus_lc_time.c Log Message: rune.h is not public, so merge with rune_local.h. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/libc/citrus/citrus_lc_ctype.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/citrus/citrus_lc_messages.c \ src/lib/libc/citrus/citrus_lc_monetary.c \ src/lib/libc/citrus/citrus_lc_numeric.c cvs rdiff -u -r1.3 -r1.4 src/lib/libc/citrus/citrus_lc_time.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/citrus/citrus_lc_ctype.c diff -u src/lib/libc/citrus/citrus_lc_ctype.c:1.4 src/lib/libc/citrus/citrus_lc_ctype.c:1.5 --- src/lib/libc/citrus/citrus_lc_ctype.c:1.4 Sat Mar 27 15:25:21 2010 +++ src/lib/libc/citrus/citrus_lc_ctype.c Sat May 22 08:13:18 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_lc_ctype.c,v 1.4 2010/03/27 15:25:21 tnozaki Exp $ */ +/* $NetBSD: citrus_lc_ctype.c,v 1.5 2010/05/22 08:13:18 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: citrus_lc_ctype.c,v 1.4 2010/03/27 15:25:21 tnozaki Exp $); +__RCSID($NetBSD: citrus_lc_ctype.c,v 1.5 2010/05/22 08:13:18 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include reentrant.h @@ -57,7 +57,6 @@ #include citrus_module.h #include citrus_ctype.h -#include rune.h #include rune_local.h #include multibyte.h Index: src/lib/libc/citrus/citrus_lc_messages.c diff -u src/lib/libc/citrus/citrus_lc_messages.c:1.2 src/lib/libc/citrus/citrus_lc_messages.c:1.3 --- src/lib/libc/citrus/citrus_lc_messages.c:1.2 Sun Jan 11 02:46:24 2009 +++ src/lib/libc/citrus/citrus_lc_messages.c Sat May 22 08:13:18 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_lc_messages.c,v 1.2 2009/01/11 02:46:24 christos Exp $ */ +/* $NetBSD: citrus_lc_messages.c,v 1.3 2010/05/22 08:13:18 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: citrus_lc_messages.c,v 1.2 2009/01/11 02:46:24 christos Exp $); +__RCSID($NetBSD: citrus_lc_messages.c,v 1.3 2010/05/22 08:13:18 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h @@ -61,7 +61,7 @@ #include citrus_db.h #include citrus_db_hash.h #include citrus_memstream.h -#include rune.h +#include rune_local.h /* * macro required by all template headers Index: src/lib/libc/citrus/citrus_lc_monetary.c diff -u src/lib/libc/citrus/citrus_lc_monetary.c:1.2 src/lib/libc/citrus/citrus_lc_monetary.c:1.3 --- src/lib/libc/citrus/citrus_lc_monetary.c:1.2 Sun Jan 11 02:46:24 2009 +++ src/lib/libc/citrus/citrus_lc_monetary.c Sat May 22 08:13:18 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_lc_monetary.c,v 1.2 2009/01/11 02:46:24 christos Exp $ */ +/* $NetBSD: citrus_lc_monetary.c,v 1.3 2010/05/22 08:13:18 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: citrus_lc_monetary.c,v 1.2 2009/01/11 02:46:24 christos Exp $); +__RCSID($NetBSD: citrus_lc_monetary.c,v 1.3 2010/05/22 08:13:18 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h @@ -61,7 +61,7 @@ #include citrus_db.h #include citrus_db_hash.h #include citrus_memstream.h -#include rune.h +#include rune_local.h #include fix_grouping.h #include citrus_fix_grouping.h Index: src/lib/libc/citrus/citrus_lc_numeric.c diff -u src/lib/libc/citrus/citrus_lc_numeric.c:1.2 src/lib/libc/citrus/citrus_lc_numeric.c:1.3 --- src/lib/libc/citrus/citrus_lc_numeric.c:1.2 Sun Jan 11 02:46:24 2009 +++ src/lib/libc/citrus/citrus_lc_numeric.c Sat May 22 08:13:18 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_lc_numeric.c,v 1.2 2009/01/11 02:46:24 christos Exp $ */ +/* $NetBSD: citrus_lc_numeric.c,v 1.3 2010/05/22 08:13:18 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: citrus_lc_numeric.c,v 1.2 2009/01/11 02:46:24 christos Exp $); +__RCSID($NetBSD: citrus_lc_numeric.c,v 1.3 2010/05/22 08:13:18 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h @@ -61,7 +61,7 @@ #include citrus_db.h #include citrus_db_hash.h #include citrus_memstream.h -#include rune.h +#include rune_local.h #include fix_grouping.h #include citrus_fix_grouping.h Index: src/lib/libc/citrus/citrus_lc_time.c diff -u src/lib/libc/citrus/citrus_lc_time.c:1.3 src/lib/libc/citrus/citrus_lc_time.c:1.4 --- src/lib/libc/citrus/citrus_lc_time.c:1.3 Mon Feb 9 14:39:48 2009 +++ src/lib/libc/citrus/citrus_lc_time.c Sat May 22 08:13:18 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_lc_time.c,v
CVS commit: src/lib/libc
Module Name:src Committed By: tnozaki Date: Sat May 22 13:15:59 UTC 2010 Modified Files: src/lib/libc/gen: isctype.c src/lib/libc/locale: global_locale.c localeconv.c nb_lc_template.h nl_langinfo.c setlocale_local.h Log Message: make _locale_impl_t.cache as pointer to maintain easily binary compatibility in future. no ABI change was made. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/lib/libc/gen/isctype.c cvs rdiff -u -r1.7 -r1.8 src/lib/libc/locale/global_locale.c cvs rdiff -u -r1.17 -r1.18 src/lib/libc/locale/localeconv.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/nb_lc_template.h cvs rdiff -u -r1.14 -r1.15 src/lib/libc/locale/nl_langinfo.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/locale/setlocale_local.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/gen/isctype.c diff -u src/lib/libc/gen/isctype.c:1.18 src/lib/libc/gen/isctype.c:1.19 --- src/lib/libc/gen/isctype.c:1.18 Sun Jan 11 02:46:27 2009 +++ src/lib/libc/gen/isctype.c Sat May 22 13:15:59 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: isctype.c,v 1.18 2009/01/11 02:46:27 christos Exp $ */ +/* $NetBSD: isctype.c,v 1.19 2010/05/22 13:15:59 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: isctype.c,v 1.18 2009/01/11 02:46:27 christos Exp $); +__RCSID($NetBSD: isctype.c,v 1.19 2010/05/22 13:15:59 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h @@ -44,8 +44,7 @@ #include setlocale_local.h -#define _CTYPE_TAB(table, i) \ -(((*_current_locale())-cache.table + 1)[i]) +#define _CTYPE_TAB(table, i) ((_current_cache()-table + 1)[i]) #undef isalnum #undef isalpha Index: src/lib/libc/locale/global_locale.c diff -u src/lib/libc/locale/global_locale.c:1.7 src/lib/libc/locale/global_locale.c:1.8 --- src/lib/libc/locale/global_locale.c:1.7 Sat May 22 07:18:43 2010 +++ src/lib/libc/locale/global_locale.c Sat May 22 13:15:59 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: global_locale.c,v 1.7 2010/05/22 07:18:43 tnozaki Exp $ */ +/* $NetBSD: global_locale.c,v 1.8 2010/05/22 13:15:59 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: global_locale.c,v 1.7 2010/05/22 07:18:43 tnozaki Exp $); +__RCSID($NetBSD: global_locale.c,v 1.8 2010/05/22 13:15:59 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include sys/types.h @@ -134,16 +134,17 @@ [(size_t)ALT_DIGITS ] = NULL, }; -struct _locale_impl_t _global_locale = -{ -.cache = { -.ctype_tab = (const unsigned char *)_C_ctype_[0], -.tolower_tab = (const short *)_C_tolower_[0], -.toupper_tab = (const short *)_C_toupper_[0], -.mb_cur_max = (size_t)1, -.ldata = _global_ldata, -.items = _global_items[0], -}, +static struct _locale_cache_t _global_cache = { +.ctype_tab = (const unsigned char *)_C_ctype_[0], +.tolower_tab = (const short *)_C_tolower_[0], +.toupper_tab = (const short *)_C_toupper_[0], +.mb_cur_max = (size_t)1, +.ldata = _global_ldata, +.items = _global_items[0], +}; + +struct _locale_impl_t _global_locale = { +.cache = _global_cache, .query = { _C_LOCALE }, .part_name = { [(size_t)LC_ALL ] = _C_LOCALE, Index: src/lib/libc/locale/localeconv.c diff -u src/lib/libc/locale/localeconv.c:1.17 src/lib/libc/locale/localeconv.c:1.18 --- src/lib/libc/locale/localeconv.c:1.17 Sat Mar 27 15:25:22 2010 +++ src/lib/libc/locale/localeconv.c Sat May 22 13:15:59 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: localeconv.c,v 1.17 2010/03/27 15:25:22 tnozaki Exp $ */ +/* $NetBSD: localeconv.c,v 1.18 2010/05/22 13:15:59 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: localeconv.c,v 1.17 2010/03/27 15:25:22 tnozaki Exp $); +__RCSID($NetBSD: localeconv.c,v 1.18 2010/05/22 13:15:59 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include sys/types.h @@ -41,8 +41,5 @@ struct lconv * localeconv() { - struct _locale_impl_t *impl; - - impl = *_current_locale(); - return impl-cache.ldata; + return _current_cache()-ldata; } Index: src/lib/libc/locale/nb_lc_template.h diff -u src/lib/libc/locale/nb_lc_template.h:1.2 src/lib/libc/locale/nb_lc_template.h:1.3 --- src/lib/libc/locale/nb_lc_template.h:1.2 Sun Jan 11 02:46:29 2009 +++ src/lib/libc/locale/nb_lc_template.h Sat May 22 13:15:59 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: nb_lc_template.h,v 1.2 2009/01/11 02:46:29 christos Exp $ */ +/* $NetBSD: nb_lc_template.h,v 1.3 2010/05/22 13:15:59 tnozaki Exp $ */ /*- * Copyright (c)1999, 2008 Citrus Project, @@ -235,7 +235,7 @@ = part-name[0]; locale-part_impl[(size_t)_CATEGORY_ID] = part-impl; -
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Sat May 22 13:50:02 UTC 2010 Modified Files: src/lib/libc/locale: rune_local.h setlocale1.c setlocale32.c setlocale_local.h Log Message: move __mb_len_max_runtime from rune_local.h - setlocale_local.h. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/lib/libc/locale/rune_local.h cvs rdiff -u -r1.3 -r1.4 src/lib/libc/locale/setlocale1.c cvs rdiff -u -r1.5 -r1.6 src/lib/libc/locale/setlocale32.c \ src/lib/libc/locale/setlocale_local.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/locale/rune_local.h diff -u src/lib/libc/locale/rune_local.h:1.13 src/lib/libc/locale/rune_local.h:1.14 --- src/lib/libc/locale/rune_local.h:1.13 Sat May 22 07:18:43 2010 +++ src/lib/libc/locale/rune_local.h Sat May 22 13:50:02 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rune_local.h,v 1.13 2010/05/22 07:18:43 tnozaki Exp $ */ +/* $NetBSD: rune_local.h,v 1.14 2010/05/22 13:50:02 tnozaki Exp $ */ /*- * Copyright (c) 2000 Citrus Project, @@ -111,9 +111,6 @@ /* * global variables */ -extern size_t __mb_len_max_runtime; -#define __MB_LEN_MAX_RUNTIME __mb_len_max_runtime - extern const _RuneLocale _DefaultRuneLocale; extern const _RuneLocale *_CurrentRuneLocale; Index: src/lib/libc/locale/setlocale1.c diff -u src/lib/libc/locale/setlocale1.c:1.3 src/lib/libc/locale/setlocale1.c:1.4 --- src/lib/libc/locale/setlocale1.c:1.3 Sat May 22 07:18:43 2010 +++ src/lib/libc/locale/setlocale1.c Sat May 22 13:50:02 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: setlocale1.c,v 1.3 2010/05/22 07:18:43 tnozaki Exp $ */ +/* $NetBSD: setlocale1.c,v 1.4 2010/05/22 13:50:02 tnozaki Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -28,12 +28,14 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: setlocale1.c,v 1.3 2010/05/22 07:18:43 tnozaki Exp $); +__RCSID($NetBSD: setlocale1.c,v 1.4 2010/05/22 13:50:02 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h +#include sys/types.h #define __SETLOCALE_SOURCE__ #include locale.h +#include setlocale_local.h #include rune_local.h __warn_references(setlocale, Index: src/lib/libc/locale/setlocale32.c diff -u src/lib/libc/locale/setlocale32.c:1.5 src/lib/libc/locale/setlocale32.c:1.6 --- src/lib/libc/locale/setlocale32.c:1.5 Sat May 22 07:18:43 2010 +++ src/lib/libc/locale/setlocale32.c Sat May 22 13:50:02 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: setlocale32.c,v 1.5 2010/05/22 07:18:43 tnozaki Exp $ */ +/* $NetBSD: setlocale32.c,v 1.6 2010/05/22 13:50:02 tnozaki Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -28,13 +28,15 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: setlocale32.c,v 1.5 2010/05/22 07:18:43 tnozaki Exp $); +__RCSID($NetBSD: setlocale32.c,v 1.6 2010/05/22 13:50:02 tnozaki Exp $); #endif /* LIBC_SCCS and not lint */ #include namespace.h +#include sys/types.h #define __SETLOCALE_SOURCE__ #include locale.h #include limits.h +#include setlocale_local.h #include rune_local.h char * Index: src/lib/libc/locale/setlocale_local.h diff -u src/lib/libc/locale/setlocale_local.h:1.5 src/lib/libc/locale/setlocale_local.h:1.6 --- src/lib/libc/locale/setlocale_local.h:1.5 Sat May 22 13:15:59 2010 +++ src/lib/libc/locale/setlocale_local.h Sat May 22 13:50:02 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: setlocale_local.h,v 1.5 2010/05/22 13:15:59 tnozaki Exp $ */ +/* $NetBSD: setlocale_local.h,v 1.6 2010/05/22 13:50:02 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -77,4 +77,7 @@ return (*_current_locale())-cache; } +extern size_t __mb_len_max_runtime; +#define __MB_LEN_MAX_RUNTIME __mb_len_max_runtime + #endif /*_SETLOCALE_LOCAL_H_*/
CVS commit: src/usr.bin/mklocale
Module Name:src Committed By: tnozaki Date: Sat May 22 17:43:29 UTC 2010 Modified Files: src/usr.bin/mklocale: ldef.h yacc.y Log Message: yacc.y: s/_CTYPE_NUM_CHARS/_CTYPE_CACHED_SIZE/ ldef.h: remove redundant include, ctype_local.h is already included by runetype_local.h. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.bin/mklocale/ldef.h cvs rdiff -u -r1.28 -r1.29 src/usr.bin/mklocale/yacc.y Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/mklocale/ldef.h diff -u src/usr.bin/mklocale/ldef.h:1.6 src/usr.bin/mklocale/ldef.h:1.7 --- src/usr.bin/mklocale/ldef.h:1.6 Sat May 22 07:18:44 2010 +++ src/usr.bin/mklocale/ldef.h Sat May 22 17:43:29 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ldef.h,v 1.6 2010/05/22 07:18:44 tnozaki Exp $ */ +/* $NetBSD: ldef.h,v 1.7 2010/05/22 17:43:29 tnozaki Exp $ */ /*- * Copyright (c) 1993 @@ -34,8 +34,6 @@ * @(#)ldef.h 8.1 (Berkeley) 6/6/93 */ -#include ctype_local.h - /* * This should look a LOT like a _RuneEntry */ @@ -48,6 +46,6 @@ } rune_list; typedef struct rune_map { -u_int32_t map[_CTYPE_NUM_CHARS]; +u_int32_t map[18]; rune_list *root; } rune_map; Index: src/usr.bin/mklocale/yacc.y diff -u src/usr.bin/mklocale/yacc.y:1.28 src/usr.bin/mklocale/yacc.y:1.29 --- src/usr.bin/mklocale/yacc.y:1.28 Sat May 22 06:38:15 2010 +++ src/usr.bin/mklocale/yacc.y Sat May 22 17:43:29 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: yacc.y,v 1.28 2010/05/22 06:38:15 tnozaki Exp $ */ +/* $NetBSD: yacc.y,v 1.29 2010/05/22 17:43:29 tnozaki Exp $ */ %{ /*- @@ -43,7 +43,7 @@ static char sccsid[] = @(#)yacc.y 8.1 (Berkeley) 6/6/93; static char rcsid[] = $FreeBSD$; #else -__RCSID($NetBSD: yacc.y,v 1.28 2010/05/22 06:38:15 tnozaki Exp $); +__RCSID($NetBSD: yacc.y,v 1.29 2010/05/22 17:43:29 tnozaki Exp $); #endif #endif /* not lint */ @@ -303,7 +303,7 @@ return 0; } -for (x = 0; x _CTYPE_NUM_CHARS; ++x) { +for (x = 0; x _CTYPE_CACHE_SIZE; ++x) { mapupper.map[x] = x; maplower.map[x] = x; } @@ -421,7 +421,7 @@ rune_list *r; __nbrune_t run; -while (list-min _CTYPE_NUM_CHARS list-min = list-max) { +while (list-min _CTYPE_CACHE_SIZE list-min = list-max) { if (flag) map-map[list-min++] |= flag; else @@ -655,7 +655,7 @@ * (Machines like Crays cannot share with little machines due to * word size. Sigh. We tried.) */ -for (x = 0; x _CTYPE_NUM_CHARS; ++x) { +for (x = 0; x _CTYPE_CACHE_SIZE; ++x) { file_new_locale.frl_runetype[x] = htonl(types.map[x]); file_new_locale.frl_maplower[x] = htonl(maplower.map[x]); file_new_locale.frl_mapupper[x] = htonl(mapupper.map[x]); @@ -778,7 +778,7 @@ fprintf(stderr, \nMAPLOWER:\n\n); -for (x = 0; x _CTYPE_NUM_CHARS; ++x) { +for (x = 0; x _CTYPE_CACHE_SIZE; ++x) { if (isprint(maplower.map[x])) fprintf(stderr, '%c', (int)maplower.map[x]); else if (maplower.map[x]) @@ -797,7 +797,7 @@ fprintf(stderr, \nMAPUPPER:\n\n); -for (x = 0; x _CTYPE_NUM_CHARS; ++x) { +for (x = 0; x _CTYPE_CACHE_SIZE; ++x) { if (isprint(mapupper.map[x])) fprintf(stderr, '%c', (int)mapupper.map[x]); else if (mapupper.map[x]) @@ -817,7 +817,7 @@ fprintf(stderr, \nTYPES:\n\n); -for (x = 0; x _CTYPE_NUM_CHARS; ++x) { +for (x = 0; x _CTYPE_CACHE_SIZE; ++x) { u_int32_t r = types.map[x]; if (r) {
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Sat May 22 17:47:25 UTC 2010 Modified Files: src/lib/libc/locale: runetype_local.h Log Message: fix cross build breakage under linux box, reported by Andreas Gustafsson, thanks! runetype_local.h: don't include ctype_local.h when toolchain build. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/lib/libc/locale/runetype_local.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/locale/runetype_local.h diff -u src/lib/libc/locale/runetype_local.h:1.6 src/lib/libc/locale/runetype_local.h:1.7 --- src/lib/libc/locale/runetype_local.h:1.6 Sat May 22 06:38:15 2010 +++ src/lib/libc/locale/runetype_local.h Sat May 22 17:47:25 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: runetype_local.h,v 1.6 2010/05/22 06:38:15 tnozaki Exp $ */ +/* $NetBSD: runetype_local.h,v 1.7 2010/05/22 17:47:25 tnozaki Exp $ */ /*- * Copyright (c) 1993 @@ -39,7 +39,12 @@ #include sys/cdefs.h #include sys/types.h + +#ifdef HAVE_NBTOOL_CONFIG_H +#define _CTYPE_CACHE_SIZE (1 8) +#else #include ctype_local.h +#endif /* for cross host tools on older systems */ #ifndef UINT32_C
CVS commit: src
Module Name:src Committed By: tnozaki Date: Sat May 22 07:18:44 UTC 2010 Modified Files: src/lib/libc/locale: _wctrans.c _wctype.c global_locale.c iswctype_mb.c multibyte_amd1.c multibyte_c90.c rune.c rune_local.h runeglue.c runetable.c setlocale1.c setlocale32.c src/usr.bin/mklocale: ldef.h Removed Files: src/lib/libc/locale: rune.h Log Message: include ctype_local.h To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/lib/libc/locale/_wctrans.c cvs rdiff -u -r1.5 -r1.6 src/lib/libc/locale/_wctype.c cvs rdiff -u -r1.6 -r1.7 src/lib/libc/locale/global_locale.c \ src/lib/libc/locale/iswctype_mb.c src/lib/libc/locale/multibyte_c90.c cvs rdiff -u -r1.7 -r1.8 src/lib/libc/locale/multibyte_amd1.c cvs rdiff -u -r1.34 -r1.35 src/lib/libc/locale/rune.c cvs rdiff -u -r1.18 -r0 src/lib/libc/locale/rune.h cvs rdiff -u -r1.12 -r1.13 src/lib/libc/locale/rune_local.h cvs rdiff -u -r1.16 -r1.17 src/lib/libc/locale/runeglue.c cvs rdiff -u -r1.22 -r1.23 src/lib/libc/locale/runetable.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/setlocale1.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/locale/setlocale32.c cvs rdiff -u -r1.5 -r1.6 src/usr.bin/mklocale/ldef.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/citrus
Module Name:src Committed By: tnozaki Date: Sat May 22 08:13:18 UTC 2010 Modified Files: src/lib/libc/citrus: citrus_lc_ctype.c citrus_lc_messages.c citrus_lc_monetary.c citrus_lc_numeric.c citrus_lc_time.c Log Message: rune.h is not public, so merge with rune_local.h. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/libc/citrus/citrus_lc_ctype.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/citrus/citrus_lc_messages.c \ src/lib/libc/citrus/citrus_lc_monetary.c \ src/lib/libc/citrus/citrus_lc_numeric.c cvs rdiff -u -r1.3 -r1.4 src/lib/libc/citrus/citrus_lc_time.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: tnozaki Date: Sat May 22 09:11:04 UTC 2010 Modified Files: src: UPDATING Log Message: ctype.h was splitted, so you have to make cleandir tools/mklocale. To generate a diff of this commit: cvs rdiff -u -r1.210 -r1.211 src/UPDATING Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc
Module Name:src Committed By: tnozaki Date: Sat May 22 13:15:59 UTC 2010 Modified Files: src/lib/libc/gen: isctype.c src/lib/libc/locale: global_locale.c localeconv.c nb_lc_template.h nl_langinfo.c setlocale_local.h Log Message: make _locale_impl_t.cache as pointer to maintain easily binary compatibility in future. no ABI change was made. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/lib/libc/gen/isctype.c cvs rdiff -u -r1.7 -r1.8 src/lib/libc/locale/global_locale.c cvs rdiff -u -r1.17 -r1.18 src/lib/libc/locale/localeconv.c cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/nb_lc_template.h cvs rdiff -u -r1.14 -r1.15 src/lib/libc/locale/nl_langinfo.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/locale/setlocale_local.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Sat May 22 13:50:02 UTC 2010 Modified Files: src/lib/libc/locale: rune_local.h setlocale1.c setlocale32.c setlocale_local.h Log Message: move __mb_len_max_runtime from rune_local.h - setlocale_local.h. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/lib/libc/locale/rune_local.h cvs rdiff -u -r1.3 -r1.4 src/lib/libc/locale/setlocale1.c cvs rdiff -u -r1.5 -r1.6 src/lib/libc/locale/setlocale32.c \ src/lib/libc/locale/setlocale_local.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/locale
Module Name:src Committed By: tnozaki Date: Sat May 22 17:47:25 UTC 2010 Modified Files: src/lib/libc/locale: runetype_local.h Log Message: fix cross build breakage under linux box, reported by Andreas Gustafsson, thanks! runetype_local.h: don't include ctype_local.h when toolchain build. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/lib/libc/locale/runetype_local.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: tnozaki Date: Thu May 13 17:52:12 UTC 2010 Modified Files: src/dist/nvi/common: options.c src/dist/nvi/ex: ex_cscope.c ex_tag.c ex_usage.c src/dist/nvi/vi: vs_msg.c src/games/factor: factor.c src/games/number: number.c src/games/primes: primes.c src/lib/libform: internals.c type_enum.c src/sbin/ldconfig: ldconfig.c src/usr.sbin/syslogd: tls.c Log Message: cast isblank(3)'s argument to unsigned char. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/dist/nvi/common/options.c cvs rdiff -u -r1.5 -r1.6 src/dist/nvi/ex/ex_cscope.c cvs rdiff -u -r1.7 -r1.8 src/dist/nvi/ex/ex_tag.c cvs rdiff -u -r1.4 -r1.5 src/dist/nvi/ex/ex_usage.c cvs rdiff -u -r1.3 -r1.4 src/dist/nvi/vi/vs_msg.c cvs rdiff -u -r1.22 -r1.23 src/games/factor/factor.c cvs rdiff -u -r1.13 -r1.14 src/games/number/number.c cvs rdiff -u -r1.17 -r1.18 src/games/primes/primes.c cvs rdiff -u -r1.33 -r1.34 src/lib/libform/internals.c cvs rdiff -u -r1.10 -r1.11 src/lib/libform/type_enum.c cvs rdiff -u -r1.46 -r1.47 src/sbin/ldconfig/ldconfig.c cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/syslogd/tls.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/dist/nvi/common/options.c diff -u src/dist/nvi/common/options.c:1.7 src/dist/nvi/common/options.c:1.8 --- src/dist/nvi/common/options.c:1.7 Sat Nov 14 23:31:37 2009 +++ src/dist/nvi/common/options.c Thu May 13 17:52:11 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: options.c,v 1.7 2009/11/14 23:31:37 christos Exp $ */ +/* $NetBSD: options.c,v 1.8 2010/05/13 17:52:11 tnozaki Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -1036,7 +1036,7 @@ } (void)putc('=', fp); for (np = O_STR(sp, cnt); (nch = *np) != '\0'; ++np) { -if (isblank(nch) || nch == '\\') +if (isblank((unsigned char)nch) || nch == '\\') (void)putc('\\', fp); (void)putc(nch, fp); } Index: src/dist/nvi/ex/ex_cscope.c diff -u src/dist/nvi/ex/ex_cscope.c:1.5 src/dist/nvi/ex/ex_cscope.c:1.6 --- src/dist/nvi/ex/ex_cscope.c:1.5 Tue Nov 24 13:12:01 2009 +++ src/dist/nvi/ex/ex_cscope.c Thu May 13 17:52:11 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ex_cscope.c,v 1.5 2009/11/24 13:12:01 tnozaki Exp $ */ +/* $NetBSD: ex_cscope.c,v 1.6 2010/05/13 17:52:11 tnozaki Exp $ */ /*- * Copyright (c) 1994, 1996 @@ -606,8 +606,8 @@ goto usage; /* Skip leading blanks, check for command character. */ - for (; isblank(pattern[0]); ++pattern); - if (pattern[0] == '\0' || !isblank(pattern[1])) + for (; isblank((unsigned char)pattern[0]); ++pattern); + if (pattern[0] == '\0' || !isblank((unsigned char)pattern[1])) goto usage; for (*searchp = 0, p = CSCOPE_QUERIES; *p != '\0' *p != pattern[0]; ++*searchp, ++p); @@ -619,7 +619,7 @@ } /* Skip blank characters to the pattern. */ - for (p = pattern + 1; *p != '\0' isblank(*p); ++p); + for (p = pattern + 1; *p != '\0' isblank((unsigned char)*p); ++p); if (*p == '\0') { usage: (void)csc_help(sp, find); return (NULL); Index: src/dist/nvi/ex/ex_tag.c diff -u src/dist/nvi/ex/ex_tag.c:1.7 src/dist/nvi/ex/ex_tag.c:1.8 --- src/dist/nvi/ex/ex_tag.c:1.7 Tue Nov 24 13:12:01 2009 +++ src/dist/nvi/ex/ex_tag.c Thu May 13 17:52:11 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ex_tag.c,v 1.7 2009/11/24 13:12:01 tnozaki Exp $ */ +/* $NetBSD: ex_tag.c,v 1.8 2010/05/13 17:52:11 tnozaki Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -899,7 +899,7 @@ /* Create new queue. */ for (p = t = str;; ++p) { - if (*p == '\0' || isblank(*p)) { + if (*p == '\0' || isblank((unsigned char)*p)) { if ((len = p - t) 1) { MALLOC_RET(sp, tfp, TAGF *, sizeof(TAGF)); MALLOC(sp, tfp-name, char *, len + 1); Index: src/dist/nvi/ex/ex_usage.c diff -u src/dist/nvi/ex/ex_usage.c:1.4 src/dist/nvi/ex/ex_usage.c:1.5 --- src/dist/nvi/ex/ex_usage.c:1.4 Wed Dec 23 12:44:22 2009 +++ src/dist/nvi/ex/ex_usage.c Thu May 13 17:52:11 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ex_usage.c,v 1.4 2009/12/23 12:44:22 mlelstv Exp $ */ +/* $NetBSD: ex_usage.c,v 1.5 2010/05/13 17:52:11 tnozaki Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -178,7 +178,7 @@ else (void)ex_printf(sp, Key:%s%s\nUsage: %s\n, - isblank(*kp-help) ? : , kp-help, kp-usage); + isblank((unsigned char)*kp-help) ? : , kp-help, kp-usage); break; case 0: for (key = 0; key = MAXVIKEY !INTERRUPTED(sp); ++key) { Index: src/dist/nvi/vi/vs_msg.c diff -u src/dist/nvi/vi/vs_msg.c:1.3 src/dist/nvi/vi/vs_msg.c:1.4 --- src/dist/nvi/vi/vs_msg.c:1.3 Sat Nov 14 23:40:11 2009 +++ src/dist/nvi/vi/vs_msg.c Thu May 13 17:52:11 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: vs_msg.c,v 1.3 2009/11/14 23:40:11 christos Exp $ */ +/* $NetBSD: vs_msg.c,v 1.4 2010/05/13 17:52:11 tnozaki Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -355,16 +355,16 @@ } vip-mtype = mtype; for (s = line;; s = t) { - for (; len 0