From 04cb62915914f217c28d3f45dd147698eb01f551 Mon Sep 17 00:00:00 2001 From: carl Date: Sat, 11 May 2019 01:10:12 +0800 Subject: [PATCH] ANSI C conversion --- mach/6500/cg/mach.c | 21 ++++++++++----------- mach/6500/cg/mach.h | 11 +++++++++++ 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/mach/6500/cg/mach.c b/mach/6500/cg/mach.c index 386e826f8..b89241d14 100644 --- a/mach/6500/cg/mach.c +++ b/mach/6500/cg/mach.c @@ -3,8 +3,8 @@ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands. * See the copyright notice in the ACK home directory, in the file "Copyright". */ -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) @@ -21,17 +21,16 @@ con_part(sz,w) register sz; word w; { part_size += sz; } -con_mult(sz) word sz; { - long atol(); - +void con_mult(word sz) +{ if (sz != 4) fatal("bad icon/ucon size"); fprintf(codefile,".data4 %ld\n", atol(str)); } -con_float() { - +void con_float(void) +{ static int been_here; if (argval != 4 && argval != 8) fatal("bad fcon size"); @@ -45,8 +44,8 @@ static int been_here; } } -prolog(nlocals) full nlocals; { - +void prolog(full nlocals) +{ fprintf(codefile,"\tjsr Pro\n"); if (nlocals == 0) return; @@ -56,9 +55,9 @@ prolog(nlocals) full nlocals; { nlocals, nlocals); } -mes(type) word type; { +void mes(word type) +{ int argt ; - switch ( (int)type ) { case ms_ext : for (;;) { diff --git a/mach/6500/cg/mach.h b/mach/6500/cg/mach.h index 66f66d547..c736ffd05 100644 --- a/mach/6500/cg/mach.h +++ b/mach/6500/cg/mach.h @@ -4,6 +4,9 @@ */ /* $Id$ */ +#include "tables.h" +#include "types.h" + #define ex_ap(y) fprintf(codefile,".extern %s\n",y) #define in_ap(y) /* nothing */ @@ -29,3 +32,11 @@ #define fmt_id(ft, fs) sprintf(fs,"_%s",ft) #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); + +