From 64c8c730d752e90591b44384ef4663fa06db4213 Mon Sep 17 00:00:00 2001 From: ocean Date: Thu, 20 Oct 2005 02:22:50 +0000 Subject: * eval.c, file.c, ruby.c: removed strchr, strrchr, strstr definition because they are defined in missing.h. * missing.h, missing/strchr.c, missing/strstr.c: ANSI styled. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- missing/strchr.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'missing/strchr.c') diff --git a/missing/strchr.c b/missing/strchr.c index 886d70ede6..bebd7ba578 100644 --- a/missing/strchr.c +++ b/missing/strchr.c @@ -1,32 +1,28 @@ /* public domain rewrite of strchr(3) and strrchr(3) */ char * -strchr(s, c) - char *s; - int c; +strchr(const char *s, int c) { - if (c == 0) return s + strlen(s); + if (c == 0) return (char *)s + strlen(s); while (*s) { if (*s == c) - return s; + return (char *)s; s++; } return 0; } char * -strrchr(s, c) - char *s; - int c; +strrchr(const char *s, int c) { - char *save; + const char *save; - if (c == 0) return s + strlen(s); + if (c == 0) return (char *)s + strlen(s); save = 0; while (*s) { if (*s == c) save = s; s++; } - return save; + return (char *)save; } -- cgit v1.2.3