A small optimization patch
H . J . Lu
hjl@valinux.com
Sat Dec 2 09:47:00 GMT 2000
On Sat, Dec 02, 2000 at 12:03:03AM -0800, Ulrich Drepper wrote:
> "H . J . Lu" <hjl@valinux.com> writes:
>
> > 2000-12-01 H.J. Lu <hjl@gnu.org>
> >
> > * locale/lc-time.c (_nl_init_era_entries): Optimize out
> > wcschr.
> > (_nl_get_walt_digit): Likewise.
> >
> > * stdio-common/printf_fp.c (group_number): Optimize out
> > __wmemmove.
>
> These are no optimizations. Leave these function calls. There can be
> optimized implementations and the compiler can and hopefully will get
> inlines.
>
Ok. How about this one?
H.J.
--
2000-12-02 H.J. Lu <hjl@gnu.org>
* locale/lc-time.c (_nl_init_era_entries): Pass L'\0' instead of
'\0' to wcschr.
Index: locale/lc-time.c
===================================================================
RCS file: /work/cvs/gnu/glibc/locale/lc-time.c,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 lc-time.c
--- locale/lc-time.c 2000/08/21 05:10:30 1.1.1.3
+++ locale/lc-time.c 2000/12/02 17:44:46
@@ -121,11 +121,11 @@ _nl_init_era_entries (void)
/* Set and skip wide era name. */
eras[cnt].era_wname = (wchar_t *) ptr;
- ptr = (char *) (wcschr ((wchar_t *) ptr, '\0') + 1);
+ ptr = (char *) (wcschr ((wchar_t *) ptr, L'\0') + 1);
/* Set and skip wide era format. */
eras[cnt].era_wformat = (wchar_t *) ptr;
- ptr = (char *) (wcschr ((wchar_t *) ptr, '\0') + 1);
+ ptr = (char *) (wcschr ((wchar_t *) ptr, L'\0') + 1);
}
}
}
More information about the Libc-alpha
mailing list