ANSI C conversion

This commit is contained in:
carl 2019-05-11 01:10:12 +08:00
parent e8243402be
commit 04cb629159
2 changed files with 21 additions and 11 deletions

View file

@ -3,8 +3,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".
*/ */
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++;
if (part_size == TEM_WSIZE) if (part_size == TEM_WSIZE)
@ -21,17 +21,16 @@ 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 (sz != 4) if (sz != 4)
fatal("bad icon/ucon size"); fatal("bad icon/ucon size");
fprintf(codefile,".data4 %ld\n", atol(str)); fprintf(codefile,".data4 %ld\n", atol(str));
} }
con_float() { void con_float(void)
{
static int been_here; static int been_here;
if (argval != 4 && argval != 8) if (argval != 4 && argval != 8)
fatal("bad fcon size"); 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"); fprintf(codefile,"\tjsr Pro\n");
if (nlocals == 0) if (nlocals == 0)
return; return;
@ -56,9 +55,9 @@ prolog(nlocals) full nlocals; {
nlocals, nlocals); nlocals, nlocals);
} }
mes(type) word type; { void mes(word type)
{
int argt ; int argt ;
switch ( (int)type ) { switch ( (int)type ) {
case ms_ext : case ms_ext :
for (;;) { for (;;) {

View file

@ -4,6 +4,9 @@
*/ */
/* $Id$ */ /* $Id$ */
#include "tables.h"
#include "types.h"
#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 */
@ -29,3 +32,11 @@
#define fmt_id(ft, fs) sprintf(fs,"_%s",ft) #define fmt_id(ft, fs) sprintf(fs,"_%s",ft)
#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);