Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Rename fixup to update_global to better reflect the purpose.



details:   https://anonhg.NetBSD.org/src/rev/fa60c88c1461
branches:  trunk
changeset: 789418:fa60c88c1461
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sun Aug 18 20:03:48 2013 +0000

description:
Rename fixup to update_global to better reflect the purpose.
Remove the various Current pointers, they are implementation internals
that shouldn't be leaked. Remove _CATEGORY_DEFAULT related handling and
directly pick the implemenation pointer from the C locale.
Merge the C locale data into global_locale.c with the exception of
_DefaultRuneLocale. Mark that one hidden. Move _RUNE_LOCALE and
_CITRUS_CTYPE into multibyte.h and pick up the correct rl_citrus_ctype
for non-default locales.

diffstat:

 lib/libc/citrus/citrus_lc_ctype.c     |   8 +--
 lib/libc/locale/Makefile.inc          |   5 +-
 lib/libc/locale/_def_messages.c       |  24 ----------
 lib/libc/locale/_def_monetary.c       |  42 ------------------
 lib/libc/locale/_def_numeric.c        |  23 ---------
 lib/libc/locale/_def_time.c           |  40 -----------------
 lib/libc/locale/global_locale.c       |  67 ++++++++++++++++++++++++++++-
 lib/libc/locale/multibyte.h           |  17 +++---
 lib/libc/locale/multibyte_amd1.c      |  22 +++------
 lib/libc/locale/multibyte_c90.c       |  12 +---
 lib/libc/locale/nb_lc_messages_misc.h |   8 +--
 lib/libc/locale/nb_lc_monetary_misc.h |   8 +--
 lib/libc/locale/nb_lc_numeric_misc.h  |   8 +--
 lib/libc/locale/nb_lc_template.h      |  81 +++++++++++++++++-----------------
 lib/libc/locale/nb_lc_template_decl.h |   4 +-
 lib/libc/locale/nb_lc_time_misc.h     |   6 +-
 lib/libc/locale/runetable.c           |   8 +--
 lib/libc/locale/runetype_local.h      |   5 +-
 sys/sys/localedef.h                   |  17 +------
 19 files changed, 145 insertions(+), 260 deletions(-)

diffs (truncated from 862 to 300 lines):

diff -r d1956b9284ee -r fa60c88c1461 lib/libc/citrus/citrus_lc_ctype.c
--- a/lib/libc/citrus/citrus_lc_ctype.c Sun Aug 18 16:55:47 2013 +0000
+++ b/lib/libc/citrus/citrus_lc_ctype.c Sun Aug 18 20:03:48 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_lc_ctype.c,v 1.11 2013/04/13 10:21:20 joerg Exp $ */
+/* $NetBSD: citrus_lc_ctype.c,v 1.12 2013/08/18 20:03:48 joerg 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.11 2013/04/13 10:21:20 joerg Exp $");
+__RCSID("$NetBSD: citrus_lc_ctype.c,v 1.12 2013/08/18 20:03:48 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "reentrant.h"
@@ -115,7 +115,7 @@
 }
 
 static __inline void
-_PREFIX(fixup)(_RuneLocale *data)
+_PREFIX(update_global)(_RuneLocale *data)
 {
        _DIAGASSERT(data != NULL);
 
@@ -123,7 +123,6 @@
        _ctype_tab_ = data->rl_ctype_tab;
        _tolower_tab_ = data->rl_tolower_tab;
        _toupper_tab_ = data->rl_toupper_tab;
-       _CurrentRuneLocale = data;
 
 #ifdef __BUILD_LEGACY
        _ctype_ = data->rl_compat_bsdctype;
@@ -135,6 +134,5 @@
  */
 #define _CATEGORY_ID           LC_CTYPE
 #define _CATEGORY_NAME         "LC_CTYPE"
-#define _CATEGORY_DEFAULT      _DefaultRuneLocale
 
 #include "nb_lc_template.h"
diff -r d1956b9284ee -r fa60c88c1461 lib/libc/locale/Makefile.inc
--- a/lib/libc/locale/Makefile.inc      Sun Aug 18 16:55:47 2013 +0000
+++ b/lib/libc/locale/Makefile.inc      Sun Aug 18 20:03:48 2013 +0000
@@ -1,11 +1,10 @@
 #      from: @(#)Makefile.inc  5.1 (Berkeley) 2/18/91
