This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU M4 source repository".
http://git.sv.gnu.org/gitweb/?p=m4.git;a=commitdiff;h=d7f708504fc66d0bcd35b60c1a5143c39197c8eb The branch, branch-1.6 has been updated via d7f708504fc66d0bcd35b60c1a5143c39197c8eb (commit) from 4fd6e693ee229b5feec21a72434e6cb00621b0a5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d7f708504fc66d0bcd35b60c1a5143c39197c8eb Author: Eric Blake <[email protected]> Date: Thu Mar 19 13:51:31 2009 -0600 Use memcmp2 to simplify lexicographic comparisons. * m4/gnulib-cache.m4: Import memcmp2. * src/builtin.c (dumpdef_cmp): Use it. Signed-off-by: Eric Blake <[email protected]> ----------------------------------------------------------------------- Summary of changes: ChangeLog | 6 ++++++ m4/gnulib-cache.m4 | 3 ++- src/builtin.c | 10 +++------- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 60f51ad..21ebe14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-03-19 Eric Blake <[email protected]> + + Use memcmp2 to simplify lexicographic comparisons. + * m4/gnulib-cache.m4: Import memcmp2. + * src/builtin.c (dumpdef_cmp): Use it. + 2009-03-13 Eric Blake <[email protected]> Fix testsuite failure on mingw. diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4 index 3043f85..d749cdb 100644 --- a/m4/gnulib-cache.m4 +++ b/m4/gnulib-cache.m4 @@ -15,7 +15,7 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --local-dir=local --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --no-libtool --macro-prefix=M4 announce-gen assert autobuild avltree-oset binary-io clean-temp cloexec close-stream closein config-h dirname error execute fdl-1.3 fflush filenamecat flexmember fopen fopen-safer freadptr freadseek fseeko gendocs getopt git-version-gen gnumakefile gnupload gpl-3.0 hash intprops memchr2 memmem mkstemp obstack obstack-printf-posix pipe progname quote regex stdbool stdint stdlib-safer strtod strtol unlocked-io vasnprintf-posix verror version-etc version-etc-fsf wait-process xalloc xmemdup0 xprintf xvasprintf-posix +# gnulib-tool --import --dir=. --local-dir=local --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --no-libtool --macro-prefix=M4 announce-gen assert autobuild avltree-oset binary-io clean-temp cloexec close-stream closein config-h dirname error execute fdl-1.3 fflush filenamecat flexmember fopen fopen-safer freadptr freadseek fseeko gendocs getopt git-version-gen gnumakefile gnupload gpl-3.0 hash intprops memchr2 memcmp2 memmem mkstemp obstack obstack-printf-posix pipe progname quote regex stdbool stdint stdlib-safer strtod strtol unlocked-io vasnprintf-posix verror version-etc version-etc-fsf wait-process xalloc xmemdup0 xprintf xvasprintf-posix # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([local]) @@ -51,6 +51,7 @@ gl_MODULES([ hash intprops memchr2 + memcmp2 memmem mkstemp obstack diff --git a/src/builtin.c b/src/builtin.c index 0062ca0..a28535b 100644 --- a/src/builtin.c +++ b/src/builtin.c @@ -26,6 +26,7 @@ #include "execute.h" #include "memchr2.h" +#include "memcmp2.h" #include "pipe.h" #include "regex.h" #include "wait-process.h" @@ -864,13 +865,8 @@ dumpdef_cmp (const void *s1, const void *s2) { const symbol *sym1 = *(const symbol **) s1; const symbol *sym2 = *(const symbol **) s2; - size_t len1 = SYMBOL_NAME_LEN (sym1); - size_t len2 = SYMBOL_NAME_LEN (sym2); - int result = memcmp (SYMBOL_NAME (sym1), SYMBOL_NAME (sym2), - len1 < len2 ? len1 : len2); - if (!result) - result = len1 < len2 ? -1 : len2 < len1; - return result; + return memcmp2 (SYMBOL_NAME (sym1), SYMBOL_NAME_LEN (sym1), + SYMBOL_NAME (sym2), SYMBOL_NAME_LEN (sym2)); } /*-------------------------------------------------------------------------. hooks/post-receive -- GNU M4 source repository
