Commit c9ac9147 by Kaveh R. Ghazi Committed by Kaveh Ghazi

argv.c: Fix comments.

	* argv.c: Fix comments.
	* calloc.c: Don't unnecessarily include "libiberty.h".
	(bzero): Add prototype.
	* floatformat.c: Include "ansidecl.h", rely on ANSI_PROTOTYPES.
	* getcwd.c (getcwd): Use standard definition to avoid conflicts
	with system headers.
	* hashtab.c (htab_traverse): Delete unused variables.
	* rename.c: Include "ansidecl.h".
	(rename): Use standard definition to avoid conflicts with system
	headers.
	* strsignal.c: Rely on ANSI_PROTOTYPES.
	* strstr.c: Check GNUC >= 2, not GNUC == 2.
	* vfprintf.c: Include "ansidecl.h", rely on ANSI_PROTOTYPES.
	* vprintf.c: Include "ansidecl.h" earlier, rely on
	ANSI_PROTOTYPES.
	* vsprintf.c: Include "ansidecl.h" earlier, rely on
	ANSI_PROTOTYPES and possibly include <stdarg.h>.

	* Makefile.in: Regenerate dependencies.

From-SVN: r65659
parent 8a4680db
2003-04-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* argv.c: Fix comments.
* calloc.c: Don't unnecessarily include "libiberty.h".
(bzero): Add prototype.
* floatformat.c: Include "ansidecl.h", rely on ANSI_PROTOTYPES.
* getcwd.c (getcwd): Use standard definition to avoid conflicts
with system headers.
* hashtab.c (htab_traverse): Delete unused variables.
* rename.c: Include "ansidecl.h".
(rename): Use standard definition to avoid conflicts with system
headers.
* strsignal.c: Rely on ANSI_PROTOTYPES.
* strstr.c: Check GNUC >= 2, not GNUC == 2.
* vfprintf.c: Include "ansidecl.h", rely on ANSI_PROTOTYPES.
* vprintf.c: Include "ansidecl.h" earlier, rely on
ANSI_PROTOTYPES.
* vsprintf.c: Include "ansidecl.h" earlier, rely on
ANSI_PROTOTYPES and possibly include <stdarg.h>.
* Makefile.in: Regenerate dependencies.
2003-04-15 DJ Delorie <dj@redhat.com> 2003-04-15 DJ Delorie <dj@redhat.com>
* maint-tool (deps): Scan for headers in $srcdir also. * maint-tool (deps): Scan for headers in $srcdir also.
......
...@@ -423,7 +423,7 @@ atexit.o: config.h ...@@ -423,7 +423,7 @@ atexit.o: config.h
basename.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ basename.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h $(INCDIR)/safe-ctype.h
bsearch.o: config.h $(INCDIR)/ansidecl.h bsearch.o: config.h $(INCDIR)/ansidecl.h
calloc.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h calloc.o: $(INCDIR)/ansidecl.h
choose-temp.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h choose-temp.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
clock.o: config.h clock.o: config.h
concat.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h concat.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
...@@ -431,7 +431,7 @@ copysign.o: $(INCDIR)/ansidecl.h ...@@ -431,7 +431,7 @@ copysign.o: $(INCDIR)/ansidecl.h
cp-demangle.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h \ cp-demangle.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h \
$(INCDIR)/dyn-string.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h $(INCDIR)/dyn-string.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h
cplus-dem.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h \ cplus-dem.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/demangle.h \
$(INCDIR)/getopt.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h
dyn-string.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/dyn-string.h \ dyn-string.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/dyn-string.h \
$(INCDIR)/libiberty.h $(INCDIR)/libiberty.h
fdmatch.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h fdmatch.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
...@@ -451,7 +451,8 @@ hex.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h ...@@ -451,7 +451,8 @@ hex.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
lbasename.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ lbasename.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h $(INCDIR)/safe-ctype.h
lrealpath.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h lrealpath.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
make-relative-prefix.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h make-relative-prefix.o: config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
make-temp-file.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h make-temp-file.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
md5.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/md5.h md5.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/md5.h
memchr.o: $(INCDIR)/ansidecl.h memchr.o: $(INCDIR)/ansidecl.h
...@@ -464,18 +465,23 @@ objalloc.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/objalloc.h ...@@ -464,18 +465,23 @@ objalloc.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/objalloc.h
obstack.o: config.h $(INCDIR)/obstack.h obstack.o: config.h $(INCDIR)/obstack.h
partition.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ partition.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(INCDIR)/partition.h $(INCDIR)/partition.h
pex-djgpp.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h pex-djgpp.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
pex-mpw.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h $(srcdir)/pex-common.h
pex-msdos.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ pex-mpw.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h $(srcdir)/pex-common.h
pex-os2.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h pex-msdos.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
pex-unix.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h $(srcdir)/pex-common.h $(INCDIR)/safe-ctype.h
pex-win32.o: config.h pex-common.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h pex-os2.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
physmem.o: config.h $(INCDIR)/libiberty.h $(srcdir)/pex-common.h
pex-unix.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(srcdir)/pex-common.h
pex-win32.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(srcdir)/pex-common.h
physmem.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
putenv.o: config.h $(INCDIR)/ansidecl.h putenv.o: config.h $(INCDIR)/ansidecl.h
random.o: $(INCDIR)/ansidecl.h random.o: $(INCDIR)/ansidecl.h
regex.o: config.h $(INCDIR)/xregex.h $(INCDIR)/xregex2.h regex.o: config.h $(INCDIR)/xregex.h $(INCDIR)/xregex2.h
rename.o: config.h rename.o: config.h $(INCDIR)/ansidecl.h
safe-ctype.o: $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h safe-ctype.o: $(INCDIR)/ansidecl.h $(INCDIR)/safe-ctype.h
setenv.o: config.h $(INCDIR)/ansidecl.h setenv.o: config.h $(INCDIR)/ansidecl.h
sigsetmask.o: $(INCDIR)/ansidecl.h sigsetmask.o: $(INCDIR)/ansidecl.h
...@@ -486,6 +492,7 @@ splay-tree.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ ...@@ -486,6 +492,7 @@ splay-tree.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(INCDIR)/splay-tree.h $(INCDIR)/splay-tree.h
strcasecmp.o: $(INCDIR)/ansidecl.h strcasecmp.o: $(INCDIR)/ansidecl.h
strchr.o: $(INCDIR)/ansidecl.h strchr.o: $(INCDIR)/ansidecl.h
strdup.o: $(INCDIR)/ansidecl.h
strerror.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h strerror.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
strncasecmp.o: $(INCDIR)/ansidecl.h strncasecmp.o: $(INCDIR)/ansidecl.h
strncmp.o: $(INCDIR)/ansidecl.h strncmp.o: $(INCDIR)/ansidecl.h
...@@ -498,6 +505,7 @@ ternary.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \ ...@@ -498,6 +505,7 @@ ternary.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(INCDIR)/ternary.h $(INCDIR)/ternary.h
vasprintf.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h vasprintf.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
vfork.o: $(INCDIR)/ansidecl.h vfork.o: $(INCDIR)/ansidecl.h
vfprintf.o: $(INCDIR)/ansidecl.h
vprintf.o: $(INCDIR)/ansidecl.h vprintf.o: $(INCDIR)/ansidecl.h
vsprintf.o: $(INCDIR)/ansidecl.h vsprintf.o: $(INCDIR)/ansidecl.h
waitpid.o: config.h waitpid.o: config.h
......
...@@ -35,7 +35,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -35,7 +35,7 @@ Boston, MA 02111-1307, USA. */
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#else /* !__STDC__ */ #else /* !ANSI_PROTOTYPES */
#if !defined _WIN32 || defined __GNUC__ #if !defined _WIN32 || defined __GNUC__
extern char *memcpy (); /* Copy memory region */ extern char *memcpy (); /* Copy memory region */
...@@ -46,7 +46,7 @@ extern void free (); /* Free malloc'd memory */ ...@@ -46,7 +46,7 @@ extern void free (); /* Free malloc'd memory */
extern char *strdup (); /* Duplicate a string */ extern char *strdup (); /* Duplicate a string */
#endif #endif
#endif /* __STDC__ */ #endif /* ANSI_PROTOTYPES */
#ifndef NULL #ifndef NULL
......
...@@ -13,8 +13,6 @@ Uses @code{malloc} to allocate storage for @var{nelem} objects of ...@@ -13,8 +13,6 @@ Uses @code{malloc} to allocate storage for @var{nelem} objects of
*/ */
#include "ansidecl.h" #include "ansidecl.h"
#include "libiberty.h"
#ifdef ANSI_PROTOTYPES #ifdef ANSI_PROTOTYPES
#include <stddef.h> #include <stddef.h>
#else #else
...@@ -23,6 +21,7 @@ Uses @code{malloc} to allocate storage for @var{nelem} objects of ...@@ -23,6 +21,7 @@ Uses @code{malloc} to allocate storage for @var{nelem} objects of
/* For systems with larger pointers than ints, this must be declared. */ /* For systems with larger pointers than ints, this must be declared. */
PTR malloc PARAMS ((size_t)); PTR malloc PARAMS ((size_t));
void bzero PARAMS ((PTR, size_t));
PTR PTR
calloc (nelem, elsize) calloc (nelem, elsize)
......
...@@ -17,9 +17,10 @@ You should have received a copy of the GNU General Public License ...@@ -17,9 +17,10 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "ansidecl.h"
#include "floatformat.h" #include "floatformat.h"
#include <math.h> /* ldexp */ #include <math.h> /* ldexp */
#ifdef __STDC__ #ifdef ANSI_PROTOTYPES
#include <stddef.h> #include <stddef.h>
extern void *memcpy (void *s1, const void *s2, size_t n); extern void *memcpy (void *s1, const void *s2, size_t n);
extern void *memset (void *s, int c, size_t n); extern void *memset (void *s, int c, size_t n);
......
...@@ -40,7 +40,7 @@ extern int errno; ...@@ -40,7 +40,7 @@ extern int errno;
char * char *
getcwd (buf, len) getcwd (buf, len)
char *buf; char *buf;
int len; size_t len;
{ {
char ourbuf[MAXPATHLEN]; char ourbuf[MAXPATHLEN];
char *result; char *result;
......
...@@ -634,9 +634,6 @@ htab_traverse (htab, callback, info) ...@@ -634,9 +634,6 @@ htab_traverse (htab, callback, info)
htab_trav callback; htab_trav callback;
PTR info; PTR info;
{ {
PTR *slot;
PTR *limit;
if ((htab->n_elements - htab->n_deleted) * 8 < htab->size) if ((htab->n_elements - htab->n_deleted) * 8 < htab->size)
htab_expand (htab); htab_expand (htab);
......
...@@ -12,6 +12,7 @@ exists, it is removed. ...@@ -12,6 +12,7 @@ exists, it is removed.
*/ */
#include "ansidecl.h"
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
...@@ -22,8 +23,8 @@ exists, it is removed. ...@@ -22,8 +23,8 @@ exists, it is removed.
int int
rename (zfrom, zto) rename (zfrom, zto)
char *zfrom; const char *zfrom;
char *zto; const char *zto;
{ {
if (link (zfrom, zto) < 0) if (link (zfrom, zto) < 0)
{ {
......
...@@ -42,7 +42,7 @@ extern PTR memset (); ...@@ -42,7 +42,7 @@ extern PTR memset ();
#undef sys_nsig #undef sys_nsig
#ifndef NULL #ifndef NULL
# ifdef __STDC__ # ifdef ANSI_PROTOTYPES
# define NULL (void *) 0 # define NULL (void *) 0
# else # else
# define NULL 0 # define NULL 0
......
...@@ -27,8 +27,8 @@ strstr (s1, s2) ...@@ -27,8 +27,8 @@ strstr (s1, s2)
register char *p = s1; register char *p = s1;
extern char *strchr (); extern char *strchr ();
extern int strncmp (); extern int strncmp ();
#if __GNUC__==2 #if __GNUC__ >= 2
extern __SIZE_TYPE__ strlen (); extern __SIZE_TYPE__ strlen (const char *);
#endif #endif
register int len = strlen (s2); register int len = strlen (s2);
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
Copyright (C) 1998 Free Software Foundation, Inc. Copyright (C) 1998 Free Software Foundation, Inc.
*/ */
#ifdef __STDC__ #include "ansidecl.h"
#ifdef ANSI_PROTOTYPES
#include <stdarg.h> #include <stdarg.h>
#else #else
#include <varargs.h> #include <varargs.h>
......
...@@ -15,13 +15,13 @@ nonstandard but common function @code{_doprnt}. ...@@ -15,13 +15,13 @@ nonstandard but common function @code{_doprnt}.
*/ */
#ifdef __STDC__ #include <ansidecl.h>
#ifdef ANSI_PROTOTYPES
#include <stdarg.h> #include <stdarg.h>
#else #else
#include <varargs.h> #include <varargs.h>
#endif #endif
#include <stdio.h> #include <stdio.h>
#include <ansidecl.h>
#undef vprintf #undef vprintf
int int
vprintf (format, ap) vprintf (format, ap)
......
...@@ -26,9 +26,13 @@ the resulting executable to be covered by the GNU General Public License. ...@@ -26,9 +26,13 @@ the resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why This exception does not however invalidate any other reasons why
the executable file might be covered by the GNU General Public License. */ the executable file might be covered by the GNU General Public License. */
#include <ansidecl.h>
#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
#else
#include <varargs.h> #include <varargs.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <ansidecl.h>
#undef vsprintf #undef vsprintf
#if defined _IOSTRG && defined _IOWRT #if defined _IOSTRG && defined _IOWRT
......
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