diff options
author | midipix <writeonce@midipix.org> | 2015-03-15 21:08:54 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2015-03-15 21:08:54 -0400 |
commit | 18bc92cb83fdf0f0472432fb7c30914a9cd4df01 (patch) | |
tree | 2d11f8c8d084e113cae1ef6175fc2e888e570f58 /libiberty/memchr.c | |
parent | cf7e0e7656729af8bd8f3bb86c4d51f1089a0c37 (diff) | |
download | cbb-gcc-4.6.4-18bc92cb83fdf0f0472432fb7c30914a9cd4df01.tar.bz2 cbb-gcc-4.6.4-18bc92cb83fdf0f0472432fb7c30914a9cd4df01.tar.xz |
libiberty: remove source files that either duplicate functionality
already present in all modern libc implementations, or are
incompatible with modern development environments, or both.
Diffstat (limited to 'libiberty/memchr.c')
-rw-r--r-- | libiberty/memchr.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/libiberty/memchr.c b/libiberty/memchr.c deleted file mode 100644 index 7448ab9e7..000000000 --- a/libiberty/memchr.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - -@deftypefn Supplemental void* memchr (const void *@var{s}, int @var{c}, @ - size_t @var{n}) - -This function searches memory starting at @code{*@var{s}} for the -character @var{c}. The search only ends with the first occurrence of -@var{c}, or after @var{length} characters; in particular, a null -character does not terminate the search. If the character @var{c} is -found within @var{length} characters of @code{*@var{s}}, a pointer -to the character is returned. If @var{c} is not found, then @code{NULL} is -returned. - -@end deftypefn - -*/ - -#include <ansidecl.h> -#include <stddef.h> - -PTR -memchr (register const PTR src_void, int c, size_t length) -{ - const unsigned char *src = (const unsigned char *)src_void; - - while (length-- > 0) - { - if (*src == c) - return (PTR)src; - src++; - } - return NULL; -} |