unistr/u8-strchr: Optimize non-ASCII argument case.
[gnulib.git] / ChangeLog
index ef354f3..8fb3e77 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,235 @@
+2010-07-18  Bruno Haible  <bruno@clisp.org>
+
+       unistr/u8-strchr: Optimize non-ASCII argument case.
+       * lib/unistr/u8-strchr.c (u8_strchr): Compare the last byte first,
+       because the first byte often matches anyway.
+       Reported by Pádraig Brady <P@draigbrady.com>.
+
+2010-07-15  Karl Berry  <karl@gnu.org>
+
+       * config/srclist.txt (fdl.texi): only one copy, from gnustandards.
+
+2010-07-14  Paul R. Eggert  <eggert@cs.ucla.edu>
+
+       getcwd: on Solaris, work better if ancestors are inaccessible
+       * lib/getcwd.c (__getcwd): If getcwd returns EINVAL for zero
+       buffer and size, try again with a large buffer.  This works better
+       on Solaris, since its getcwd succeeds even if the path to the root
+       is inaccessible, and this is helpful in common cases such as .zfs
+       hidden directories.  Problem reported by J Chapman Flack in
+       http://lists.gnu.org/archive/html/bug-tar/2010-06/msg00000.html
+       Use system getcwd if it's declared, not merely if it's partly
+       working; use the partly-working test only to avoid needless effort
+       if the system getcwd fails.
+       * m4/getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Omit
+       comment that was already obsolete and is now even more obsolete.
+       * modules/getcwd (Depends-on): Depend on strdup, since __getcwd
+       now might call strdup.
+
+2010-07-13  Paul R. Eggert  <eggert@cs.ucla.edu>
+
+       pthread: Add enough so that coreutils/src/sort.c compiles.
+       * lib/pthread.in.h: Add self to author comment.  Conditionalize on
+       _GL_PTHREAD_H, not PTHREAD_H_, for consistency with the rest of
+       gnulib. Include <sched.h> and <time.h>, as per POSIX.
+       Include <sys/types.h>, in case it defines pthread_t.
+       (pthread_t, pthread_attr_t, pthread_barrier_t, pthread_barrierattr_t):
+       (pthread_cond_t, pthread_condattr_t, pthread_key_t, pthread_mutex_t):
+       (pthread_mutexattr_t, pthread_once_t, pthread_rwlock_t):
+       (pthread_rwlockattr_t, pthread_spinlock_t):
+       New typedefs, if HAVE_PTHREAD_T is not defined.
+       (PTHREAD_COND_INITIALIZER, PTHREAD_MUTEX_INITIALIZER):
+       (PTHREAD_ONCE_INIT, PTHREAD_RWLOCK_INITIALIZER):
+       (PTHREAD_BARRIER_SERIAL_THREAD, PTHREAD_CANCEL_DEFERRED):
+       (PTHREAD_CANCEL_ASYNCHRONOUS, PTHREAD_CANCEL_ENABLE):
+       (PTHREAD_CANCEL_DISABLE, PTHREAD_CANCELED, PTHREAD_CREATE_JOINABLE):
+       (PTHREAD_CREATE_DETACHED, PTHREAD_INHERIT_SCHED):
+       (PTHREAD_EXPLICIT_SCHED, PTHREAD_MUTEX_DEFAULT, PTHREAD_MUTEX_NORMAL):
+       (PTHREAD_MUTEX_ERRORCHECK, PTHREAD_MUTEX_RECURSIVE):
+       (PTHREAD_MUTEX_STALLED, PTHREAD_MUTEX_ROBUST, PTHREAD_PRIO_NONE):
+       (PTHREAD_PRIO_INHERIT, PTHREAD_PRIO_PROTECT, PTHREAD_PROCESS_PRIVATE):
+       (PTHREAD_PROCESS_SHARED, PTHREAD_SCOPE_SYSTEM, PTHREAD_SCOPE_PROCESS):
+       New macros.
+       (pthread_cond_destroy, pthread_cond_init, pthread_cond_signal):
+       (pthread_cond_wait, pthread_exit, pthread_mutex_destroy):
+       (pthread_mutex_init, pthread_mutex_lock, pthread_mutex_unlock):
+       (pthread_spin_init, pthread_spin_lock, pthread_spin_trylock);
+       (pthread_spin_unlock): New dummy functions.
+       (pthread_create): Return EAGAIN; don't set errno.
+       * m4/pthread.m4 (gl_PTHREAD_CHECK): Check for pthread_t, and
+       require AC_C_INLINE.
+       * modules/pthread (Depends-on): Add sched, time.
+       (pthread.h): Use AM_V_GEN.
+
+2010-07-13  Bruno Haible  <bruno@clisp.org>
+
+       striconveh: Don't malloc memory if the result buffer is sufficient.
+       * lib/striconveh.c (mem_cd_iconveh_internal): Use the provided result
+       buffer if its size is sufficient.
+       Reported by Ludovic Courtès <ludo@gnu.org>.
+
+2010-07-13  Bruno Haible  <bruno@clisp.org>
+
+       strtod: Add safety check.
+       * lib/strtod.c (ldexp): Abort if this dummy replacement gets called.
+
+2010-07-12  Bruno Haible  <bruno@clisp.org>
+
+       Unify tests that set gl_cv_func_ldexpl_no_libm.
+       * m4/ldexpl.m4 (gl_CHECK_LDEXPL_NO_LIBM): New macro, extracted from
+       gl_FUNC_LDEXPL.
+       (gl_FUNC_LDEXPL): Invoke it.
+       * m4/printf-frexpl.m4 (gl_FUNC_PRINTF_FREXPL): Likewise.
+
+2010-07-12  Bruno Haible  <bruno@clisp.org>
+
+       Unify tests that set gl_cv_func_ldexp_no_libm.
+       * m4/ldexp.m4: New file, based on m4/mathfunc.m4.
+       * m4/strtod.m4 (gl_PREREQ_STRTOD): Require gl_CHECK_LDEXP_NO_LIBM.
+       * modules/ldexp (Files): Remove m4/mathfunc.m4. Add m4/ldexp.m4.
+       (configure.ac): Simply invoke gl_FUNC_LDEXP.
+       * modules/strtod (Files): Add m4/ldexp.m4.
+
+2010-07-12  Bruno Haible  <bruno@clisp.org>
+
+       Unify tests that set gl_cv_func_frexpl_no_libm.
+       * m4/frexpl.m4 (gl_CHECK_FREXPL_NO_LIBM): New macro, extracted from
+       gl_FUNC_FREXPL_NO_LIBM.
+       (gl_FUNC_FREXPL, gl_FUNC_FREXPL_NO_LIBM): Invoke it.
+       * m4/printf-frexpl.m4 (gl_FUNC_PRINTF_FREXPL): Likewise.
+
+2010-07-12  Bruno Haible  <bruno@clisp.org>
+
+       Unify tests that set gl_cv_func_frexp_no_libm.
+       * m4/frexp.m4 (gl_CHECK_FREXP_NO_LIBM): New macro, extracted from
+       gl_FUNC_FREXP_NO_LIBM.
+       (gl_FUNC_FREXP, gl_FUNC_FREXP_NO_LIBM): Require it.
+       * m4/printf-frexp.m4 (gl_FUNC_PRINTF_FREXP): Likewise.
+
+2010-07-12  Paul R. Eggert  <eggert@cs.ucla.edu>
+
+       memcoll: clarify sizes versus lengths, document better, and tweak perf
+       * lib/memcoll.c (strcoll_loop, memcoll0):
+       Improve quality of descriptive comments.  Name variables
+       consistently as to whether they are lengths (which do not include
+       terminating null) versus sizes (which do).
+       * lib/xmemcoll.c (xmemcoll0): Likewise.
+       * lib/memcoll.c (strcoll_loop): Tweak the way that the diff is
+       returned when s1size == 0; this is easier to compile and saves
+       about 17% of memcoll's code space on x86-64 with GCC 4.1.2.
+
+2010-07-12  Bruno Haible  <bruno@clisp.org>
+
+       Tests for module '_Exit'.
+       * modules/_Exit-tests: New file.
+       * tests/test-_Exit.sh: New file.
+       * tests/test-_Exit.c: New file.
+
+       New module '_Exit'.
+       * lib/stdlib.in.h (__attribute__): New macro.
+       (_Exit): New declaration.
+       * lib/_Exit.c: New file.
+       * m4/_Exit.m4: New file.
+       * m4/stdlib_h.m4 (gl_STDLIB_H): Check whether _Exit is declared.
+       (gl_STDLIB_H_DEFAULTS): Initialize GNULIB__EXIT and HAVE__EXIT.
+       * modules/stdlib (Makefile.am): Substitute GNULIB__EXIT and HAVE__EXIT.
+       * modules/_Exit: New file.
+       * tests/test-stdlib-c++.cc (_Exit): Check signature.
+       * doc/posix-functions/_Exit_C99.texi: Mention the new module.
+
+2010-07-12  Paul R. Eggert  <eggert@cs.ucla.edu>
+
+       strtod: make it more-accurate typically, and don't require libm
+       * lib/strtod.c (_GL_ARG_NONNULL): Remove; no longer needed.
+       Include limits.h.  Don't include string.h.
+       (HAVE_LDEXP_IN_LIBC, HAVE_RAW_DECL_STRTOD): Define to 0 if not defined.
+       (locale_isspace): New function, so that no casts are needed to
+       check whether *s is a space.
+       (ldexp): Provide an unused dummy if not available.
+       (scale_radix_exp, parse_number, underlying_strtod): New functions.
+       (strtod): Use them.  This implementation prefers to use the
+       underlying strtod if available, falling back on our own code
+       only to fix known bugs.  This is more likely to produce an
+       accurate result.  Also, it avoids the use of libm functions.
+       * m4/strtod.m4 (gl_FUNC_STRTOD): Don't invoke _AC_LIBOBJ_STRTOD;
+       no longer needed.  Invoke AC_LIBOBJ([strtod]); don't know why this
+       was absent, but it caused a test failure with coreutils.
+       (gl_PREREQ_STRTOD): Check wither ldexp can be used without linking
+       with libm.
+       * modules/strtod (Makefile.am, Link): libm is no longer needed.
+       * modules/strtod-tests (Makefile.am): Likewise.
+
+2010-07-11  Pádraig Brady  <P@draigBrady.com>
+            Bruno Haible  <bruno@clisp.org>
+
+       unistr/u8-strchr: Optimize ASCII argument case.
+       * lib/unistr/u8-strchr.c (u8_strchr): For ASCII arguments, use strchr.
+
+2010-07-08  Paul Eggert  <eggert@cs.ucla.edu>
+
+       (x)memcoll: minor tweaks
+       * lib/memcoll.c (strcoll_loop): Prefer the style where 'const'
+       is after the type that it qualifies.
+       (memcoll0): Likewise.
+       * lib/memcoll.h (memcoll0): Likewise.
+       * lib/xmemcoll.c (collate_error, xmemcoll0): Likewise.
+       * lib/xmemcoll.h (xmemcoll0): Likewise.
+       * lib/memcoll.c (memcoll0): Correct the comment.  This function
+       differs from memcoll in that the NUL byte is part of the argument.
+       Omit the abort-checks, as performance is a real issue here.  Plus,
+       the checks were wrong anyway (an off-by-one error).  Omit local
+       variable 'diff', as it's a bit clearer that way.
+       * m4/memcoll.m4 (gl_MEMCOLL): Omit AC_FUNC_STRCOLL, as it's
+       no longer needed.
+
+2010-07-08  Chen Guo <chenguo4@yahoo.com>
+
+       (x)memcoll: speedup when input is known to be NUL delimited
+       * lib/memcoll.c: Include stdlib.
+       (memcoll0) New function.
+       (strcoll_loop) New function, refactored for use in both memcoll
+       and memcoll0.
+       * lib/memcoll.h: Add prototype for memcoll0.
+       * lib/xmemcoll.c: (xmemcoll0) New function.
+       (collate_error) New function, refactored for use in both xmemcoll
+       and xmemcoll0.
+       * lib/xmemcoll.h: Add prototype for xmemcoll0.
+       * m4/memcoll.m4: add inline invocation.
+
+2010-07-06  Pádraig Brady  <P@draigBrady.com>
+
+       * build-aux/bootstrap: Remove any local translations
+       from the translation project synchronization directory,
+       so that local only translations are not distributed.
+
+2010-07-04  Bruno Haible  <bruno@clisp.org>
+
+       fsusage: Clarify which code applies to which platforms.
+       * m4/fsusage.m4 (gl_FSUSAGE): Clarify which test succeeds on which
+       platform.
+       * lib/fsusage.c (get_fs_usage): Likewise.
+
+2010-07-04  Bruno Haible  <bruno@clisp.org>
+
+       havelib: Fix bug when AC_LIB_FROMPACKAGE is used more than twice.
+       * m4/lib-link.m4 (AC_LIB_FROMPACKAGE): Use m4_defn.
+       Reported by Martin Lambers <marlam@marlam.de>.
+
+2010-07-04  Jim Meyering  <meyering@redhat.com>
+
+       hash: once again explicitly disallow insertion of NULL
+       * lib/hash.c (hash_insert0): Reinstate just-removed test:
+       inserting a NULL pointer cannot work with these functions.
+       Add a comment with details.
+       This reverts part of the 2010-07-01 commit, 5bef1a35
+       "hash: extend module to deal with non-pointer keys".
+
+2010-07-01  Bruno Haible  <bruno@clisp.org>
+
+       stdbool: Update doc.
+       * doc/posix-headers/stdbool.texi: Mention OpenBSD bug.
+       Info from Christian Weisgerber <naddy@mips.inka.de>.
+
 2010-07-01  Jim Meyering  <meyering@redhat.com>
 
        hash: extend module to deal with non-pointer keys