svn commit: r188098 - head/lib/libc/string
Warner Losh
imp at FreeBSD.org
Tue Feb 3 12:25:37 PST 2009
Author: imp
Date: Tue Feb 3 20:25:36 2009
New Revision: 188098
URL: http://svn.freebsd.org/changeset/base/188098
Log:
Fix the functions to match prototypes. The K&R definitions differ
from the ANSI-C prototype due to the 'int promotion' rule.
Modified:
head/lib/libc/string/memchr.c
head/lib/libc/string/strmode.c
head/lib/libc/string/wmemset.c
Modified: head/lib/libc/string/memchr.c
==============================================================================
--- head/lib/libc/string/memchr.c Tue Feb 3 20:01:51 2009 (r188097)
+++ head/lib/libc/string/memchr.c Tue Feb 3 20:25:36 2009 (r188098)
@@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
void *
-memchr(const void *s, unsigned char c, size_t n)
+memchr(const void *s, int c, size_t n)
{
if (n != 0) {
const unsigned char *p = s;
Modified: head/lib/libc/string/strmode.c
==============================================================================
--- head/lib/libc/string/strmode.c Tue Feb 3 20:01:51 2009 (r188097)
+++ head/lib/libc/string/strmode.c Tue Feb 3 20:25:36 2009 (r188098)
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
void
-strmode(mode_t mode, char *p)
+strmode(/* mode_t */ int mode, char *p)
{
/* print type */
switch (mode & S_IFMT) {
Modified: head/lib/libc/string/wmemset.c
==============================================================================
--- head/lib/libc/string/wmemset.c Tue Feb 3 20:01:51 2009 (r188097)
+++ head/lib/libc/string/wmemset.c Tue Feb 3 20:25:36 2009 (r188098)
@@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$");
#include <wchar.h>
wchar_t *
-wmemset(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;
More information about the svn-src-head
mailing list