Sfoglia il codice sorgente

Made acceptable for our ANSI C compiler

ceriel 32 anni fa
parent
commit
a93813c1f6

+ 7 - 1
util/cgg/booth.h

@@ -53,7 +53,13 @@ extern char *iname;			/* stdin */
 typedef char byte;
 typedef char * string;
 
-extern char *malloc(),*myalloc();
+extern char *myalloc();
+
+#if __STDC__
+#include <stdlib.h>
+#else
+extern char *malloc();
+#endif
 
 #include <cg_pattern.h>
 

+ 1 - 1
util/cgg/main.c

@@ -17,7 +17,7 @@ extern char *sprintf();
 char * myalloc(n) {
 	register char *p;
 
-	p= (char*) malloc((unsigned)n);
+	p= malloc((unsigned)n);
 	if (p==0) {
 		yyerror("Out of core");
 		exit(1);

+ 0 - 2
util/int/dump.c

@@ -31,8 +31,6 @@ extern long inr;			/* from log.c */
 	although it is not directly evident how.
 */
 
-extern char *sprintf();
-
 PRIVATE char *displ_undefs(), *displ_fil(), *displ_sh(), *displ_code();
 PRIVATE ptr std_raw(), std_rsb();
 PRIVATE int std_bytes(), dtd_bytes(), FRAd_bytes();

+ 2 - 5
util/int/io.c

@@ -12,9 +12,6 @@
 #include	"mem.h"
 #include	"linfil.h"
 
-extern char *sprintf();
-extern _doprnt();
-
 extern int running;			/* from main.c */
 extern char *prog_name;			/* from main.c */
 extern char *load_name;			/* from init.c */
@@ -162,7 +159,7 @@ PRIVATE do_fatal(fp, fmt, ap)
 	fprintf(fp, "(Fatal error) ");
 	if (load_name)
 		fprintf(fp, "%s: ", load_name);
-	_doprnt(fmt, ap, fp);
+	vfprintf(fp, fmt, ap);
 	fputc('\n', fp);
 }
 
@@ -177,7 +174,7 @@ message(va_alist)
 	va_start(ap);
 	{
 		register char *fmt = va_arg(ap, char *);
-		_doprnt(fmt, ap, mess_fp);
+		vfprintf(mess_fp, fmt, ap);
 	}
 	va_end(ap);
 

+ 2 - 3
util/int/log.c

@@ -13,7 +13,6 @@
 
 #ifdef	LOGGING
 
-extern char *sprintf();
 extern int strlen();
 extern char *strcpy();
 
@@ -256,10 +255,10 @@ do_log(va_alist)
 		if (fmt[0] == '@') {
 			/* include position */
 			fprintf(log_fp, "%.4s%s, ", fmt, position());
-			_doprnt(&fmt[4], ap, log_fp);
+			vfprintf(log_fp, &fmt[4], ap);
 		}
 		else {
-			_doprnt(&fmt[0], ap, log_fp);
+			vfprintf(log_fp, &fmt[0], ap);
 		}
 	}
 	va_end(ap);

+ 3 - 1
util/int/moncalls.c

@@ -11,6 +11,9 @@
 
 #include	<sys/types.h>
 #include	<sys/stat.h>
+#if __STDC__
+#include	<time.h>
+#endif
 #include	<sys/times.h>
 
 extern int errno;			/* UNIX error number */
@@ -54,7 +57,6 @@ struct timeb {			/* non-existing; we use an ad-hoc definition */
 
 #define	DUPMASK		0x40
 
-extern long times();
 extern long lseek();
 #ifdef	SYS_V
 extern unsigned int alarm();

+ 3 - 0
util/int/monstruct.c

@@ -12,6 +12,9 @@
 
 #include	<sys/types.h>
 #include	<sys/stat.h>
+#if __STDC__
+#include	<time.h>
+#endif
 #include	<sys/times.h>
 #include	<sgtty.h>
 

+ 0 - 1
util/int/switch/mkiswitch.c

@@ -11,7 +11,6 @@
 
 #include <stdio.h>
 
-extern char *sprintf();
 extern FILE *popen();
 
 #include <ip_spec.h>

+ 0 - 1
util/int/switch/mkswitch.c

@@ -13,7 +13,6 @@
 
 #include <stdio.h>
 
-extern char *sprintf();
 extern FILE *popen();
 
 char *progname;

+ 0 - 2
util/int/trap.c

@@ -18,8 +18,6 @@
 #include	"rsb.h"
 #include	"fra.h"
 
-extern char *sprintf();
-
 extern jmp_buf trapbuf;			/* from main.c */
 
 int must_test;				/* TEST-bit on in EM header word 2 */