From: Ivan Maidanski Date: Tue, 13 Sep 2011 07:50:42 +0000 (+0400) Subject: Remove non-STDC code and comments. X-Git-Tag: gc7_3alpha2~366 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=754840fc8b779fe3cf2bba6393d69f06b0fece49;p=gc Remove non-STDC code and comments. * cord/cordbscs.c (CORD_substr): Remove code for non-STDC compilers. * include/private/gc_priv.h (clock): Likewise. * cord/de.c (beep): Replace the K&R-style function definition with the ANSI C one. * include/new_gc_alloc.h: Remove comment about expecting STDC compiler. --- diff --git a/cord/cordbscs.c b/cord/cordbscs.c index 84a9c6d5..eace2e9c 100644 --- a/cord/cordbscs.c +++ b/cord/cordbscs.c @@ -449,11 +449,6 @@ CORD CORD_substr(CORD x, size_t i, size_t n) /* n < 0 is impossible in a correct C implementation, but */ /* quite possible under SunOS 4.X. */ if (i + n > len) n = len - i; -# ifndef __STDC__ - if (i < 0) ABORT("CORD_substr: second arg. negative"); - /* Possible only if both client and C implementation are buggy. */ - /* But empirically this happens frequently. */ -# endif return(CORD_substr_checked(x, i, n)); } diff --git a/cord/de.c b/cord/de.c index 0905dcce..fd344889 100644 --- a/cord/de.c +++ b/cord/de.c @@ -348,22 +348,18 @@ void fix_pos() #if defined(WIN32) # define beep() Beep(1000 /* Hz */, 300 /* msecs */) #elif defined(MACINTOSH) -# define beep() SysBeep(1) +# define beep() SysBeep(1) #else /* * beep() is part of some curses packages and not others. * We try to match the type of the builtin one, if any. */ -#ifdef __STDC__ - int beep(void) -#else - int beep() -#endif -{ + int beep(void) + { putc('\007', stderr); return(0); -} -#endif + } +#endif /* !WIN32 && !MACINTOSH */ # define NO_PREFIX -1 # define BARE_PREFIX -2 diff --git a/include/new_gc_alloc.h b/include/new_gc_alloc.h index 4612aeb6..bf09780e 100644 --- a/include/new_gc_alloc.h +++ b/include/new_gc_alloc.h @@ -43,9 +43,6 @@ // problems. The argument for changing it is that the usual default // allocator is usually a very bad choice for a garbage collected environment.) // -// This code assumes that the collector itself has been compiled with a -// compiler that defines __STDC__ . -// #ifndef GC_ALLOC_H diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index 4b69a9f1..fc855c76 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -332,9 +332,6 @@ typedef char * ptr_t; /* A generic pointer to which we can add */ # define MS_TIME_DIFF(a,b) ((long)((a)-(b))) #else /* !MSWIN32, !MSWINCE, !BSD_TIME */ # include -# if !defined(__STDC__) && defined(SPARC) && defined(SUNOS4) - clock_t clock(void); /* Not in time.h, where it belongs */ -# endif # if defined(FREEBSD) && !defined(CLOCKS_PER_SEC) # include # define CLOCKS_PER_SEC CLK_TCK