From c396e7ceba3a42c44ef68d7c2fc085376ce57a61 Mon Sep 17 00:00:00 2001 From: tkchia Date: Sat, 26 Oct 2024 20:48:41 +0000 Subject: [PATCH] cpp.ansi, em_m2: include correct prototype for sprint( ). --- lang/cem/cpp.ansi/preprocess.c | 3 +-- lang/m2/comp/enter.c | 1 - lang/m2/comp/f_info.h | 2 ++ lang/m2/comp/misc.c | 1 - lang/m2/comp/program.g | 1 - lang/m2/comp/stab.c | 2 +- lang/m2/m2mm/f_info.h | 2 ++ lang/m2/m2mm/misc.c | 1 - 8 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lang/cem/cpp.ansi/preprocess.c b/lang/cem/cpp.ansi/preprocess.c index c7883b1ef..5bd0b3436 100644 --- a/lang/cem/cpp.ansi/preprocess.c +++ b/lang/cem/cpp.ansi/preprocess.c @@ -24,6 +24,7 @@ #include "error.h" #include "bits.h" #include "skip.h" +#include "print.h" char _obuf[OBUFSIZE]; #ifdef DOBITS @@ -31,8 +32,6 @@ char bits[128]; #endif extern int InputLevel; -extern char* sprint(); - void Xflush(void) { sys_write(STDOUT, _obuf, OBUFSIZE); diff --git a/lang/m2/comp/enter.c b/lang/m2/comp/enter.c index d55ed4f56..a685445f0 100644 --- a/lang/m2/comp/enter.c +++ b/lang/m2/comp/enter.c @@ -118,7 +118,6 @@ void EnterVarList(struct node *Idlist, struct type *type, int local) register struct node *idlist = Idlist; register struct scopelist *sc = CurrVis; char buf[256]; - extern char *sprint(); if (local) { /* Find the closest enclosing open scope. This diff --git a/lang/m2/comp/f_info.h b/lang/m2/comp/f_info.h index ba2ea8401..f7f427718 100644 --- a/lang/m2/comp/f_info.h +++ b/lang/m2/comp/f_info.h @@ -9,6 +9,8 @@ /* $Id$ */ +#include "print.h" + struct f_info { unsigned short f_lineno; char *f_filename; diff --git a/lang/m2/comp/misc.c b/lang/m2/comp/misc.c index 031816f1d..04882d529 100644 --- a/lang/m2/comp/misc.c +++ b/lang/m2/comp/misc.c @@ -46,7 +46,6 @@ struct idf *gen_anon_idf(void) */ static int name_cnt; char *s = Malloc(strlen(FileName)+50); - char *sprint(); sprint(s, "#%d in %s, line %u", ++name_cnt, FileName, LineNumber); diff --git a/lang/m2/comp/program.g b/lang/m2/comp/program.g index 4e6180793..41c085e40 100644 --- a/lang/m2/comp/program.g +++ b/lang/m2/comp/program.g @@ -144,7 +144,6 @@ DefinitionModule int dummy; extern struct idf *DefId; extern int ForeignFlag; - extern char *sprint(); register struct scope *currscope = CurrentScope; char buf[512]; } : diff --git a/lang/m2/comp/stab.c b/lang/m2/comp/stab.c index 2f09ec925..7ade98bfe 100644 --- a/lang/m2/comp/stab.c +++ b/lang/m2/comp/stab.c @@ -28,13 +28,13 @@ #include "error.h" #include "stab.h" #include "main.h" +#include "print.h" extern int gdb_flag; #define INCR_SIZE 64 extern int proclevel; -extern char *sprint(); static struct db_str { unsigned sz; diff --git a/lang/m2/m2mm/f_info.h b/lang/m2/m2mm/f_info.h index 7645d732a..3b5d8ca1c 100644 --- a/lang/m2/m2mm/f_info.h +++ b/lang/m2/m2mm/f_info.h @@ -9,6 +9,8 @@ /* $Id$ */ +#include "print.h" + struct f_info { unsigned short f_lineno; char *f_fn; diff --git a/lang/m2/m2mm/misc.c b/lang/m2/m2mm/misc.c index 01fb332bc..eabf2091c 100644 --- a/lang/m2/m2mm/misc.c +++ b/lang/m2/m2mm/misc.c @@ -23,7 +23,6 @@ gen_anon_idf() */ static int name_cnt; char buff[100]; - char *sprint(); sprint(buff, "#%d in %s, line %u", ++name_cnt, FileName, LineNumber);