+2002-03-14 Jakub Jelinek <jakub@redhat.com>
+
+ * locale/broken_cur_max.c (__ctype_get_mb_cur_max): Use nl_langinfo.
+ * locale/Versions (_nl_current_LC_COLLATE, _nl_current_LC_CTYPE):
+ Remove.
+
+2002-03-14 Jakub Jelinek <jakub@redhat.com>
+
+ * sysdeps/generic/mp_clz_tab.c: New file.
+ * sysdeps/i386/mp_clz_tab.c: New file.
+ * sysdeps/hppa/mp_clz_tab.c: New file.
+ * sysdeps/powerpc/mp_clz_tab.c: New file.
+ * stdlib/Makefile (aux): Revert last patch.
+ * math/Makefile (gmp-objs): Likewise.
+
+2002-03-13 Paul Eggert <eggert@twinsun.com>
+
+ * time/strftime.c: Comment fixes for references to obsolescent
+ standards, In most cases the simplest fix is to remove the
+ confusing comments. Cross-referencing all the standards properly
+ is a bit of a pain, and it should be enough to put that info in
+ the documentation as I did in my recent time.texi patch.
+
+2002-03-13 Paul Eggert <eggert@twinsun.com>
+
+ * manual/time.texi (Formatting Calendar Time):
+ ISO C99 also specifies the E and O modifiers.
+ %P is a GNU extension, and is not in ISO C99.
+ Mention that %r is equivalent to %I:%M:%S %p in the POSIX locale.
+ %T is also in ISO C99.
+ The RFC 822 example is not valid in arbitrary locales.
+ Reword the POSIX.2 wording slightly, to make it a bit clearer
+ that POSIX.2 formats are also supported by later POSIX versions.
+ If a format was introduced in ISO C99 it is also required by
+ POSIX.1-2001.
+
2002-03-13 Ulrich Drepper <drepper@redhat.com>
* sysdeps/gnu/errlist.awk: Define _sys_errlist_internal and
# global variables
__collate_element_hash; __collate_element_strings;
__collate_symbol_classes; __collate_symbol_hash; __collate_symbol_strings;
- _nl_current_LC_COLLATE; _nl_current_LC_CTYPE;
}
}
size_t
__ctype_get_mb_cur_max (void)
{
- size_t correct_value = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX);
+ union locale_data_value u;
- return ((size_t []) { 1, 1, 1, 2, 2, 3, 4 })[correct_value];
+ u.string = nl_langinfo (_NL_CTYPE_MB_CUR_MAX);
+ return ((size_t []) { 1, 1, 1, 2, 2, 3, 4 })[u.word];
}
size.
An optional modifier can follow the optional flag and width
-specification. The modifiers, which are POSIX.2 extensions, are:
+specification. The modifiers, which were first standardized by
+POSIX.2-1992 and by @w{ISO C99}, are:
@table @code
@item E
The century of the year. This is equivalent to the greatest integer not
greater than the year divided by 100.
-This format is a POSIX.2 extension and also appears in @w{ISO C99}.
+This format was first standardized by POSIX.2-1992 and by @w{ISO C99}.
@item %d
The day of the month as a decimal number (range @code{01} through @code{31}).
@item %D
The date using the format @code{%m/%d/%y}.
-This format is a POSIX.2 extension and also appears in @w{ISO C99}.
+This format was first standardized by POSIX.2-1992 and by @w{ISO C99}.
@item %e
The day of the month like with @code{%d}, but padded with blank (range
@code{ 1} through @code{31}).
-This format is a POSIX.2 extension and also appears in @w{ISO C99}.
+This format was first standardized by POSIX.2-1992 and by @w{ISO C99}.
@item %F
The date using the format @code{%Y-%m-%d}. This is the form specified
in the @w{ISO 8601} standard and is the preferred form for all uses.
-This format is a @w{ISO C99} extension.
+This format was first standardized by @w{ISO C99} and by POSIX.1-2001.
@item %g
The year corresponding to the ISO week number, but without the century
as @code{%y}, except that if the ISO week number (see @code{%V}) belongs
to the previous or next year, that year is used instead.
-This format was introduced in @w{ISO C99}.
+This format was first standardized by @w{ISO C99} and by POSIX.1-2001.
@item %G
The year corresponding to the ISO week number. This has the same format
@code{%V}) belongs to the previous or next year, that year is used
instead.
-This format was introduced in @w{ISO C99} but was previously available
-as a GNU extension.
+This format was first standardized by @w{ISO C99} and by POSIX.1-2001
+but was previously available as a GNU extension.
@item %h
The abbreviated month name according to the current locale. The action
is the same as for @code{%b}.
-This format is a POSIX.2 extension and also appears in @w{ISO C99}.
+This format was first standardized by POSIX.2-1992 and by @w{ISO C99}.
@item %H
The hour as a decimal number, using a 24-hour clock (range @code{00} through
@item %n
A single @samp{\n} (newline) character.
-This format is a POSIX.2 extension and also appears in @w{ISO C99}.
+This format was first standardized by POSIX.2-1992 and by @w{ISO C99}.
@item %p
Either @samp{AM} or @samp{PM}, according to the given time value; or the
corresponding strings for the current locale, printed in lowercase
characters. Noon is treated as @samp{pm} and midnight as @samp{am}.
-This format was introduced in @w{ISO C99} but was previously available
-as a GNU extension.
+This format is a GNU extension.
@item %r
The complete calendar time using the AM/PM format of the current locale.
-This format is a POSIX.2 extension and also appears in @w{ISO C99}.
+This format was first standardized by POSIX.2-1992 and by @w{ISO C99}.
+In the POSIX locale, this format is equivalent to @code{%I:%M:%S %p}.
@item %R
The hour and minute in decimal numbers using the format @code{%H:%M}.
-This format was introduced in @w{ISO C99} but was previously available
-as a GNU extension.
+This format was first standardized by @w{ISO C99} and by POSIX.1-2001
+but was previously available as a GNU extension.
@item %s
The number of seconds since the epoch, i.e., since 1970-01-01 00:00:00 UTC.
@item %t
A single @samp{\t} (tabulator) character.
-This format is a POSIX.2 extension and also appears in @w{ISO C99}.
+This format was first standardized by POSIX.2-1992 and by @w{ISO C99}.
@item %T
The time of day using decimal numbers using the format @code{%H:%M:%S}.
-This format is a POSIX.2 extension.
+This format was first standardized by POSIX.2-1992 and by @w{ISO C99}.
@item %u
The day of the week as a decimal number (range @code{1} through
@code{7}), Monday being @code{1}.
-This format is a POSIX.2 extension and also appears in @w{ISO C99}.
+This format was first standardized by POSIX.2-1992 and by @w{ISO C99}.
@item %U
The week number of the current year as a decimal number (range @code{00}
@code{53}) of the previous year even if it contains days from the new
year.
-This format is a POSIX.2 extension and also appears in @w{ISO C99}.
+This format was first standardized by POSIX.2-1992 and by @w{ISO C99}.
@item %w
The day of the week as a decimal number (range @code{0} through
@code{-0600} or @code{+0100}), or nothing if no time zone is
determinable.
-This format was introduced in @w{ISO C99} but was previously available
-as a GNU extension.
+This format was first standardized by @w{ISO C99} and by POSIX.1-2001
+but was previously available as a GNU extension.
-A full @w{RFC 822} timestamp is generated by the format
+In the POSIX locale, a full @w{RFC 822} timestamp is generated by the format
@w{@samp{"%a, %d %b %Y %H:%M:%S %z"}} (or the equivalent
@w{@samp{"%a, %d %b %Y %T %z"}}).
endif
gmp-objs = $(patsubst %,$(common-objpfx)stdlib/%$o,\
add_n sub_n cmp addmul_1 mul_1 mul_n divmod_1 \
- lshift rshift udiv_qrnnd inlines)
+ lshift rshift mp_clz_tab udiv_qrnnd inlines)
$(objpfx)atest-exp: $(gmp-objs)
$(objpfx)atest-sincos: $(gmp-objs)
$(objpfx)atest-exp2: $(gmp-objs)
routines := $(strip $(routines) $(mpn-routines)) \
dbl2mpn ldbl2mpn \
mpn2flt mpn2dbl mpn2ldbl
-# mp_clz seems not to be used. At least on x86. If removing the file
-# does not cause problem clean this up and actually remove the file.
-aux := fpioconst# mp_clz_tab
+aux := fpioconst mp_clz_tab
distribute := $(distribute) $(mpn-headers) gen-mpn-copy fpioconst.h
generated += isomac isomac.out
--- /dev/null
+/* __clz_tab -- support for longlong.h
+ Copyright (C) 1991, 1993, 1994, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library. Its master source is NOT part of
+ the C library, however. The master source lives in the GNU MP Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if 0
+#include "gmp.h"
+#include "gmp-impl.h"
+#endif
+
+const
+unsigned char __clz_tab[] =
+{
+ 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+ 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
+ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+ 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+ 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+ 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+ 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+};
--- /dev/null
+/* __clz_tab not needed on hppa. */
--- /dev/null
+/* __clz_tab not needed on i386. */
--- /dev/null
+/* __clz_tab not needed on powerpc. */
-/* Copyright (C) 1991-1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
}
else
{
- /* POSIX.1 8.1.1 requires that whenever strftime() is called, the
- time zone names contained in the external variable `tzname' shall
- be set as if the tzset() function had been called. */
+ /* POSIX.1 requires that local time zone information is used as
+ though strftime called tzset. */
# if HAVE_TZSET
tzset ();
# endif
#endif
case L_('b'):
- case L_('h'): /* POSIX.2 extension. */
+ case L_('h'):
if (change_case)
{
to_uppcase = 1;
break;
#endif
- case L_('C'): /* POSIX.2 extension. */
+ case L_('C'):
if (modifier == L_('O'))
goto bad_format;
if (modifier == L_('E'))
/* Fall through. */
# endif
#endif
- case L_('D'): /* POSIX.2 extension. */
+ case L_('D'):
if (modifier != 0)
goto bad_format;
subfmt = L_("%m/%d/%y");
DO_NUMBER (2, tp->tm_mday);
- case L_('e'): /* POSIX.2 extension. */
+ case L_('e'):
if (modifier == L_('E'))
goto bad_format;
DO_NUMBER (2, tp->tm_mon + 1);
- case L_('n'): /* POSIX.2 extension. */
+ case L_('n'):
add (1, *p = L_('\n'));
break;
goto underlying_strftime;
#endif
- case L_('R'): /* ISO C99 extension. */
+ case L_('R'):
subfmt = L_("%H:%M");
goto subformat;
- case L_('r'): /* POSIX.2 extension. */
+ case L_('r'):
#ifdef _NL_CURRENT
if (*(subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME,
NLW(T_FMT_AMPM)))
/* Fall through. */
# endif
#endif
- case L_('T'): /* POSIX.2 extension. */
+ case L_('T'):
subfmt = L_("%H:%M:%S");
goto subformat;
- case L_('t'): /* POSIX.2 extension. */
+ case L_('t'):
add (1, *p = L_('\t'));
break;
- case L_('u'): /* POSIX.2 extension. */
+ case L_('u'):
DO_NUMBER (1, (tp->tm_wday - 1 + 7) % 7 + 1);
case L_('U'):
DO_NUMBER (2, (tp->tm_yday - tp->tm_wday + 7) / 7);
case L_('V'):
- case L_('g'): /* ISO C99 extension. */
- case L_('G'): /* ISO C99 extension. */
+ case L_('g'):
+ case L_('G'):
if (modifier == L_('E'))
goto bad_format;
{
zone = tzname[tp->tm_isdst];
#endif
if (! zone)
- zone = ""; /* POSIX.2 requires the empty string here. */
+ zone = "";
#ifdef COMPILE_WIDE
{
#endif
break;
- case L_('z'): /* ISO C99 extension. */
+ case L_('z'):
if (tp->tm_isdst < 0)
break;