From 708c1ba1b0cc2f0a90736c69b70e8230351edd84 Mon Sep 17 00:00:00 2001 From: carl Date: Sat, 11 May 2019 01:11:26 +0800 Subject: [PATCH] ANSI C conversion --- mach/z8000/cg/mach.c | 18 ++++++++++-------- mach/z8000/cg/mach.h | 10 +++++++++- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/mach/z8000/cg/mach.c b/mach/z8000/cg/mach.c index 2c809778b..38b7dd6d5 100644 --- a/mach/z8000/cg/mach.c +++ b/mach/z8000/cg/mach.c @@ -9,8 +9,8 @@ * machine dependent back end routines for the z8000 */ -con_part(sz,w) register sz; word w; { - +void con_part(register int sz, word w) +{ while (part_size % sz) part_size++; if (part_size == TEM_WSIZE) @@ -27,15 +27,15 @@ con_part(sz,w) register sz; word w; { part_size += sz; } -con_mult(sz) word sz; { - +void con_mult(word sz) +{ if (sz != 4) fatal("bad icon/ucon size"); fprintf(codefile,"\t.data4 %s\n", str); } -con_float() { - +void con_float(void) +{ static int been_here; if (argval != 4 && argval != 8) fatal("bad fcon size"); @@ -58,7 +58,8 @@ string holstr(n) word n; { } */ -prolog(nlocals) full nlocals; { +void prolog(full nlocals) +{ fprintf(codefile,"\tpush\t*RR14, R13\n\tld\tR13, R15\n"); if (nlocals == 0) @@ -67,7 +68,8 @@ prolog(nlocals) full nlocals; { fprintf(codefile,"\tsub\tR15, $%d\n",nlocals); } -mes(type) word type ; { +void mes(word type) +{ int argt ; switch ( (int)type ) { diff --git a/mach/z8000/cg/mach.h b/mach/z8000/cg/mach.h index 76581ecfc..7a54dd0b7 100644 --- a/mach/z8000/cg/mach.h +++ b/mach/z8000/cg/mach.h @@ -1,8 +1,10 @@ -/* $Id$ */ /* * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands. * See the copyright notice in the ACK home directory, in the file "Copyright". */ +#include "tables.h" +#include "types.h" + #define ex_ap(y) fprintf(codefile,".extern %s\n",y) #define in_ap(y) /* nothing */ @@ -28,3 +30,9 @@ #define fmt_id(sf,st) sprintf(st,"_%s", sf) #define BSS_INIT 0 + +void con_float(void); +void con_mult(word sz); +void con_part(register int sz, word w); +void mes(word type); +void prolog(full nlocals);