ANSI C conversion

This commit is contained in:
carl 2019-05-11 01:11:03 +08:00
parent 628dcb3cbf
commit cefebdb5db
2 changed files with 21 additions and 23 deletions

View file

@ -16,9 +16,7 @@ static char rcsid[] = "$Id$";
/* /*
* Byte order: | 3 | 2 | 1 | 0 | * Byte order: | 3 | 2 | 1 | 0 |
*/ */
con_part(sz, w) void con_part(register int sz, word w)
register int sz;
word w;
{ {
/* /*
* Align new bytes on boundary of its on size. * Align new bytes on boundary of its on size.
@ -39,8 +37,7 @@ con_part(sz, w)
part_size += sz; part_size += sz;
} }
con_mult(sz) void con_mult(word sz)
word sz;
{ {
if (sz != 4) if (sz != 4)
fatal("bad icon/ucon size"); fatal("bad icon/ucon size");
@ -50,8 +47,7 @@ con_mult(sz)
#ifdef MACH_OPTIONS #ifdef MACH_OPTIONS
static int gdb_flag = 0; static int gdb_flag = 0;
mach_option(s) void mach_option(char *s)
char *s;
{ {
if (! strcmp(s, "-gdb")) { if (! strcmp(s, "-gdb")) {
gdb_flag = 1; gdb_flag = 1;
@ -62,12 +58,11 @@ mach_option(s)
} }
#endif /* MACH_OPTIONS */ #endif /* MACH_OPTIONS */
mes(mesno) void mes(word type)
word mesno;
{ {
int argt, a1, a2 ; int argt, a1, a2 ;
switch ( (int)mesno ) { switch ( (int)type ) {
case ms_ext : case ms_ext :
for (;;) { for (;;) {
switch ( argt=getarg( switch ( argt=getarg(
@ -137,8 +132,7 @@ mes(mesno)
#include <con_float> #include <con_float>
#ifndef REGVARS #ifndef REGVARS
prolog(nlocals) void prolog(full nlocals)
full nlocals;
{ {
fprintf(codefile,".data2 00\n"); fprintf(codefile,".data2 00\n");
if (nlocals == 0) if (nlocals == 0)
@ -170,7 +164,7 @@ static full nlocals; /* Number of local variables. */
/* /*
* Save number of locals. * Save number of locals.
*/ */
prolog(n) void prolog(full n)
{ {
nlocals = n; nlocals = n;
} }
@ -187,7 +181,7 @@ static struct s_reg {
/* /*
* Initialize saving of registers. * Initialize saving of registers.
*/ */
i_regsave() void i_regsave(void)
{ {
p_reg = a_reg; p_reg = a_reg;
} }
@ -196,10 +190,7 @@ i_regsave()
* Called for each register to be saved. * Called for each register to be saved.
* Save the parameters in the struct. * Save the parameters in the struct.
*/ */
regsave(str, off, size) void regsave(char *str, long off, int size)
char *str;
long off;
int size;
{ {
p_reg->sr_str = str; p_reg->sr_str = str;
p_reg->sr_off = off; p_reg->sr_off = off;
@ -213,7 +204,7 @@ regsave(str, off, size)
/* /*
* Generate code to save the registers. * Generate code to save the registers.
*/ */
f_regsave() void f_regsave(void)
{ {
register struct s_reg *p; register struct s_reg *p;
register int mask; register int mask;
@ -267,9 +258,7 @@ f_regsave()
regreturn() { } regreturn() { }
regscore(off, size, typ, score, totyp) int regscore(long off, int size, int typ, int score, int totyp)
long off;
int size, typ, totyp, score;
{ {
register int i = score; register int i = score;

View file

@ -2,7 +2,10 @@
* (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".
*/ */
/* $Id$ */
#include "tables.h"
#include "types.h"
#define ex_ap(x) fprintf(codefile,".extern\t%s\n",x) #define ex_ap(x) fprintf(codefile,".extern\t%s\n",x)
#define in_ap(x) /* nothing */ #define in_ap(x) /* nothing */
@ -30,3 +33,9 @@
#define MACH_OPTIONS #define MACH_OPTIONS
#define modhead ".sect .text\n.sect .rom\n.sect .data\n.sect .bss\n" #define modhead ".sect .text\n.sect .rom\n.sect .data\n.sect .bss\n"
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);