summaryrefslogtreecommitdiffstats
path: root/sys/libkern
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2012-01-03 07:05:30 +0000
committered <ed@FreeBSD.org>2012-01-03 07:05:30 +0000
commitd73fab66763e8ae3eb190e76d7ae95aa680d3448 (patch)
treeb2236c91382885ce633154f831c85fc950e01c75 /sys/libkern
parent9976fae0420f3eec4397fb825c227ad21c064262 (diff)
downloadFreeBSD-src-d73fab66763e8ae3eb190e76d7ae95aa680d3448.zip
FreeBSD-src-d73fab66763e8ae3eb190e76d7ae95aa680d3448.tar.gz
Implement extensions on top of standards instead of the other way around.
Now that index() and rindex() have become unused, simply turn them into wrappers around strchr() and strrchr(), respectively.
Diffstat (limited to 'sys/libkern')
-rw-r--r--sys/libkern/strchr.c (renamed from sys/libkern/index.c)8
-rw-r--r--sys/libkern/strrchr.c (renamed from sys/libkern/rindex.c)8
2 files changed, 2 insertions, 14 deletions
diff --git a/sys/libkern/index.c b/sys/libkern/strchr.c
index a12d706..6ee4798 100644
--- a/sys/libkern/index.c
+++ b/sys/libkern/strchr.c
@@ -33,14 +33,8 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/libkern.h>
-/*
- * index() is also present as the strchr() in the kernel; it does exactly the
- * same thing as it's userland equivalent.
- */
char *
-index(p, ch)
- const char *p;
- int ch;
+strchr(const char *p, int ch)
{
union {
const char *cp;
diff --git a/sys/libkern/rindex.c b/sys/libkern/strrchr.c
index 19bed70..6ff7eb4 100644
--- a/sys/libkern/rindex.c
+++ b/sys/libkern/strrchr.c
@@ -33,14 +33,8 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/libkern.h>
-/*
- * rindex() is also present as the strrchr() in the kernel; it does exactly the
- * same thing as it's userland equivalent.
- */
char *
-rindex(p, ch)
- const char *p;
- int ch;
+strrchr(const char *p, int ch)
{
union {
const char *cp;
OpenPOWER on IntegriCloud