From 911ce7ceb517a624625582d5d363bd53f0dadd6e Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 2 Jun 2018 21:31:18 +0200 Subject: [PATCH] Crudely tweak some of the prototypes to please clang, which is pickier about K&R C than gcc is. --- h/con_float | 1 - mach/proto/cg/equiv.c | 72 +++++++++++++++++++++++------------------ mach/proto/ncg/fillem.c | 2 +- 3 files changed, 42 insertions(+), 33 deletions(-) diff --git a/h/con_float b/h/con_float index b2ad2908b..903c2ce5b 100644 --- a/h/con_float +++ b/h/con_float @@ -237,7 +237,6 @@ float_cst(str, sz, buf) #endif /* USE_FLT */ #ifdef CODE_GENERATOR -void con_float() { char buf[8]; diff --git a/mach/proto/cg/equiv.c b/mach/proto/cg/equiv.c index 36ef12f92..77e1c0c0a 100644 --- a/mach/proto/cg/equiv.c +++ b/mach/proto/cg/equiv.c @@ -22,27 +22,32 @@ static char rcsid[] = "$Id$"; extern string myalloc(); int rar[MAXCREG]; -rl_p *lar; +rl_p* lar; int maxindex; int regclass[NREGS]; -struct perm *perms; +struct perm* perms; -struct perm * -tuples(regls,nregneeded) rl_p *regls; { - int class=0; - register i,j; +void permute(int index); + +struct perm* tuples(rl_p* regls, int nregneeded) +{ + int class = 0; + register i, j; /* * First compute equivalence classes of registers. */ - for (i=0;ip_next) { - for (i=0; ip_next) + { + for (i = 0; i < maxindex; i++) if (regclass[rar[i]] != regclass[pp->p_rar[i]]) goto diff; - for (i=0; ip_rar[i],pp->p_rar[j])) + for (i = 0; i < maxindex; i++) + for (j = 0; j < i; j++) + if (clash(rar[i], rar[j]) != clash(pp->p_rar[i], pp->p_rar[j])) goto diff; return; - diff: ; + diff:; } - pp = (struct perm *) myalloc(sizeof ( *pp )); + pp = (struct perm*)myalloc(sizeof(*pp)); pp->p_next = perms; - for (i=0; ip_rar[i] = rar[i]; perms = pp; - } else { - rlp=lar[index]; - for (i=rlp->rl_n-1; i>=0; i--) { + } + else + { + rlp = lar[index]; + for (i = rlp->rl_n - 1; i >= 0; i--) + { rar[index] = rlp->rl_list[i]; - permute(index+1); + permute(index + 1); } } } diff --git a/mach/proto/ncg/fillem.c b/mach/proto/ncg/fillem.c index 07e6c9331..7f479337e 100644 --- a/mach/proto/ncg/fillem.c +++ b/mach/proto/ncg/fillem.c @@ -83,7 +83,7 @@ extern short em_ptyp[]; /* machine dependent */ void con_part(int, word); void con_mult(word); -void con_float(void); +int con_float(void); /* actually returns void, but need K&R C compatibility */ void prolog(full nlocals); void mes(word);