]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Include <stddef.h>.
authorJim Meyering <jim@meyering.net>
Wed, 10 Sep 2003 09:03:31 +0000 (09:03 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 10 Sep 2003 09:03:31 +0000 (09:03 +0000)
Use types required by C89 in prototype.

lib/memcpy.c
lib/memmove.c
lib/memset.c

index 2ccd71875924967640de05ea78fdb154a0a181a7..fdca8de2c80d99ec4017477507a1ed5ac6f75ea2 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1997, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1997, 2000, 2003 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 # include <config.h>
 #endif
 
+#include <stddef.h>
+
 /* Copy LEN bytes starting at SRCADDR to DESTADDR.  Result undefined
    if the source overlaps with the destination.
    Return DESTADDR. */
 
-char *
-memcpy (char *destaddr, const char *srcaddr, int len)
+void *
+memcpy (void *destaddr, void const *srcaddr, size_t len)
 {
   char *dest = destaddr;
+  char const *src = srcaddr;
 
   while (len-- > 0)
-    *destaddr++ = *srcaddr++;
-  return dest;
+    *dest++ = *src++;
+  return destaddr;
 }
index ea38e8df549e9e1210c0a38bbe8ed08e45a93603..79cc7827396c0ffbe75e932f8b9d93a27994b6e1 100644 (file)
@@ -7,13 +7,13 @@
 # include <config.h>
 #endif
 
+#include <stddef.h>
+
 void *
-memmove (dest, source, length)
-     char *dest;
-     const char *source;
-     unsigned length;
+memmove (void *dest0, void const *source0, size_t length)
 {
-  char *d0 = dest;
+  char *dest = dest0;
+  char const *source = source0;
   if (source < dest)
     /* Moving from low mem to hi mem; start at end.  */
     for (source += length, dest += length; length; --length)
@@ -24,5 +24,5 @@ memmove (dest, source, length)
       for (; length; --length)
        *dest++ = *source++;
     }
-  return (void *) d0;
+  return dest0;
 }
index 5744bcbf7585dde15683be2084be2255657e9989..d7321b200e91d5cb4ad12935f2afc50fd52e4518 100644 (file)
@@ -1,5 +1,5 @@
 /* memset.c -- set an area of memory to a given value
-   Copyright (C) 1991 Free Software Foundation, Inc.
+   Copyright (C) 1991, 2003 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    along with this program; if not, write to the Free Software Foundation,
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-char *
-memset (char *str, int c, unsigned int len)
+#include <stddef.h>
+
+void *
+memset (void *str, int c, size_t len)
 {
   register char *st = str;