Re: memmem issues

2007-12-31 Thread Bruno Haible
Ben Pfaff wrote: > >> > +unsigned char b = (unsigned char) needle[i - 1]; > >> > ... > >> > +if (b == (unsigned char) needle[j]) > >> > >> Would it be cleaner to declare 'b' to be of type 'char' and avoid the > >> casts? > > > > No; ISO C 99 section 7.21.4 says that when byte st

Re: memmem issues

2007-12-31 Thread Bruno Haible
Paul Eggert wrote: > The 'char' type can have padding bits, which means that code like this: > > char const *needle = (char const *) needle_start; > char const *haystack = (char const *) haystack_start; > if ((unsigned char) *needle == (unsigned char) *haystack) ... > > might ignor

Re: memmem issues

2007-12-31 Thread Bruno Haible
Paul Eggert wrote: > OK, I installed this patch. > > 2007-12-29 Paul Eggert <[EMAIL PROTECTED]> > > * lib/memmem.c (knuth_morris_pratt): Check for size_t overflow > when multiplying M by sizeof (size_t). Thanks. Let me generalize it, as follows. 2007-12-30 Bruno Haible <[EMAIL

new macro xnmalloca

2007-12-31 Thread Bruno Haible
Since there was need for a macro 'nmalloca', there will also be need for 'xnmalloca'. This also fixes a bug: On platforms without working alloca(), xmalloc() could be used without being declared. 2007-12-30 Bruno Haible <[EMAIL PROTECTED]> * lib/xmalloca.h: Include xalloc.h. (

xmalloca: small optimization

2007-12-31 Thread Bruno Haible
This is a small optimization: On platform without alloca(), the xmmalloca() does not need to be defined, since nothing uses it. 2007-12-30 Bruno Haible <[EMAIL PROTECTED]> * lib/xmalloca.c (xmmalloca): Don't define if HAVE_ALLOCA is not defined. *** lib/xmalloca.c.orig 2007-12-

Re: memmem issues

2007-12-31 Thread Bruno Haible
Paul Eggert wrote: > Bruno Haible <[EMAIL PROTECTED]> writes: > > > Most of your comments apply to all copies of the KMP code in gnulib. > > Ouch! Should these be coalesced? Out of the 8 copies of the code currently in gnulib, I can easily coalesce 5 into 1; see attached patch. The remaining 4

commit to gnulib.texi

2007-12-31 Thread Bruno Haible
Hi Karl, You did this commit: http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=bf156d57d0488caa843739e039238d56fde4507d Could you please add a ChangeLog entry and notify the mailing list about the change, preferably with attached diffs? That's the common process here for peer re

[PATCH] Avoid use of private FTS type name.

2007-12-31 Thread Jim Meyering
FYI, I've just pushed this change: Avoid use of private FTS type name. * lib/fts.c (fts_sort): Use FTSENT rather than "struct _ftsent". diff --git a/lib/fts.c b/lib/fts.c index ceb8935..82ea8f6 100644 --- a/lib/fts.c +++ b/lib/fts.c @@ -1475,7 +1475,7 @@ fts_sort (FTS *sp, FTSENT

Re: memmem issues

2007-12-31 Thread Paul Eggert
Bruno Haible <[EMAIL PROTECTED]> writes: > It says that the _values_ of the characters are interpreted as > unsigned char. I.e. like this: Sure, but a character, as used in the sense here, is a bit representation that fits in a byte (see section 3.7.1); it is not a 'char' value. The intent is th

Re: commit to gnulib.texi

2007-12-31 Thread Karl Berry
You did this commit: http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=bf156d57d0488caa843739e039238d56fde4507d Could you please add a ChangeLog entry and notify the mailing list about the change, preferably with attached diffs? Yes, I apologize for forgetting to

Re: commit to gnulib.texi

2007-12-31 Thread Karl Berry
>Could you please add a ChangeLog entry 2007-12-30 Karl Berry <[EMAIL PROTECTED]> * doc/gnulib.texi (Library vs. Reusable Code): remove period, to work around defect in Texinfo and/or the standalone Info browser. >preferably with attached diffs? In this case, you alre