Made acceptable for our ANSI C compiler

This commit is contained in:
ceriel 1991-12-03 11:03:58 +00:00
parent 9e2361fc8f
commit a93813c1f6
10 changed files with 18 additions and 17 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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