-#      $NetBSD: Makefile.inc,v 1.63 2013/05/17 12:55:57 joerg Exp $
+#      $NetBSD: Makefile.inc,v 1.64 2013/08/18 20:03:48 joerg Exp $
 
 # locale sources
 .PATH: ${ARCHDIR}/locale ${.CURDIR}/locale
 
-SRCS+= _def_messages.c _def_monetary.c _def_numeric.c _def_time.c \
-       setlocale.c __mb_cur_max.c \
+SRCS+= setlocale.c __mb_cur_max.c \
        duplocale.c global_locale.c fix_grouping.c \
        freelocale.c localeconv.c newlocale.c nl_langinfo.c \
        generic_lc_all.c dummy_lc_collate.c \
diff -r d1956b9284ee -r fa60c88c1461 lib/libc/locale/_def_messages.c
--- a/lib/libc/locale/_def_messages.c   Sun Aug 18 16:55:47 2013 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-/*     $NetBSD: _def_messages.c,v 1.6 2005/06/12 05:21:27 lukem Exp $  */
-
-/*
- * Written by J.T. Conklin <jtc%NetBSD.org@localhost>.
- * Public domain.
- */
-
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: _def_messages.c,v 1.6 2005/06/12 05:21:27 lukem Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/localedef.h>
-#include <locale.h>
-
-const _MessagesLocale _DefaultMessagesLocale = 
-{
-       "^[Yy]",
-       "^[Nn]",
-       "yes",
-       "no"
-} ;
-
-const _MessagesLocale *_CurrentMessagesLocale = &_DefaultMessagesLocale;
diff -r d1956b9284ee -r fa60c88c1461 lib/libc/locale/_def_monetary.c
--- a/lib/libc/locale/_def_monetary.c   Sun Aug 18 16:55:47 2013 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*     $NetBSD: _def_monetary.c,v 1.8 2005/06/12 05:21:27 lukem Exp $  */
-
-/*
- * Written by J.T. Conklin <jtc%NetBSD.org@localhost>.
- * Public domain.
- */
-
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: _def_monetary.c,v 1.8 2005/06/12 05:21:27 lukem Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/localedef.h>
-#include <limits.h>
-#include <locale.h>
-
-const _MonetaryLocale _DefaultMonetaryLocale = 
-{
-       "",
-       "",
-       "",
-       "",
-       "",
-       "",
-       "",
-       (char)CHAR_MAX,
-       (char)CHAR_MAX,
-       (char)CHAR_MAX,
-       (char)CHAR_MAX,
-       (char)CHAR_MAX,
-       (char)CHAR_MAX,
-       (char)CHAR_MAX,
-       (char)CHAR_MAX,
-       (char)CHAR_MAX,
-       (char)CHAR_MAX,
-       (char)CHAR_MAX,
-       (char)CHAR_MAX,
-       (char)CHAR_MAX,
-       (char)CHAR_MAX
-};
-
-const _MonetaryLocale *_CurrentMonetaryLocale = &_DefaultMonetaryLocale;
diff -r d1956b9284ee -r fa60c88c1461 lib/libc/locale/_def_numeric.c
--- a/lib/libc/locale/_def_numeric.c    Sun Aug 18 16:55:47 2013 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-/*     $NetBSD: _def_numeric.c,v 1.6 2005/06/12 05:21:27 lukem Exp $   */
-
-/*
- * Written by J.T. Conklin <jtc%NetBSD.org@localhost>.
- * Public domain.
- */
-
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: _def_numeric.c,v 1.6 2005/06/12 05:21:27 lukem Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/localedef.h>
-#include <locale.h>
-
-const _NumericLocale _DefaultNumericLocale = 
-{
-       ".",
-       "",
-       ""
-};
-
-const _NumericLocale *_CurrentNumericLocale = &_DefaultNumericLocale;
diff -r d1956b9284ee -r fa60c88c1461 lib/libc/locale/_def_time.c
--- a/lib/libc/locale/_def_time.c       Sun Aug 18 16:55:47 2013 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*     $NetBSD: _def_time.c,v 1.11 2013/04/21 17:45:46 joerg Exp $     */
-
-/*
- * Written by J.T. Conklin <jtc%NetBSD.org@localhost>.
- * Public domain.
- */
-
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: _def_time.c,v 1.11 2013/04/21 17:45:46 joerg Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/localedef.h>
-#include <locale.h>
-
-const _TimeLocale _DefaultTimeLocale = 
-{
-       {
-               "Sun","Mon","Tue","Wed","Thu","Fri","Sat",
-       },
-       {
-               "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
-               "Friday", "Saturday"
-       },
-       {
-               "Jan", "Feb", "Mar", "Apr", "May", "Jun",
-               "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
-       },
-       {
-               "January", "February", "March", "April", "May", "June", "July",
-               "August", "September", "October", "November", "December"
-       },
-       {
-               "AM", "PM"
-       },
-       "%a %b %e %H:%M:%S %Y",
-       "%m/%d/%y",
-       "%H:%M:%S",
-       "%I:%M:%S %p"
-};
diff -r d1956b9284ee -r fa60c88c1461 lib/libc/locale/global_locale.c
--- a/lib/libc/locale/global_locale.c   Sun Aug 18 16:55:47 2013 +0000
+++ b/lib/libc/locale/global_locale.c   Sun Aug 18 20:03:48 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: global_locale.c,v 1.17 2013/05/17 12:55:57 joerg Exp $ */
+/* $NetBSD: global_locale.c,v 1.18 2013/08/18 20:03:48 joerg 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.17 2013/05/17 12:55:57 joerg Exp $");
+__RCSID("$NetBSD: global_locale.c,v 1.18 2013/08/18 20:03:48 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -47,6 +47,69 @@
 #define NBCHAR_MAX (char)CHAR_MAX
 #endif
 
+static const _MessagesLocale _DefaultMessagesLocale = {
+       "^[Yy]",
+       "^[Nn]",
+       "yes",
+       "no"
+};
+
+static const _MonetaryLocale _DefaultMonetaryLocale = {
+       "",
+       "",
+       "",
+       "",
+       "",
+       "",
+       "",
+       (char)CHAR_MAX,
+       (char)CHAR_MAX,
+       (char)CHAR_MAX,
+       (char)CHAR_MAX,
+       (char)CHAR_MAX,
+       (char)CHAR_MAX,
+       (char)CHAR_MAX,
+       (char)CHAR_MAX,
+       (char)CHAR_MAX,
+       (char)CHAR_MAX,
+       (char)CHAR_MAX,
+       (char)CHAR_MAX,
+       (char)CHAR_MAX,
+       (char)CHAR_MAX
+};
+
+static const _NumericLocale _DefaultNumericLocale = {
+       ".",
+       "",
+       ""
+};
+
+static const _TimeLocale _DefaultTimeLocale = 
+{
+       {
+               "Sun","Mon","Tue","Wed","Thu","Fri","Sat",
+       },
+       {
+               "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
+               "Friday", "Saturday"
+       },
+       {
+               "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+               "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+       },
+       {
+               "January", "February", "March", "April", "May", "June", "July",
+               "August", "September", "October", "November", "December"
+       },
+       {
+               "AM", "PM"
+       },
+       "%a %b %e %H:%M:%S %Y",
+       "%m/%d/%y",
+       "%H:%M:%S",
+       "%I:%M:%S %p"
+};
+
 static const struct lconv _C_ldata = {
        .decimal_point          = __UNCONST("."),
        .thousands_sep          = __UNCONST(""),
diff -r d1956b9284ee -r fa60c88c1461 lib/libc/locale/multibyte.h
--- a/lib/libc/locale/multibyte.h       Sun Aug 18 16:55:47 2013 +0000
+++ b/lib/libc/locale/multibyte.h       Sun Aug 18 20:03:48 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: multibyte.h,v 1.5 2009/01/11 02:46:28 christos Exp $   */
+/*     $NetBSD: multibyte.h,v 1.6 2013/08/18 20:03:48 joerg Exp $      */
 
 /*-



Home | Main Index | Thread Index | Old Index