ANSI C conversion

This commit is contained in:
carl 2019-05-11 01:11:17 +08:00
parent cefebdb5db
commit e6ba8034f0
2 changed files with 19 additions and 17 deletions

View file

@ -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) * 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) while (part_size % sz)
part_size++; part_size++;
@ -31,15 +28,15 @@ con_part(sz,w) register sz; word w; {
part_size += sz; part_size += sz;
} }
con_mult(sz) word sz; { void con_mult(word sz)
long atol(); {
if (argval != 4) if (argval != 4)
fatal("bad icon/ucon size"); fatal("bad icon/ucon size");
fprintf(codefile, ".data4\t%ld\n", atol(str)); fprintf(codefile, ".data4\t%ld\n", atol(str));
} }
con_float() { void con_float(void)
{
static int been_here; static int been_here;
int sz = argval; int sz = argval;
@ -56,9 +53,8 @@ con_float() {
} }
} }
void prolog(full nlocals)
prolog(nlocals) full nlocals; { {
fprintf(codefile,"\tpush\tiy\n\tld\thl,0\n\tadd\thl,sp\n\tpush\thl\n\tpop\tiy\n"); fprintf(codefile,"\tpush\tiy\n\tld\thl,0\n\tadd\thl,sp\n\tpush\thl\n\tpop\tiy\n");
switch (nlocals) { switch (nlocals) {
case 8: fprintf(codefile,"\tpush\thl\n"); 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 ; int argt ;
switch ( (int)type ) { switch ( (int)type ) {

View file

@ -2,9 +2,8 @@
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright". * See the copyright notice in the ACK home directory, in the file "Copyright".
*/ */
#ifndef NORCSID #include "tables.h"
#define RCS_H "$Id$" #include "types.h"
#endif
#define ex_ap(y) fprintf(codefile,".extern %s\n",y) #define ex_ap(y) fprintf(codefile,".extern %s\n",y)
#define in_ap(y) /* nothing */ #define in_ap(y) /* nothing */
@ -33,3 +32,9 @@
#define fmt_id(fs, ft) sprintf(ft, "_%s", fs) #define fmt_id(fs, ft) sprintf(ft, "_%s", fs)
#define BSS_INIT 0 #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);