From e6ba8034f02603a6cb90a71e71a54166577fb5eb Mon Sep 17 00:00:00 2001 From: carl Date: Sat, 11 May 2019 01:11:17 +0800 Subject: [PATCH] ANSI C conversion --- mach/z80/cg/mach.c | 25 +++++++++++-------------- mach/z80/cg/mach.h | 11 ++++++++--- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/mach/z80/cg/mach.c b/mach/z80/cg/mach.c index 1fb86268d..1ab1cd0fa 100644 --- a/mach/z80/cg/mach.c +++ b/mach/z80/cg/mach.c @@ -4,16 +4,13 @@ * */ -#ifndef NORCSID -static char rcs_mach[] = "$Id$" ; -static char rcs_h[] = RCS_H ; -#endif - /* * machine dependent back end routines for the Zilog Z80 (as well as Intel 8080) */ -con_part(sz,w) register sz; word w; { + +void con_part(register int sz, word w) +{ while (part_size % sz) part_size++; @@ -31,15 +28,15 @@ con_part(sz,w) register sz; word w; { part_size += sz; } -con_mult(sz) word sz; { - long atol(); - +void con_mult(word sz) +{ if (argval != 4) fatal("bad icon/ucon size"); fprintf(codefile, ".data4\t%ld\n", atol(str)); } -con_float() { +void con_float(void) +{ static int been_here; int sz = argval; @@ -56,9 +53,8 @@ con_float() { } } - -prolog(nlocals) full nlocals; { - +void prolog(full nlocals) +{ fprintf(codefile,"\tpush\tiy\n\tld\thl,0\n\tadd\thl,sp\n\tpush\thl\n\tpop\tiy\n"); switch (nlocals) { case 8: fprintf(codefile,"\tpush\thl\n"); @@ -72,7 +68,8 @@ prolog(nlocals) full nlocals; { } } -mes(type) word type ; { +void mes(word type) +{ int argt ; switch ( (int)type ) { diff --git a/mach/z80/cg/mach.h b/mach/z80/cg/mach.h index 0c34ccd1f..a0e1eb271 100644 --- a/mach/z80/cg/mach.h +++ b/mach/z80/cg/mach.h @@ -2,9 +2,8 @@ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands. * See the copyright notice in the ACK home directory, in the file "Copyright". */ -#ifndef NORCSID -#define RCS_H "$Id$" -#endif +#include "tables.h" +#include "types.h" #define ex_ap(y) fprintf(codefile,".extern %s\n",y) #define in_ap(y) /* nothing */ @@ -33,3 +32,9 @@ #define fmt_id(fs, ft) sprintf(ft, "_%s", fs) #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);