summaryrefslogtreecommitdiff
path: root/modules/rawmemchr
Commit message (Collapse)AuthorAgeFilesLines
* rawmemchr: modernize and simplifyPaul Eggert2021-08-201-0/+3
| | | | | | | | | | | | | | | | * lib/rawmemchr.c (HAVE_RAWMEMCHR): Assume it’s not defined; otherwise this file would not be compiled. Include limits.h, stdalign.h, stdint.h, verify.h. (rawmemchr): Prefer uintptr_t to unsigned long and to size_t when it’s the better type. Verify that longword lacks padding. Use alignof rather than sizeof when checking alignment. Simplify by assuming C99 decl-after-statement, and by using multiplication rather than repeated shifting and OR (modern compilers can optimize the multiplication if needed). Avoid unnecessary casts. Don’t assume CHAR_WIDTH is 8. Convert back and forth between void * to suppress bogus GCC warnings about alignment. Omit a duplicate assignment to char_ptr. * modules/rawmemchr (Depends-on): Add stdalign, stdint, verify.
* rawmemchr: Move AC_LIBOBJ invocations to module description.Bruno Haible2011-06-161-0/+4
| | | | | | | * m4/rawmemchr.m4 (gl_FUNC_RAWMEMCHR): Call AC_CHECK_FUNCS instead of AC_REPLACE_FUNCS. Move AC_LIBOBJ and gl_PREREQ_RAWMEMCHR invocations from here... * modules/rawmemchr (configure.ac): ... to here.
* rawmemchr: relax licenseEric Blake2009-09-081-1/+1
| | | | | | | | * modules/rawmemchr (License): Derived from glibc, so LGPLv2+ is okay. Reported by Jim Meyering. Signed-off-by: Eric Blake <ebb9@byu.net>
* Silence valgrind on safe reads beyond potential array bounds.Eric Blake2008-04-291-0/+1
| | | | | | | | | | * lib/rawmemchr.valgrind: New file. * lib/strchrnul.valgrind: Likewise. * modules/rawmemchr (Files): Distribute new file. * modules/strchrnul (Files): Likewise. Suggested by Bruno Haible. Signed-off-by: Eric Blake <ebb9@byu.net>
* Set the module maintainer.Bruno Haible2008-04-291-1/+1
|
* Add rawmemchr module, matching glibc.Eric Blake2008-04-281-0/+25
* modules/string (Makefile.am): New indicator. * m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Set it. * lib/string.in.h (rawmemchr): Declare when appropriate. * modules/rawmemchr: New file. * m4/rawmemchr.m4: Likewise. * lib/rawmemchr.c: Likewise. * modules/rawmemchr-tests: Likewise. * tests/test-rawmemchr.c: Likewise. * doc/glibc-functions/rawmemchr.texi (rawmemchr): Document module. * modules/strchrnul (Depends-on): Add rawmemchr. * lib/strchrnul.c (strchrnul): Optimize a corner case. Signed-off-by: Eric Blake <ebb9@byu.net>