aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Gerzo <danger@FreeBSD.org>2009-02-03 17:58:20 +0000
committerDaniel Gerzo <danger@FreeBSD.org>2009-02-03 17:58:20 +0000
commitbd604b4b064135e661660c045cd31145e2e4ce71 (patch)
treec5d6de4ed720c8bb5b4d132f30cd8fbd28bbeb81 /lib
parent23ee18767ede4614aedbe8645e896f0194f3500c (diff)
Notes
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/string/memccpy.c6
-rw-r--r--lib/libc/string/memchr.c5
-rw-r--r--lib/libc/string/memcmp.c4
-rw-r--r--lib/libc/string/memmem.c4
-rw-r--r--lib/libc/string/strcasecmp.c7
-rw-r--r--lib/libc/string/strcasestr.c3
-rw-r--r--lib/libc/string/strcmp.c5
-rw-r--r--lib/libc/string/strcoll.c3
-rw-r--r--lib/libc/string/strdup.c3
-rw-r--r--lib/libc/string/strmode.c4
-rw-r--r--lib/libc/string/strncmp.c6
-rw-r--r--lib/libc/string/strncpy.c4
-rw-r--r--lib/libc/string/strnstr.c5
-rw-r--r--lib/libc/string/strpbrk.c5
-rw-r--r--lib/libc/string/strsep.c4
-rw-r--r--lib/libc/string/strstr.c7
-rw-r--r--lib/libc/string/wcscat.c4
-rw-r--r--lib/libc/string/wcscmp.c5
-rw-r--r--lib/libc/string/wcscpy.c4
-rw-r--r--lib/libc/string/wcscspn.c4
-rw-r--r--lib/libc/string/wcslcat.c5
-rw-r--r--lib/libc/string/wcslcpy.c5
-rw-r--r--lib/libc/string/wcslen.c3
-rw-r--r--lib/libc/string/wcsncat.c5
-rw-r--r--lib/libc/string/wcsncmp.c4
-rw-r--r--lib/libc/string/wcspbrk.c4
-rw-r--r--lib/libc/string/wcsspn.c4
-rw-r--r--lib/libc/string/wcsstr.c2
-rw-r--r--lib/libc/string/wmemchr.c5
-rw-r--r--lib/libc/string/wmemcmp.c5
-rw-r--r--lib/libc/string/wmemcpy.c6
-rw-r--r--lib/libc/string/wmemmove.c6
-rw-r--r--lib/libc/string/wmemset.c5
33 files changed, 41 insertions, 110 deletions
diff --git a/lib/libc/string/memccpy.c b/lib/libc/string/memccpy.c
index 5b4223eba27f..539d33e4701f 100644
--- a/lib/libc/string/memccpy.c
+++ b/lib/libc/string/memccpy.c
@@ -36,11 +36,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
void *
-memccpy(t, f, c, n)
- void *t;
- const void *f;
- int c;
- size_t n;
+memccpy(void *t, const void *f, int c, size_t n)
{
if (n) {
diff --git a/lib/libc/string/memchr.c b/lib/libc/string/memchr.c
index 2b1231dadf09..47d37db16be9 100644
--- a/lib/libc/string/memchr.c
+++ b/lib/libc/string/memchr.c
@@ -39,10 +39,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
void *
-memchr(s, c, n)
- const void *s;
- unsigned char c;
- size_t n;
+memchr(const void *s, unsigned char c, size_t n)
{
if (n != 0) {
const unsigned char *p = s;
diff --git a/lib/libc/string/memcmp.c b/lib/libc/string/memcmp.c
index d048068c4732..4a1b66e6548b 100644
--- a/lib/libc/string/memcmp.c
+++ b/lib/libc/string/memcmp.c
@@ -42,9 +42,7 @@ __FBSDID("$FreeBSD$");
* Compare memory regions.
*/
int
-memcmp(s1, s2, n)
- const void *s1, *s2;
- size_t n;
+memcmp(const void *s1, const void *s2, size_t n)
{
if (n != 0) {
const unsigned char *p1 = s1, *p2 = s2;
diff --git a/lib/libc/string/memmem.c b/lib/libc/string/memmem.c
index 0ac0a6dfc80e..72e6517e7b4d 100644
--- a/lib/libc/string/memmem.c
+++ b/lib/libc/string/memmem.c
@@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$");
*/
void *
-memmem(l, l_len, s, s_len)
- const void *l; size_t l_len;
- const void *s; size_t s_len;
+memmem(const void *l, size_t l_len, const void *s, size_t s_len)
{
register char *cur, *last;
const char *cl = (const char *)l;
diff --git a/lib/libc/string/strcasecmp.c b/lib/libc/string/strcasecmp.c
index 2efcf55c68a4..4a474fee24a7 100644
--- a/lib/libc/string/strcasecmp.c
+++ b/lib/libc/string/strcasecmp.c
@@ -39,8 +39,7 @@ __FBSDID("$FreeBSD$");
typedef unsigned char u_char;
int
-strcasecmp(s1, s2)
- const char *s1, *s2;
+strcasecmp(const char *s1, const char *s2)
{
const u_char
*us1 = (const u_char *)s1,
@@ -53,9 +52,7 @@ strcasecmp(s1, s2)
}
int
-strncasecmp(s1, s2, n)
- const char *s1, *s2;
- size_t n;
+strncasecmp(const char *s1, const char *s2, size_t n)
{
if (n != 0) {
const u_char
diff --git a/lib/libc/string/strcasestr.c b/lib/libc/string/strcasestr.c
index b358b7d99a9f..9b28bf569a4d 100644
--- a/lib/libc/string/strcasestr.c
+++ b/lib/libc/string/strcasestr.c
@@ -40,8 +40,7 @@ __FBSDID("$FreeBSD$");
* Find the first occurrence of find in s, ignore case.
*/
char *
-strcasestr(s, find)
- const char *s, *find;
+strcasestr(const char *s, const char *find)
{
char c, sc;
size_t len;
diff --git a/lib/libc/string/strcmp.c b/lib/libc/string/strcmp.c
index ab953338e43a..95c778dc2296 100644
--- a/lib/libc/string/strcmp.c
+++ b/lib/libc/string/strcmp.c
@@ -42,11 +42,10 @@ __FBSDID("$FreeBSD$");
* Compare strings.
*/
int
-strcmp(s1, s2)
- const char *s1, *s2;
+strcmp(const char *s1, const char *s2)
{
while (*s1 == *s2++)
- if (*s1++ == 0)
+ if (*s1++ == '\0')
return (0);
return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1));
}
diff --git a/lib/libc/string/strcoll.c b/lib/libc/string/strcoll.c
index a0daf8dc182f..0da5c5730fc8 100644
--- a/lib/libc/string/strcoll.c
+++ b/lib/libc/string/strcoll.c
@@ -33,8 +33,7 @@ __FBSDID("$FreeBSD$");
#include "collate.h"
int
-strcoll(s, s2)
- const char *s, *s2;
+strcoll(const char *s, const char *s2)
{
int len, len2, prim, prim2, sec, sec2, ret, ret2;
const char *t, *t2;
diff --git a/lib/libc/string/strdup.c b/lib/libc/string/strdup.c
index c0b581d40179..570ad838527d 100644
--- a/lib/libc/string/strdup.c
+++ b/lib/libc/string/strdup.c
@@ -38,8 +38,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
char *
-strdup(str)
- const char *str;
+strdup(const char *str)
{
size_t len;
char *copy;
diff --git a/lib/libc/string/strmode.c b/lib/libc/string/strmode.c
index be09d7acc0dd..855e1b5acde2 100644
--- a/lib/libc/string/strmode.c
+++ b/lib/libc/string/strmode.c
@@ -38,9 +38,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
void
-strmode(mode, p)
- mode_t mode;
- char *p;
+strmode(mode_t mode, char *p)
{
/* print type */
switch (mode & S_IFMT) {
diff --git a/lib/libc/string/strncmp.c b/lib/libc/string/strncmp.c
index 659a7cbaff4f..5bc3d5e61a85 100644
--- a/lib/libc/string/strncmp.c
+++ b/lib/libc/string/strncmp.c
@@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
int
-strncmp(s1, s2, n)
- const char *s1, *s2;
- size_t n;
+strncmp(const char *s1, const char *s2, size_t n)
{
if (n == 0)
@@ -47,7 +45,7 @@ strncmp(s1, s2, n)
if (*s1 != *s2++)
return (*(const unsigned char *)s1 -
*(const unsigned char *)(s2 - 1));
- if (*s1++ == 0)
+ if (*s1++ == '\0')
break;
} while (--n != 0);
return (0);
diff --git a/lib/libc/string/strncpy.c b/lib/libc/string/strncpy.c
index 07b9166d2b26..980dbc7d58e8 100644
--- a/lib/libc/string/strncpy.c
+++ b/lib/libc/string/strncpy.c
@@ -50,10 +50,10 @@ strncpy(char * __restrict dst, const char * __restrict src, size_t n)
const char *s = src;
do {
- if ((*d++ = *s++) == 0) {
+ if ((*d++ = *s++) == '\0') {
/* NUL pad the remaining n-1 bytes */
while (--n != 0)
- *d++ = 0;
+ *d++ = '\0';
break;
}
} while (--n != 0);
diff --git a/lib/libc/string/strnstr.c b/lib/libc/string/strnstr.c
index bbb1ca64e456..45be95d12a1d 100644
--- a/lib/libc/string/strnstr.c
+++ b/lib/libc/string/strnstr.c
@@ -44,10 +44,7 @@ __FBSDID("$FreeBSD$");
* first slen characters of s.
*/
char *
-strnstr(s, find, slen)
- const char *s;
- const char *find;
- size_t slen;
+strnstr(const char *s, const char *find, size_t slen)
{
char c, sc;
size_t len;
diff --git a/lib/libc/string/strpbrk.c b/lib/libc/string/strpbrk.c
index efbdc8a72383..2069bee7233a 100644
--- a/lib/libc/string/strpbrk.c
+++ b/lib/libc/string/strpbrk.c
@@ -39,14 +39,13 @@ __FBSDID("$FreeBSD$");
* Find the first occurrence in s1 of a character in s2 (excluding NUL).
*/
char *
-strpbrk(s1, s2)
- const char *s1, *s2;
+strpbrk(const char *s1, const char *s2)
{
const char *scanp;
int c, sc;
while ((c = *s1++) != 0) {
- for (scanp = s2; (sc = *scanp++) != 0;)
+ for (scanp = s2; (sc = *scanp++) != '\0';)
if (sc == c)
return ((char *)(s1 - 1));
}
diff --git a/lib/libc/string/strsep.c b/lib/libc/string/strsep.c
index 0850b0b96e3c..670ab04ae9f8 100644
--- a/lib/libc/string/strsep.c
+++ b/lib/libc/string/strsep.c
@@ -48,9 +48,7 @@ __FBSDID("$FreeBSD$");
* If *stringp is NULL, strsep returns NULL.
*/
char *
-strsep(stringp, delim)
- char **stringp;
- const char *delim;
+strsep(char **stringp, const char *delim)
{
char *s;
const char *spanp;
diff --git a/lib/libc/string/strstr.c b/lib/libc/string/strstr.c
index e2edd809c29f..82b4c5a2085e 100644
--- a/lib/libc/string/strstr.c
+++ b/lib/libc/string/strstr.c
@@ -42,17 +42,16 @@ __FBSDID("$FreeBSD$");
* Find the first occurrence of find in s.
*/
char *
-strstr(s, find)
- const char *s, *find;
+strstr(const char *s, const char *find)
{
char c, sc;
size_t len;
- if ((c = *find++) != 0) {
+ if ((c = *find++) != '\0') {
len = strlen(find);
do {
do {
- if ((sc = *s++) == 0)
+ if ((sc = *s++) == '\0')
return (NULL);
} while (sc != c);
} while (strncmp(s, find, len) != 0);
diff --git a/lib/libc/string/wcscat.c b/lib/libc/string/wcscat.c
index 1c965335e4d2..7ae4e801157a 100644
--- a/lib/libc/string/wcscat.c
+++ b/lib/libc/string/wcscat.c
@@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$");
#include <wchar.h>
wchar_t *
-wcscat(s1, s2)
- wchar_t * __restrict s1;
- const wchar_t * __restrict s2;
+wcscat(wchar_t * __restrict s1, const wchar_t * __restrict s2)
{
wchar_t *cp;
diff --git a/lib/libc/string/wcscmp.c b/lib/libc/string/wcscmp.c
index 59c3eefb2e47..2d489149d066 100644
--- a/lib/libc/string/wcscmp.c
+++ b/lib/libc/string/wcscmp.c
@@ -45,12 +45,11 @@ __FBSDID("$FreeBSD$");
* Compare strings.
*/
int
-wcscmp(s1, s2)
- const wchar_t *s1, *s2;
+wcscmp(const wchar_t *s1, const wchar_t *s2)
{
while (*s1 == *s2++)
- if (*s1++ == 0)
+ if (*s1++ == '\0')
return (0);
/* XXX assumes wchar_t = int */
return (*(const unsigned int *)s1 - *(const unsigned int *)--s2);
diff --git a/lib/libc/string/wcscpy.c b/lib/libc/string/wcscpy.c
index 180bbd1b192d..0c6e1f28f711 100644
--- a/lib/libc/string/wcscpy.c
+++ b/lib/libc/string/wcscpy.c
@@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$");
#include <wchar.h>
wchar_t *
-wcscpy(s1, s2)
- wchar_t * __restrict s1;
- const wchar_t * __restrict s2;
+wcscpy(wchar_t * __restrict s1, const wchar_t * __restrict s2)
{
wchar_t *cp;
diff --git a/lib/libc/string/wcscspn.c b/lib/libc/string/wcscspn.c
index 57a804c0c639..7729dc8ab381 100644
--- a/lib/libc/string/wcscspn.c
+++ b/lib/libc/string/wcscspn.c
@@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$");
#include <wchar.h>
size_t
-wcscspn(s, set)
- const wchar_t *s;
- const wchar_t *set;
+wcscspn(const wchar_t *s, const wchar_t *set)
{
const wchar_t *p;
const wchar_t *q;
diff --git a/lib/libc/string/wcslcat.c b/lib/libc/string/wcslcat.c
index 6466f0690fd7..f5f1e1ee7559 100644
--- a/lib/libc/string/wcslcat.c
+++ b/lib/libc/string/wcslcat.c
@@ -46,10 +46,7 @@ __FBSDID("$FreeBSD$");
* truncation occurred.
*/
size_t
-wcslcat(dst, src, siz)
- wchar_t *dst;
- const wchar_t *src;
- size_t siz;
+wcslcat(wchar_t *dst, const wchar_t *src, size_t siz)
{
wchar_t *d = dst;
const wchar_t *s = src;
diff --git a/lib/libc/string/wcslcpy.c b/lib/libc/string/wcslcpy.c
index 1b9459a0c19e..b104a0622a6e 100644
--- a/lib/libc/string/wcslcpy.c
+++ b/lib/libc/string/wcslcpy.c
@@ -44,10 +44,7 @@ __FBSDID("$FreeBSD$");
* Returns wcslen(src); if retval >= siz, truncation occurred.
*/
size_t
-wcslcpy(dst, src, siz)
- wchar_t *dst;
- const wchar_t *src;
- size_t siz;
+wcslcpy(wchar_t *dst, const wchar_t *src, size_t siz)
{
wchar_t *d = dst;
const wchar_t *s = src;
diff --git a/lib/libc/string/wcslen.c b/lib/libc/string/wcslen.c
index 1636d98cd276..ca3004e03cb9 100644
--- a/lib/libc/string/wcslen.c
+++ b/lib/libc/string/wcslen.c
@@ -37,8 +37,7 @@ __FBSDID("$FreeBSD$");
#include <wchar.h>
size_t
-wcslen(s)
- const wchar_t *s;
+wcslen(const wchar_t *s)
{
const wchar_t *p;
diff --git a/lib/libc/string/wcsncat.c b/lib/libc/string/wcsncat.c
index ba49a9eab98a..44f1ff98980c 100644
--- a/lib/libc/string/wcsncat.c
+++ b/lib/libc/string/wcsncat.c
@@ -37,10 +37,7 @@ __FBSDID("$FreeBSD$");
#include <wchar.h>
wchar_t *
-wcsncat(s1, s2, n)
- wchar_t * __restrict s1;
- const wchar_t * __restrict s2;
- size_t n;
+wcsncat(wchar_t * __restrict s1, const wchar_t * __restrict s2, size_t n)
{
wchar_t *p;
wchar_t *q;
diff --git a/lib/libc/string/wcsncmp.c b/lib/libc/string/wcsncmp.c
index 5b7b3ee188a1..86d7a51cec43 100644
--- a/lib/libc/string/wcsncmp.c
+++ b/lib/libc/string/wcsncmp.c
@@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$");
#include <wchar.h>
int
-wcsncmp(s1, s2, n)
- const wchar_t *s1, *s2;
- size_t n;
+wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n)
{
if (n == 0)
diff --git a/lib/libc/string/wcspbrk.c b/lib/libc/string/wcspbrk.c
index 7315c4445dda..2ff71ba92f61 100644
--- a/lib/libc/string/wcspbrk.c
+++ b/lib/libc/string/wcspbrk.c
@@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$");
#include <wchar.h>
wchar_t *
-wcspbrk(s, set)
- const wchar_t *s;
- const wchar_t *set;
+wcspbrk(const wchar_t *s, const wchar_t *set)
{
const wchar_t *p;
const wchar_t *q;
diff --git a/lib/libc/string/wcsspn.c b/lib/libc/string/wcsspn.c
index 584a9d352850..6569206208b0 100644
--- a/lib/libc/string/wcsspn.c
+++ b/lib/libc/string/wcsspn.c
@@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$");
#include <wchar.h>
size_t
-wcsspn(s, set)
- const wchar_t *s;
- const wchar_t *set;
+wcsspn(const wchar_t *s, const wchar_t *set)
{
const wchar_t *p;
const wchar_t *q;
diff --git a/lib/libc/string/wcsstr.c b/lib/libc/string/wcsstr.c
index b8a7598c8efb..a9dc27bbf498 100644
--- a/lib/libc/string/wcsstr.c
+++ b/lib/libc/string/wcsstr.c
@@ -49,7 +49,7 @@ wcsstr(const wchar_t * __restrict s, const wchar_t * __restrict find)
wchar_t c, sc;
size_t len;
- if ((c = *find++) != 0) {
+ if ((c = *find++) != L'\0') {
len = wcslen(find);
do {
do {
diff --git a/lib/libc/string/wmemchr.c b/lib/libc/string/wmemchr.c
index 2d96708fd6c4..cab89c9ade4f 100644
--- a/lib/libc/string/wmemchr.c
+++ b/lib/libc/string/wmemchr.c
@@ -37,10 +37,7 @@ __FBSDID("$FreeBSD$");
#include <wchar.h>
wchar_t *
-wmemchr(s, c, n)
- const wchar_t *s;
- wchar_t c;
- size_t n;
+wmemchr(const wchar_t *s, wchar_t c, size_t n)
{
size_t i;
diff --git a/lib/libc/string/wmemcmp.c b/lib/libc/string/wmemcmp.c
index c9a9095b8eb2..fdb1f986f3a4 100644
--- a/lib/libc/string/wmemcmp.c
+++ b/lib/libc/string/wmemcmp.c
@@ -37,10 +37,7 @@ __FBSDID("$FreeBSD$");
#include <wchar.h>
int
-wmemcmp(s1, s2, n)
- const wchar_t *s1;
- const wchar_t *s2;
- size_t n;
+wmemcmp(const wchar_t *s1, const wchar_t *s2, size_t n)
{
size_t i;
diff --git a/lib/libc/string/wmemcpy.c b/lib/libc/string/wmemcpy.c
index 38d563d8053c..c10770ce4ec5 100644
--- a/lib/libc/string/wmemcpy.c
+++ b/lib/libc/string/wmemcpy.c
@@ -38,11 +38,7 @@ __FBSDID("$FreeBSD$");
#include <wchar.h>
wchar_t *
-wmemcpy(d, s, n)
- wchar_t * __restrict d;
- const wchar_t * __restrict s;
- size_t n;
+wmemcpy(wchar_t * __restrict d, const wchar_t * __restrict s, size_t n)
{
-
return (wchar_t *)memcpy(d, s, n * sizeof(wchar_t));
}
diff --git a/lib/libc/string/wmemmove.c b/lib/libc/string/wmemmove.c
index 6b3ee94e3a90..05cfd1082afe 100644
--- a/lib/libc/string/wmemmove.c
+++ b/lib/libc/string/wmemmove.c
@@ -38,11 +38,7 @@ __FBSDID("$FreeBSD$");
#include <wchar.h>
wchar_t *
-wmemmove(d, s, n)
- wchar_t *d;
- const wchar_t *s;
- size_t n;
+wmemmove(wchar_t *d, const wchar_t *s, size_t n)
{
-
return (wchar_t *)memmove(d, s, n * sizeof(wchar_t));
}
diff --git a/lib/libc/string/wmemset.c b/lib/libc/string/wmemset.c
index b923f14637f1..362bdf230374 100644
--- a/lib/libc/string/wmemset.c
+++ b/lib/libc/string/wmemset.c
@@ -37,10 +37,7 @@ __FBSDID("$FreeBSD$");
#include <wchar.h>
wchar_t *
-wmemset(s, c, n)
- wchar_t *s;
- wchar_t c;
- size_t n;
+wmemset(wchar_t *s, wchar_t *c, size_t n)
{
size_t i;
wchar_t *p;