Commit 0ae0f1b0 by Roger Sayle Committed by Roger Sayle

argv.c: Use ANSI_PROTOTYPES instead of __STDC__.


	* argv.c: Use ANSI_PROTOTYPES instead of __STDC__.
	* memchr.c: Likewise.
	* strcasecmp.c: Likewise.
	* strncasecmp.c: Likewise.
	* strncmp.c: Likewise.
	* xatexit.c: Likewise.
	* xmalloc.c: Likewise.

	* copysign.c: Use traditional function declaration instead of DEFUN.
	* sigsetmask.c: Likewise.

	* memcmp.c: Both of the above, ANSI_PROTOTYPES and DEFUN.
	* memset.c: Likewise.

	* memcpy.c: ANSI_PROTOTYPES, DEFUN and prototype bcopy.
	* memmove.c: Likewise.

From-SVN: r65619
parent db0b376e
2003-04-14 Roger Sayle <roger@eyesopen.com> 2003-04-14 Roger Sayle <roger@eyesopen.com>
* argv.c: Use ANSI_PROTOTYPES instead of __STDC__.
* memchr.c: Likewise.
* strcasecmp.c: Likewise.
* strncasecmp.c: Likewise.
* strncmp.c: Likewise.
* xatexit.c: Likewise.
* xmalloc.c: Likewise.
* copysign.c: Use traditional function declaration instead of DEFUN.
* sigsetmask.c: Likewise.
* memcmp.c: Both of the above, ANSI_PROTOTYPES and DEFUN.
* memset.c: Likewise.
* memcpy.c: ANSI_PROTOTYPES, DEFUN and prototype bcopy.
* memmove.c: Likewise.
2003-04-14 Roger Sayle <roger@eyesopen.com>
* strdup.c (strdup): Tweak implementation to use memcpy. * strdup.c (strdup): Tweak implementation to use memcpy.
2003-04-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2003-04-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
......
...@@ -29,7 +29,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -29,7 +29,7 @@ Boston, MA 02111-1307, USA. */
/* Routines imported from standard C runtime libraries. */ /* Routines imported from standard C runtime libraries. */
#ifdef __STDC__ #ifdef ANSI_PROTOTYPES
#include <stddef.h> #include <stddef.h>
#include <string.h> #include <string.h>
......
...@@ -131,7 +131,9 @@ typedef union ...@@ -131,7 +131,9 @@ typedef union
#if defined(__IEEE_BIG_ENDIAN) || defined(__IEEE_LITTLE_ENDIAN) #if defined(__IEEE_BIG_ENDIAN) || defined(__IEEE_LITTLE_ENDIAN)
double DEFUN(copysign, (x, y), double x AND double y) double
copysign (x, y)
double x, y;
{ {
__ieee_double_shape_type a,b; __ieee_double_shape_type a,b;
b.value = y; b.value = y;
...@@ -142,7 +144,9 @@ double DEFUN(copysign, (x, y), double x AND double y) ...@@ -142,7 +144,9 @@ double DEFUN(copysign, (x, y), double x AND double y)
#else #else
double DEFUN(copysign, (x, y), double x AND double y) double
copysign (x, y)
double x, y;
{ {
if ((x < 0 && y > 0) || (x > 0 && y < 0)) if ((x < 0 && y > 0) || (x > 0 && y < 0))
return -x; return -x;
......
...@@ -15,7 +15,7 @@ returned. ...@@ -15,7 +15,7 @@ returned.
*/ */
#include <ansidecl.h> #include <ansidecl.h>
#ifdef __STDC__ #ifdef ANSI_PROTOTYPES
#include <stddef.h> #include <stddef.h>
#else #else
#define size_t unsigned long #define size_t unsigned long
......
...@@ -16,15 +16,17 @@ as if comparing unsigned char arrays. ...@@ -16,15 +16,17 @@ as if comparing unsigned char arrays.
*/ */
#include <ansidecl.h> #include <ansidecl.h>
#ifdef __STDC__ #ifdef ANSI_PROTOTYPES
#include <stddef.h> #include <stddef.h>
#else #else
#define size_t unsigned long #define size_t unsigned long
#endif #endif
int int
DEFUN(memcmp, (str1, str2, count), memcmp (str1, str2, count)
const PTR str1 AND const PTR str2 AND size_t count) const PTR str1;
const PTR str2;
size_t count;
{ {
register const unsigned char *s1 = (const unsigned char*)str1; register const unsigned char *s1 = (const unsigned char*)str1;
register const unsigned char *s2 = (const unsigned char*)str2; register const unsigned char *s2 = (const unsigned char*)str2;
......
...@@ -13,14 +13,19 @@ Copies @var{length} bytes from memory region @var{in} to region ...@@ -13,14 +13,19 @@ Copies @var{length} bytes from memory region @var{in} to region
*/ */
#include <ansidecl.h> #include <ansidecl.h>
#ifdef __STDC__ #ifdef ANSI_PROTOTYPES
#include <stddef.h> #include <stddef.h>
#else #else
#define size_t unsigned long #define size_t unsigned long
#endif #endif
void bcopy PARAMS((const void*, void*, size_t));
PTR PTR
DEFUN(memcpy, (out, in, length), PTR out AND const PTR in AND size_t length) memcpy (out, in, length)
PTR out;
const PTR in;
size_t length;
{ {
bcopy(in, out, length); bcopy(in, out, length);
return out; return out;
......
...@@ -13,12 +13,14 @@ Copies @var{count} bytes from memory area @var{from} to memory area ...@@ -13,12 +13,14 @@ Copies @var{count} bytes from memory area @var{from} to memory area
*/ */
#include <ansidecl.h> #include <ansidecl.h>
#ifdef __STDC__ #ifdef ANSI_PROTOTYPES
#include <stddef.h> #include <stddef.h>
#else #else
#define size_t unsigned long #define size_t unsigned long
#endif #endif
void bcopy PARAMS ((const void*, void*, size_t));
PTR PTR
memmove (s1, s2, n) memmove (s1, s2, n)
PTR s1; PTR s1;
......
...@@ -13,15 +13,17 @@ Sets the first @var{count} bytes of @var{s} to the constant byte ...@@ -13,15 +13,17 @@ Sets the first @var{count} bytes of @var{s} to the constant byte
*/ */
#include <ansidecl.h> #include <ansidecl.h>
#ifdef __STDC__ #ifdef ANSI_PROTOTYPES
#include <stddef.h> #include <stddef.h>
#else #else
#define size_t unsigned long #define size_t unsigned long
#endif #endif
PTR PTR
DEFUN(memset, (dest, val, len), memset (dest, val, len)
PTR dest AND register int val AND register size_t len) PTR dest;
register int val;
register size_t len;
{ {
register unsigned char *ptr = (unsigned char*)dest; register unsigned char *ptr = (unsigned char*)dest;
while (len-- > 0) while (len-- > 0)
......
...@@ -25,8 +25,8 @@ extern void abort PARAMS ((void)) ATTRIBUTE_NORETURN; ...@@ -25,8 +25,8 @@ extern void abort PARAMS ((void)) ATTRIBUTE_NORETURN;
#ifdef SIG_SETMASK #ifdef SIG_SETMASK
int int
DEFUN(sigsetmask,(set), sigsetmask (set)
int set) int set;
{ {
sigset_t new; sigset_t new;
sigset_t old; sigset_t old;
......
...@@ -25,7 +25,7 @@ static char sccsid[] = "@(#)strcasecmp.c 5.5 (Berkeley) 11/24/87"; ...@@ -25,7 +25,7 @@ static char sccsid[] = "@(#)strcasecmp.c 5.5 (Berkeley) 11/24/87";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <ansidecl.h> #include <ansidecl.h>
#ifdef __STDC__ #ifdef ANSI_PROTOTYPES
#include <stddef.h> #include <stddef.h>
#else #else
#define size_t unsigned long #define size_t unsigned long
......
...@@ -25,7 +25,7 @@ static char sccsid[] = "@(#)strcasecmp.c 5.5 (Berkeley) 11/24/87"; ...@@ -25,7 +25,7 @@ static char sccsid[] = "@(#)strcasecmp.c 5.5 (Berkeley) 11/24/87";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <ansidecl.h> #include <ansidecl.h>
#ifdef __STDC__ #ifdef ANSI_PROTOTYPES
#include <stddef.h> #include <stddef.h>
#else #else
#define size_t unsigned long #define size_t unsigned long
......
...@@ -13,7 +13,7 @@ Compares the first @var{n} bytes of two strings, returning a value as ...@@ -13,7 +13,7 @@ Compares the first @var{n} bytes of two strings, returning a value as
*/ */
#include <ansidecl.h> #include <ansidecl.h>
#ifdef __STDC__ #ifdef ANSI_PROTOTYPES
#include <stddef.h> #include <stddef.h>
#else #else
#define size_t unsigned long #define size_t unsigned long
......
...@@ -27,7 +27,7 @@ failure. If you use @code{xatexit} to register functions, you must use ...@@ -27,7 +27,7 @@ failure. If you use @code{xatexit} to register functions, you must use
#include <stdio.h> #include <stdio.h>
#ifdef __STDC__ #ifdef ANSI_PROTOTYPES
#include <stddef.h> #include <stddef.h>
#else #else
#define size_t unsigned long #define size_t unsigned long
......
...@@ -68,7 +68,7 @@ function will be called to print an error message and terminate execution. ...@@ -68,7 +68,7 @@ function will be called to print an error message and terminate execution.
#include <stdio.h> #include <stdio.h>
#ifdef __STDC__ #ifdef ANSI_PROTOTYPES
#include <stddef.h> #include <stddef.h>
#else #else
#define size_t unsigned long #define size_t unsigned long
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment