From 11a0bb74cdf64f43744171b7e7c37258981a7741 Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Mon, 14 Dec 1998 07:01:03 +0000 Subject: [PATCH] choose-temp.c: Don't check IN_GCC anymore. * choose-temp.c: Don't check IN_GCC anymore. * floatformat.c (floatformat_from_double): Use `const', not `CONST'. * memchr.c (memchr): Likewise. * memcpy.c (memcpy): Likewise. * memmove.c (memmove): Likewise. * mkstemp.c: Don't check IN_GCC anymore. * pexecute.c: Likewise. * splay-tree.c: Likewise. * strchr.c (strchr): Use `const', not `CONST'. * strrchr.c (strrchr): Likewise. * strtol.c (strtol): Likewise. * strtoul.c (strtoul): Likewise. From-SVN: r24307 --- libiberty/ChangeLog | 18 ++++++++++++++++++ libiberty/choose-temp.c | 25 ++++++++----------------- libiberty/floatformat.c | 2 +- libiberty/memchr.c | 4 ++-- libiberty/memcpy.c | 2 +- libiberty/memmove.c | 2 +- libiberty/mkstemp.c | 4 ---- libiberty/pexecute.c | 12 +----------- libiberty/splay-tree.c | 2 +- libiberty/strchr.c | 2 +- libiberty/strrchr.c | 2 +- libiberty/strtol.c | 4 ++-- libiberty/strtoul.c | 4 ++-- 13 files changed, 39 insertions(+), 44 deletions(-) diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index c97c1a0..4ee7acf 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,21 @@ +Mon Dec 14 09:55:50 1998 Kaveh R. Ghazi + + * choose-temp.c: Don't check IN_GCC anymore. + + * floatformat.c (floatformat_from_double): Use `const', not `CONST'. + * memchr.c (memchr): Likewise. + * memcpy.c (memcpy): Likewise. + * memmove.c (memmove): Likewise. + + * mkstemp.c: Don't check IN_GCC anymore. + * pexecute.c: Likewise. + * splay-tree.c: Likewise. + + * strchr.c (strchr): Use `const', not `CONST'. + * strrchr.c (strrchr): Likewise. + * strtol.c (strtol): Likewise. + * strtoul.c (strtoul): Likewise. + Fri Dec 4 13:51:04 1998 David Taylor Elena Zannoni Stan Shebs diff --git a/libiberty/choose-temp.c b/libiberty/choose-temp.c index 089bd10..c295ca1 100644 --- a/libiberty/choose-temp.c +++ b/libiberty/choose-temp.c @@ -22,22 +22,16 @@ Boston, MA 02111-1307, USA. */ /* This file lives in at least two places: libiberty and gcc. Don't change one without the other. */ -#if defined (IN_GCC) || defined (HAVE_CONFIG_H) +#ifdef HAVE_CONFIG_H #include "config.h" #endif -#ifdef IN_GCC -#include "system.h" -#else - -/* If we are in gcc, system.h has handled everything. When not in - gcc, if we have a config.h we assume that HAVE_SYS_FILE_H tells us - whether to include sys/file.h. However, libiberty does not have a - config.h, and instead arranges to define NO_SYS_FILE_H on the - command line when there is no sys/file.h. */ - -#if defined (HAVE_CONFIG_H) ? defined (HAVE_SYS_FILE_H) : ! defined (NO_SYS_FILE_H) +#include /* May get P_tmpdir. */ #include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_SYS_FILE_H #include /* May get R_OK, etc. on some systems. */ #endif @@ -47,13 +41,10 @@ Boston, MA 02111-1307, USA. */ #define X_OK 1 #endif -#include /* May get P_tmpdir. */ -#endif /* IN_GCC */ - #include "libiberty.h" -#ifdef IN_GCC extern int mkstemps (); -#else + +#ifndef IN_GCC #if defined (__MSDOS__) || defined (_WIN32) #define DIR_SEPARATOR '\\' #endif diff --git a/libiberty/floatformat.c b/libiberty/floatformat.c index 7f6086f..6ad290c 100644 --- a/libiberty/floatformat.c +++ b/libiberty/floatformat.c @@ -279,7 +279,7 @@ put_field (data, order, total_len, start, len, stuff_to_put) void floatformat_from_double (fmt, from, to) - CONST struct floatformat *fmt; + const struct floatformat *fmt; double *from; char *to; { diff --git a/libiberty/memchr.c b/libiberty/memchr.c index 93ef43d..cce3003 100644 --- a/libiberty/memchr.c +++ b/libiberty/memchr.c @@ -44,11 +44,11 @@ QUICKREF PTR memchr (src_void, c, length) - register CONST PTR src_void; + register const PTR src_void; int c; size_t length; { - CONST unsigned char *src = (CONST unsigned char *)src_void; + const unsigned char *src = (const unsigned char *)src_void; while (--length >= 0) { diff --git a/libiberty/memcpy.c b/libiberty/memcpy.c index c28208a..707a9f5 100644 --- a/libiberty/memcpy.c +++ b/libiberty/memcpy.c @@ -21,7 +21,7 @@ DESCRIPTION #endif PTR -DEFUN(memcpy, (out, in, length), PTR out AND CONST PTR in AND size_t length) +DEFUN(memcpy, (out, in, length), PTR out AND const PTR in AND size_t length) { bcopy(in, out, length); return out; diff --git a/libiberty/memmove.c b/libiberty/memmove.c index 818fc24..176c326 100644 --- a/libiberty/memmove.c +++ b/libiberty/memmove.c @@ -10,7 +10,7 @@ PTR memmove (s1, s2, n) PTR s1; - CONST PTR s2; + const PTR s2; size_t n; { bcopy (s2, s1, n); diff --git a/libiberty/mkstemp.c b/libiberty/mkstemp.c index 91cc3eb..16c16a23 100644 --- a/libiberty/mkstemp.c +++ b/libiberty/mkstemp.c @@ -20,7 +20,6 @@ #include "config.h" #endif -#ifndef IN_GCC #ifdef HAVE_STDLIB_H #include #endif @@ -37,9 +36,6 @@ #include #endif #include "ansidecl.h" -#else -#include "system.h" -#endif /* We need to provide a type for gcc_uint64_t. */ #ifdef __GNUC__ diff --git a/libiberty/pexecute.c b/libiberty/pexecute.c index 206db58..0ead566 100644 --- a/libiberty/pexecute.c +++ b/libiberty/pexecute.c @@ -26,9 +26,7 @@ Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif -#ifdef IN_GCC -#include "system.h" -#else + #include #include #ifdef HAVE_UNISTD_H @@ -38,7 +36,6 @@ Boston, MA 02111-1307, USA. */ #ifdef HAVE_SYS_WAIT_H #include #endif -#endif #ifdef vfork /* Autoconf may define this to fork for us. */ # define VFORK_STRING "fork" @@ -609,9 +606,6 @@ pfinish () extern int execv (); extern int execvp (); -#ifdef IN_GCC -extern char * my_strerror PROTO ((int)); -#endif int pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) @@ -703,11 +697,7 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) /* Note: Calling fprintf and exit here doesn't seem right for vfork. */ fprintf (stderr, "%s: ", this_pname); fprintf (stderr, install_error_msg, program); -#ifdef IN_GCC - fprintf (stderr, ": %s\n", my_strerror (errno)); -#else fprintf (stderr, ": %s\n", xstrerror (errno)); -#endif exit (-1); /* NOTREACHED */ return 0; diff --git a/libiberty/splay-tree.c b/libiberty/splay-tree.c index e14b931..cc76696 100644 --- a/libiberty/splay-tree.c +++ b/libiberty/splay-tree.c @@ -23,7 +23,7 @@ Lewis, Harry R. and Denenberg, Larry. Data Structures and Their Algorithms. Harper-Collins, Inc. 1991. */ -#if defined (IN_GCC) || defined (HAVE_CONFIG_H) +#ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/libiberty/strchr.c b/libiberty/strchr.c index 22976ce..550480f 100644 --- a/libiberty/strchr.c +++ b/libiberty/strchr.c @@ -21,7 +21,7 @@ BUGS char * strchr (s, c) - register CONST char *s; + register const char *s; int c; { do { diff --git a/libiberty/strrchr.c b/libiberty/strrchr.c index 30f9e8a..8c05bcb 100644 --- a/libiberty/strrchr.c +++ b/libiberty/strrchr.c @@ -21,7 +21,7 @@ BUGS char * strrchr (s, c) - register CONST char *s; + register const char *s; int c; { char *rtnval = 0; diff --git a/libiberty/strtol.c b/libiberty/strtol.c index db27ee0..37d1706 100644 --- a/libiberty/strtol.c +++ b/libiberty/strtol.c @@ -63,11 +63,11 @@ */ long strtol(nptr, endptr, base) - CONST char *nptr; + const char *nptr; char **endptr; register int base; { - register CONST char *s = nptr; + register const char *s = nptr; register unsigned long acc; register int c; register unsigned long cutoff; diff --git a/libiberty/strtoul.c b/libiberty/strtoul.c index 4090245..ff6f2d6 100644 --- a/libiberty/strtoul.c +++ b/libiberty/strtoul.c @@ -51,11 +51,11 @@ */ unsigned long strtoul(nptr, endptr, base) - CONST char *nptr; + const char *nptr; char **endptr; register int base; { - register CONST char *s = nptr; + register const char *s = nptr; register unsigned long acc; register int c; register unsigned long cutoff; -- 2.7.4