shithub: mc

Download patch

ref: 95f4d0b36eb2d25889eed6ab48fb025d5b346b67
parent: 25d91f98a97df36e1da381b273219ceedf256a4d
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Jul 9 06:18:26 EDT 2017

Style(9)-ify.

--- a/6/blob.c
+++ b/6/blob.c
@@ -18,7 +18,8 @@
 
 static size_t blobrec(Blob *b, Htab *globls, Htab *strtab, Node *n);
 
-Blob *mkblobi(Blobtype type, uint64_t ival)
+Blob *
+mkblobi(Blobtype type, uint64_t ival)
 {
 	Blob *b;
 
@@ -28,7 +29,8 @@
 	return b;
 }
 
-Blob *mkblobpad(size_t sz)
+Blob *
+mkblobpad(size_t sz)
 {
 	Blob *b;
 
@@ -38,7 +40,8 @@
 	return b;
 }
 
-Blob *mkblobbytes(char *buf, size_t len)
+Blob *
+mkblobbytes(char *buf, size_t len)
 {
 	Blob *b;
 
@@ -49,7 +52,8 @@
 	return b;
 }
 
-Blob *mkblobseq(Blob **sub, size_t nsub)
+Blob *
+mkblobseq(Blob **sub, size_t nsub)
 {
 	Blob *b;
 
@@ -60,7 +64,8 @@
 	return b;
 }
 
-Blob *mkblobref(char *lbl, size_t off, int isextern)
+Blob *
+mkblobref(char *lbl, size_t off, int isextern)
 {
 	Blob *b;
 
@@ -72,7 +77,8 @@
 	return b;
 }
 
-void blobfree(Blob *b)
+void
+blobfree(Blob *b)
 {
 	size_t i;
 
@@ -93,7 +99,8 @@
 	free(b);
 }
 
-static size_t getintlit(Node *n, char *failmsg)
+static size_t
+getintlit(Node *n, char *failmsg)
 {
 	if (exprop(n) != Olit)
 		fatal(n, "%s", failmsg);
@@ -103,12 +110,14 @@
 	return n->lit.intval;
 }
 
-void b(Blob *b, Blob *n)
+void
+b(Blob *b, Blob *n)
 {
 	lappend(&b->seq.sub, &b->seq.nsub, n);
 }
 
-static size_t blobpad(Blob *seq, size_t sz)
+static size_t
+blobpad(Blob *seq, size_t sz)
 {
 	if (sz)
 		b(seq, mkblobpad(sz));
@@ -115,7 +124,8 @@
 	return sz;
 }
 
-static size_t bloblit(Blob *seq, Htab *strtab, Node *v, Type *ty)
+static size_t
+bloblit(Blob *seq, Htab *strtab, Node *v, Type *ty)
 {
 	char buf[128];
 	char *lbl;
@@ -172,7 +182,8 @@
 	return sz;
 }
 
-static size_t blobslice(Blob *seq,  Htab *globls, Htab *strtab, Node *n)
+static size_t
+blobslice(Blob *seq,  Htab *globls, Htab *strtab, Node *n)
 {
 	Node *base, *lo, *hi;
 	ssize_t loval, hival, sz;
@@ -183,7 +194,7 @@
 	lo = n->expr.args[1];
 	hi = n->expr.args[2];
 
-	/* by this point, all slicing operations should have had their bases
+	/* by this point, all slicing operations should have had their base
 	 * pulled out, and we should have vars with their pseudo-decls in their
 	 * place */
 	loval = getintlit(lo, "lower bound in slice is not constant literal");
@@ -203,7 +214,8 @@
 	return 16;
 }
 
-static Node *structmemb(Node *n, char *dcl)
+static Node *
+structmemb(Node *n, char *dcl)
 {
 	size_t i;
 
@@ -213,7 +225,8 @@
 	return NULL;
 }
 
-static size_t blobstruct(Blob *seq, Htab *globls, Htab *strtab, Node *n)
+static size_t
+blobstruct(Blob *seq, Htab *globls, Htab *strtab, Node *n)
 {
 	size_t i, sz, pad, end, ndcl;
 	Node **dcl, *m;
@@ -239,7 +252,8 @@
 	return sz;
 }
 
-static size_t blobucon(Blob *seq, Htab *globls, Htab *strtab, Node *n)
+static size_t
+blobucon(Blob *seq, Htab *globls, Htab *strtab, Node *n)
 {
 	size_t sz, pad;
 	Ucon *uc;
@@ -257,7 +271,8 @@
 }
 
 
-static size_t blobrec(Blob *b, Htab *globls, Htab *strtab, Node *n)
+static size_t
+blobrec(Blob *b, Htab *globls, Htab *strtab, Node *n)
 {
 	size_t i, sz, end;
 
@@ -289,7 +304,8 @@
 	return sz;
 }
 
-Blob *litblob(Htab *globls, Htab *strtab, Node *n)
+Blob *
+litblob(Htab *globls, Htab *strtab, Node *n)
 {
 	Blob *b;
 
--- a/6/gen.c
+++ b/6/gen.c
@@ -16,7 +16,8 @@
 #include "asm.h"
 #include "../config.h"
 
-void fillglobls(Stab *st, Htab *globls)
+void
+fillglobls(Stab *st, Htab *globls)
 {
 	size_t i, j, nk, nns;
 	void **k, **ns;
@@ -46,7 +47,8 @@
 }
 
 
-void initconsts(Htab *globls)
+void
+initconsts(Htab *globls)
 {
 	Type *ty;
 	Node *name;
@@ -70,7 +72,8 @@
 	abortoob->expr.isconst = 1;
 }
 
-Type *codetype(Type *ft)
+Type *
+codetype(Type *ft)
 {
 	ft = tybase(ft);
 	if (ft->type == Tycode)
@@ -81,7 +84,8 @@
 	return ft;
 }
 
-Type *closuretype(Type *ft)
+Type *
+closuretype(Type *ft)
 {
 	ft = tybase(ft);
 	if (ft->type == Tyfunc)
@@ -92,7 +96,8 @@
 	return ft;
 }
 
-static int islocal(Node *dcl)
+static int
+islocal(Node *dcl)
 {
 	if (dcl->decl.vis != Visintern)
 		return 0;
@@ -101,7 +106,8 @@
 	return 1;
 }
 
-char *genlocallblstr(char *buf, size_t sz)
+char *
+genlocallblstr(char *buf, size_t sz)
 {
 	if (asmsyntax == Plan9)
 		return genlblstr(buf, 128, "<>");
@@ -109,7 +115,7 @@
 		return genlblstr(buf, 128, "");
 }
 
-/* 
+/*
  * For x86, the assembly names are generated as follows:
  *      local symbols: .name
  *      un-namespaced symbols: <symprefix>name
@@ -116,7 +122,8 @@
  *      namespaced symbols: <symprefix>namespace$name
  *      local symbols on plan9 have the file-unique suffix '<>' appended
  */
-char *asmname(Node *dcl)
+char *
+asmname(Node *dcl)
 {
 	char buf[1024];
 	char *vis, *pf, *ns, *name, *sep;
@@ -142,7 +149,8 @@
 	return strdup(buf);
 }
 
-char *tydescid(char *buf, size_t bufsz, Type *ty)
+char *
+tydescid(char *buf, size_t bufsz, Type *ty)
 {
 	char *sep, *ns;
 	char *p, *end;
@@ -174,7 +182,8 @@
 	return buf;
 }
 
-void gen(Node *file, char *out)
+void
+gen(Node *file, char *out)
 {
 	FILE *fd;
 
--- a/6/gengas.c
+++ b/6/gengas.c
@@ -18,19 +18,19 @@
 
 #define Tdindirect 0x80
 
-static char *insnfmt[] = {
+static char * insnfmt[] = {
 #define Insn(val, gasfmt, p9fmt, use, def) gasfmt,
 #include "insns.def"
 #undef Insn
 };
 
-static char *regnames[] = {
+static char * regnames[] = {
 #define Reg(r, gasname, p9name, mode) gasname,
 #include "regs.def"
 #undef Reg
 };
 
-static char* modenames[] = {
+static char *modenames[] = {
 	[ModeB] = "b",
 	[ModeW] = "w",
 	[ModeL] = "l",
@@ -41,7 +41,8 @@
 
 static void locprint(FILE *fd, Loc *l, char spec);
 
-void printmem(FILE *fd, Loc *l, char spec)
+void
+printmem(FILE *fd, Loc *l, char spec)
 {
 	if (l->type == Locmem) {
 		if (l->mem.constdisp)
@@ -66,7 +67,8 @@
 	}
 }
 
-static void locprint(FILE *fd, Loc *l, char spec)
+static void
+locprint(FILE *fd, Loc *l, char spec)
 {
 	assert(l->mode);
 	switch (l->type) {
@@ -79,7 +81,7 @@
 		fprintf(fd, "%s", l->lbl);
 		break;
 	case Locreg:
-		assert((spec == 'r' && isintmode(l->mode)) || 
+		assert((spec == 'r' && isintmode(l->mode)) ||
 				(spec == 'f' && isfloatmode(l->mode)) ||
 				spec == 'v' ||
 				spec == 'x' ||
@@ -104,18 +106,20 @@
 	}
 }
 
-static int issubreg(Loc *a, Loc *b)
+static int
+issubreg(Loc *a, Loc *b)
 {
 	return rclass(a) == rclass(b) && a->mode != b->mode;
 }
 
-void iprintf(FILE *fd, Insn *insn)
+void
+iprintf(FILE *fd, Insn *insn)
 {
 	char *p;
 	int i;
 	int idx;
 
-	/* x64 has a quirk; it has no movzlq because mov zero extends. This
+	/* x64 has a quirk; it has no movzlq because mov zero extends. Thi
 	 * means that we need to do a movl when we really want a movzlq. Since
 	 * we don't know the name of the reg to use, we need to sub it in when
 	 * writing... */
@@ -166,7 +170,8 @@
 		/* %-formating */
 		p++;
 		idx = i;
-again:
+again
+:
 		switch (*p) {
 		case '\0':
 			goto done; /* skip the final p++ */
@@ -193,12 +198,14 @@
 			break;
 		}
 	}
-done:
+done
+:
 	return;
 }
 
 
-static void writebytes(FILE *fd, char *p, size_t sz)
+static void
+writebytes(FILE *fd, char *p, size_t sz)
 {
 	size_t i;
 
@@ -217,7 +224,8 @@
 	}
 }
 
-void genstrings(FILE *fd, Htab *strtab)
+void
+genstrings(FILE *fd, Htab *strtab)
 {
 	void **k;
 	Str *s;
@@ -231,7 +239,8 @@
 	}
 }
 
-static void writeasm(FILE *fd, Isel *s, Func *fn)
+static void
+writeasm(FILE *fd, Isel *s, Func *fn)
 {
 	size_t i, j;
 
@@ -248,7 +257,8 @@
 	}
 }
 
-static void encodemin(FILE *fd, uvlong val)
+static void
+encodemin(FILE *fd, uvlong val)
 {
 	size_t i, shift;
 	uint8_t b;
@@ -272,7 +282,8 @@
 	}
 }
 
-static void emitonce(FILE *fd, Blob *b)
+static void
+emitonce(FILE *fd, Blob *b)
 {
 	if (asmsyntax == Gnugaself) {
 		fprintf(fd, ".section .text.%s%s,\"aG\",%s%s,comdat\n",
@@ -285,7 +296,8 @@
 	}
 }
 
-static void writeblob(FILE *fd, Blob *b)
+static void
+writeblob(FILE *fd, Blob *b)
 {
 	size_t i;
 
@@ -319,7 +331,8 @@
 /* genfunc requires all nodes in 'nl' to map cleanly to operations that are
  * natively supported, as promised in the output of reduce().  No 64-bit
  * operations on x32, no structures, and so on. */
-static void genfunc(FILE *fd, Func *fn, Htab *globls, Htab *strtab)
+static void
+genfunc(FILE *fd, Func *fn, Htab *globls, Htab *strtab)
 {
 	Isel is = {0,};
 	char cwd[1024];
@@ -344,7 +357,8 @@
 	writeasm(fd, &is, fn);
 }
 
-static void gentype(FILE *fd, Type *ty)
+static void
+gentype(FILE *fd, Type *ty)
 {
 	Blob *b;
 
@@ -360,7 +374,8 @@
 	blobfree(b);
 }
 
-static void gentypes(FILE *fd)
+static void
+gentypes(FILE *fd)
 {
 	Type *ty;
 	size_t i;
@@ -377,7 +392,8 @@
 }
 
 
-void genblob(FILE *fd, Node *blob, Htab *globls, Htab *strtab)
+void
+genblob(FILE *fd, Node *blob, Htab *globls, Htab *strtab)
 {
 	char *lbl;
 	Blob *b;
@@ -400,7 +416,8 @@
 	}
 }
 
-void gengas(Node *file, FILE *fd)
+void
+gengas(Node *file, FILE *fd)
 {
 	Htab *globls, *strtab;
 	Node *n, **blob;
@@ -429,7 +446,7 @@
 	for (i = 0; i < file->file.nstmts; i++) {
 		n = file->file.stmts[i];
 		switch (n->type) {
-		case Nuse: /* nothing to do */ 
+		case Nuse: /* nothing to do */
 		case Nimpl:
 			break;
 		case Ndecl:
@@ -467,12 +484,14 @@
 	fclose(fd);
 }
 
-void dbglocprint(FILE *fd, Loc *l, char spec)
+void
+dbglocprint(FILE *fd, Loc *l, char spec)
 {
 	locprint(fd, l, spec);
 }
 
-void dbgiprintf(FILE *fd, Insn *i)
+void
+dbgiprintf(FILE *fd, Insn *i)
 {
 	iprintf(fd, i);
 }
--- a/6/genp9.c
+++ b/6/genp9.c
@@ -29,7 +29,7 @@
 #undef Reg
 };
 
-static char* modenames[] = {
+static char *modenames[] = {
 	[ModeB] = "B",
 	[ModeW] = "W",
 	[ModeL] = "L",
@@ -38,9 +38,11 @@
 	[ModeD] = "D"
 };
 
-static void locprint(FILE *fd, Loc *l, char spec);
+static void
+locprint(FILE *fd, Loc *l, char spec);
 
-static void printmem(FILE *fd, Loc *l, char spec)
+static void
+printmem(FILE *fd, Loc *l, char spec)
 {
 	if (l->type == Locmem) {
 		if (l->mem.constdisp)
@@ -63,7 +65,8 @@
 	}
 }
 
-static void locprint(FILE *fd, Loc *l, char spec)
+static void
+locprint(FILE *fd, Loc *l, char spec)
 {
 	spec = tolower(spec);
 	assert(l->mode);
@@ -77,7 +80,7 @@
 		fprintf(fd, "%s", l->lbl);
 		break;
 	case Locreg:
-		assert((spec == 'r' && isintmode(l->mode)) || 
+		assert((spec == 'r' && isintmode(l->mode)) ||
 				(spec == 'f' && isfloatmode(l->mode)) ||
 				spec == 'v' ||
 				spec == 'x' ||
@@ -102,18 +105,20 @@
 	}
 }
 
-static int issubreg(Loc *a, Loc *b)
+static int
+issubreg(Loc *a, Loc *b)
 {
 	return rclass(a) == rclass(b) && a->mode != b->mode;
 }
 
-static void iprintf(FILE *fd, Insn *insn)
+static void
+iprintf(FILE *fd, Insn *insn)
 {
 	char *p;
 	int i;
 	int idx;
 
-	/* x64 has a quirk; it has no movzlq because mov zero extends. This
+	/* x64 has a quirk; it has no movzlq because mov zero extends. Thi
 	 * means that we need to do a movl when we really want a movzlq. Since
 	 * we don't know the name of the reg to use, we need to sub it in when
 	 * writing... */
@@ -161,7 +166,8 @@
 		/* %-formating */
 		p++;
 		idx = i;
-again:
+again
+:
 		switch (*p) {
 		case '\0':
 			goto done; /* skip the final p++ */
@@ -189,12 +195,14 @@
 			break;
 		}
 	}
-done:
+done
+:
 	return;
 }
 
 
-static size_t writebytes(FILE *fd, char *name, size_t off, char *p, size_t sz)
+static size_t
+writebytes(FILE *fd, char *name, size_t off, char *p, size_t sz)
 {
 	size_t i, len;
 
@@ -217,7 +225,8 @@
 	return sz;
 }
 
-static void genstrings(FILE *fd, Htab *strtab)
+static void
+genstrings(FILE *fd, Htab *strtab)
 {
 	void **k;
 	char *lbl;
@@ -235,7 +244,8 @@
 	}
 }
 
-static void writeasm(FILE *fd, Isel *s, Func *fn)
+static void
+writeasm(FILE *fd, Isel *s, Func *fn)
 {
 	size_t i, j;
 	char *hidden;
@@ -243,7 +253,7 @@
 	hidden = "";
 	if (fn->isexport)
 		hidden = "";
-	/* we don't use the stack size directive: myrddin handles
+	/* we don't use the stack size directive: myrddin handle
 	 * the stack frobbing on its own */
 	fprintf(fd, "TEXT %s%s+0(SB),2,$0\n", fn->name, hidden);
 	for (j = 0; j < s->cfg->nbb; j++) {
@@ -256,7 +266,8 @@
 	}
 }
 
-static size_t encodemin(FILE *fd, uvlong val, size_t off, char *lbl)
+static size_t
+encodemin(FILE *fd, uvlong val, size_t off, char *lbl)
 {
 	size_t i, shift, n;
 	uint8_t b;
@@ -284,7 +295,8 @@
 	return i;
 }
 
-static size_t writeblob(FILE *fd, Blob *b, size_t off, char *lbl)
+static size_t
+writeblob(FILE *fd, Blob *b, size_t off, char *lbl)
 {
 	size_t i, n;
 
@@ -339,7 +351,8 @@
 /* genfunc requires all nodes in 'nl' to map cleanly to operations that are
  * natively supported, as promised in the output of reduce().  No 64-bit
  * operations on x32, no structures, and so on. */
-static void genfunc(FILE *fd, Func *fn, Htab *globls, Htab *strtab)
+static void
+genfunc(FILE *fd, Func *fn, Htab *globls, Htab *strtab)
 {
 	Isel is = {0,};
 
@@ -359,7 +372,8 @@
 	writeasm(fd, &is, fn);
 }
 
-static void gentype(FILE *fd, Type *ty)
+static void
+gentype(FILE *fd, Type *ty)
 {
 	Blob *b;
 	char lbl[1024];
@@ -382,7 +396,8 @@
 	writeblob(fd, b, 0, lbl);
 }
 
-static void gentypes(FILE *fd)
+static void
+gentypes(FILE *fd)
 {
 	Type *ty;
 	size_t i;
@@ -399,7 +414,8 @@
 }
 
 
-static void genblob(FILE *fd, Node *blob, Htab *globls, Htab *strtab)
+static void
+genblob(FILE *fd, Node *blob, Htab *globls, Htab *strtab)
 {
 	char *lbl;
 	Blob *b;
@@ -416,7 +432,8 @@
 	writeblob(fd, b, 0, lbl);
 }
 
-void genp9(Node *file, FILE *fd)
+void
+genp9(Node *file, FILE *fd)
 {
 	Htab *globls, *strtab;
 	Node *n, **blob;
@@ -444,7 +461,7 @@
 	for (i = 0; i < file->file.nstmts; i++) {
 		n = file->file.stmts[i];
 		switch (n->type) {
-		case Nuse: /* nothing to do */ 
+		case Nuse: /* nothing to do */
 		case Nimpl:
 			break;
 		case Ndecl:
--- a/6/isel.c
+++ b/6/isel.c
@@ -59,10 +59,11 @@
 	[Ofle] = {Icomis, Ijbe, Isetbe},
 };
 
-static Mode tymode(Type *t)
+static Mode
+tymode(Type *t)
 {
 	/* FIXME: What should the mode for, say, structs be when we have no
-	 * intention of loading /through/ the pointer? For now, we'll just say it's
+	 * intention of loading /through/ the pointer? For now, we'll just say it'
 	 * the pointer mode, since we expect to address through the pointer */
 	t = tybase(t);
 	switch (t->type) {
@@ -82,7 +83,8 @@
 	return ModeNone;
 }
 
-static Mode mode(Node *n)
+static Mode
+mode(Node *n)
 {
 	if (n->type == Nexpr)
 		return tymode(exprtype(n));
@@ -93,7 +95,8 @@
 	return ModeNone;
 }
 
-static Loc *varloc(Isel *s, Node *n)
+static Loc *
+varloc(Isel *s, Node *n)
 {
 	ssize_t off;
 	Loc *l, *rip;
@@ -121,7 +124,8 @@
 	return l;
 }
 
-static Loc *loc(Isel *s, Node *n)
+static Loc *
+loc(Isel *s, Node *n)
 {
 	Node *v;
 	Loc *l;
@@ -131,7 +135,7 @@
 	} else {
 		switch (exprop(n)) {
 		case Ovar:
-			l = varloc(s, n); 
+			l = varloc(s, n);
 			break;
 		case Olit:
 			v = n->expr.args[0];
@@ -152,7 +156,8 @@
 	return l;
 }
 
-static Insn *mkinsnv(AsmOp op, va_list ap)
+static Insn *
+mkinsnv(AsmOp op, va_list ap)
 {
 	Loc *l;
 	Insn *i;
@@ -169,7 +174,8 @@
 	return i;
 }
 
-Insn *mkinsn(int op, ...)
+Insn *
+mkinsn(int op, ...)
 {
 	va_list ap;
 	Insn *i;
@@ -180,7 +186,8 @@
 	return i;
 }
 
-static void g(Isel *s, int op, ...)
+static void
+g(Isel *s, int op, ...)
 {
 	va_list ap;
 	Insn *i;
@@ -195,7 +202,8 @@
 	lappend(&s->curbb->il, &s->curbb->ni, i);
 }
 
-static void movz(Isel *s, Loc *src, Loc *dst)
+static void
+movz(Isel *s, Loc *src, Loc *dst)
 {
 	if (src->mode == dst->mode)
 		g(s, Imov, src, dst, NULL);
@@ -203,7 +211,8 @@
 		g(s, Imovzx, src, dst, NULL);
 }
 
-static void load(Isel *s, Loc *a, Loc *b)
+static void
+load(Isel *s, Loc *a, Loc *b)
 {
 	Loc *l;
 
@@ -218,7 +227,8 @@
 		g(s, Imov, l, b, NULL);
 }
 
-static void stor(Isel *s, Loc *a, Loc *b)
+static void
+stor(Isel *s, Loc *a, Loc *b)
 {
 	Loc *l;
 
@@ -234,7 +244,8 @@
 }
 
 /* ensures that a location is within a reg */
-static Loc *newr(Isel *s, Loc *a)
+static Loc *
+newr(Isel *s, Loc *a)
 {
 	Loc *r;
 
@@ -250,7 +261,8 @@
 	return r;
 }
 
-static Loc *inr(Isel *s, Loc *a)
+static Loc *
+inr(Isel *s, Loc *a)
 {
 	if (a->type == Locreg)
 		return a;
@@ -258,7 +270,8 @@
 }
 
 /* ensures that a location is within a reg or an imm */
-static Loc *inri(Isel *s, Loc *a)
+static Loc *
+inri(Isel *s, Loc *a)
 {
 	if (a->type == Locreg || a->type == Loclit)
 		return a;
@@ -275,7 +288,8 @@
  * multiple tests, we want to eval the children
  * of the first arg, instead of the first arg
  * directly */
-static void selcjmp(Isel *s, Node *n, Node **args)
+static void
+selcjmp(Isel *s, Node *n, Node **args)
 {
 	Loc *a, *b;
 	Loc *l1, *l2;
@@ -308,7 +322,7 @@
 	g(s, Ijmp, l2, NULL);
 }
 
-/* Generate variable length jump. There are 3 cases
+/* Generate variable length jump. There are 3 case
  * for this:
  *
  * 1) Short list: Simple comparison sequence.
@@ -318,11 +332,13 @@
  * If a value is not in the jump table, then the 0th
  * value is used.
  */
-static void selvjmp(Isel *s, Node *n, Node **args)
+static void
+selvjmp(Isel *s, Node *n, Node **args)
 {
 }
 
-static Loc *binop(Isel *s, AsmOp op, Node *x, Node *y)
+static Loc *
+binop(Isel *s, AsmOp op, Node *x, Node *y)
 {
 	Loc *a, *b;
 
@@ -346,7 +362,8 @@
  *        Omul(reg,
  *             2 || 4 || 8)))
  */
-static int ismergablemul(Node *n, int *r)
+static int
+ismergablemul(Node *n, int *r)
 {
 	int v;
 
@@ -365,7 +382,8 @@
 	return 1;
 }
 
-static Loc *memloc(Isel *s, Node *e, Mode m)
+static Loc *
+memloc(Isel *s, Node *e, Mode m)
 {
 	Node **args;
 	Loc *l, *b, *o; /* location, base, offset */
@@ -399,13 +417,15 @@
 	return l;
 }
 
-static const Mode szmodes[] = {
+static const
+Mode szmodes[] = {
 	[8] = ModeQ,
 	[4] = ModeL,
 	[2] = ModeW,
 	[1] = ModeB
 };
-static void blit(Isel *s, Loc *to, Loc *from, size_t dstoff, size_t srcoff, size_t sz, size_t align)
+static void
+blit(Isel *s, Loc *to, Loc *from, size_t dstoff, size_t srcoff, size_t sz, size_t align)
 {
 	size_t i, modesz;
 	Loc *sp, *dp; /* pointers to src, dst */
@@ -433,7 +453,8 @@
 
 }
 
-static void clear(Isel *s, Loc *val, size_t sz, size_t align)
+static void
+clear(Isel *s, Loc *val, size_t sz, size_t align)
 {
 	Loc *dp, *zero, *dst; /* source memory, dst memory */
 	size_t modesz, i;
@@ -453,7 +474,8 @@
 	}
 }
 
-static void call(Isel *s, Node *n)
+static void
+call(Isel *s, Node *n)
 {
 	AsmOp op;
 	Node *fn;
@@ -473,7 +495,8 @@
 	g(s, op, f, NULL);
 }
 
-static size_t countargs(Type *t)
+static size_t
+countargs(Type *t)
 {
 	size_t nargs;
 
@@ -488,7 +511,8 @@
 	return nargs;
 }
 
-static Loc *gencall(Isel *s, Node *n)
+static Loc *
+gencall(Isel *s, Node *n)
 {
 	Loc *src, *dst, *arg;	/* values we reduced */
 	size_t argsz, argoff, nargs, vasplit;
@@ -584,7 +608,8 @@
 	return ret;
 }
 
-Loc *selexpr(Isel *s, Node *n)
+Loc *
+selexpr(Isel *s, Node *n)
 {
 	Loc *a, *b, *c, *d, *r;
 	Loc *edx, *cl; /* x86 wants some hard-coded regs */
@@ -768,7 +793,7 @@
 	case Ocallind:
 			 r = gencall(s, n);
 			 break;
-	case Oret: 
+	case Oret:
 			 a = locstrlbl(s->cfg->end->lbls[0]);
 			 g(s, Ijmp, a, NULL);
 			 break;
@@ -858,7 +883,7 @@
 	case Opostdec: case Olor: case Oland: case Oaddeq:
 	case Osubeq: case Omuleq: case Odiveq: case Omodeq: case Oboreq:
 	case Obandeq: case Obxoreq: case Obsleq: case Obsreq: case Omemb:
-	case Oslbase: case Osllen: case Ocast: case Outag: case Oudata: 
+	case Oslbase: case Osllen: case Ocast: case Outag: case Oudata:
 	case Oucon: case Otup: case Oarr: case Ostruct:
 	case Oslice: case Oidx: case Osize: case Otupget:
 	case Obreak: case Ocontinue:
@@ -870,7 +895,8 @@
 	return r;
 }
 
-static void isel(Isel *s, Node *n)
+static void
+isel(Isel *s, Node *n)
 {
 	switch (n->type) {
 	case Nexpr:
@@ -885,12 +911,14 @@
 }
 
 /* %rax is for int returns, %xmm0d is for floating returns */
-Reg savedregs[] = {
+Reg
+savedregs[] = {
 	Rr12, Rr13, Rr14, Rr15,
 	Rnone
 };
 
-void addarglocs(Isel *s, Func *fn)
+void
+addarglocs(Isel *s, Func *fn)
 {
 	size_t i, nints, nfloats, nargs;
 	size_t argoff;
@@ -904,7 +932,7 @@
 	vararg = 0;
 	nargs = countargs(fn->type);
 	for (i = 0; i < fn->nargs; i++) {
-		arg = fn->args[i]; 
+		arg = fn->args[i];
 		argoff = alignto(argoff, decltype(arg));
 		if (i >= nargs)
 			vararg = 1;
@@ -931,7 +959,8 @@
 	}
 }
 
-static void prologue(Isel *s, Func *fn, size_t sz)
+static void
+prologue(Isel *s, Func *fn, size_t sz)
 {
 	Loc *rsp;
 	Loc *rbp;
@@ -963,7 +992,8 @@
 	s->stksz = stksz; /* need to update if we spill */
 }
 
-static void epilogue(Isel *s)
+static void
+epilogue(Isel *s)
 {
 	Loc *rsp, *rbp;
 	Loc *ret;
@@ -992,7 +1022,8 @@
 	g(s, Iret, NULL);
 }
 
-static Asmbb *mkasmbb(Bb *bb)
+static Asmbb *
+mkasmbb(Bb *bb)
 {
 	Asmbb *as;
 
@@ -1007,7 +1038,8 @@
 	return as;
 }
 
-void selfunc(Isel *is, Func *fn, Htab *globls, Htab *strtab)
+void
+selfunc(Isel *is, Func *fn, Htab *globls, Htab *strtab)
 {
 	int fileid, lastline;
 	Node *n;
--- a/6/locs.c
+++ b/6/locs.c
@@ -22,17 +22,23 @@
 #undef Reg
 };
 
-int isintmode(Mode m)
+Loc **locmap = NULL;
+size_t maxregid = 0;
+
+int
+isintmode(Mode m)
 {
 	return m == ModeB || m == ModeW || m == ModeL || m == ModeQ;
 }
 
-int isfloatmode(Mode m)
+int
+isfloatmode(Mode m)
 {
 	return m == ModeF || m == ModeD;
 }
 
-Loc *locstrlbl(char *lbl)
+Loc *
+locstrlbl(char *lbl)
 {
 	Loc *l;
 
@@ -43,7 +49,8 @@
 	return l;
 }
 
-Loc *loclitl(char *lbl)
+Loc *
+loclitl(char *lbl)
 {
 	Loc *l;
 
@@ -54,7 +61,8 @@
 	return l;
 }
 
-Loc *loclbl(Node *e)
+Loc *
+loclbl(Node *e)
 {
 	Node *lbl;
 	assert(e->type == Nexpr);
@@ -64,15 +72,14 @@
 	return locstrlbl(lbl->lit.lblval);
 }
 
-Loc **locmap = NULL;
-size_t maxregid = 0;
-
-void resetregs()
+void
+resetregs()
 {
 	maxregid = Nreg;
 }
 
-static Loc *locregid(regid id, Mode m)
+static Loc *
+locregid(regid id, Mode m)
 {
 	Loc *l;
 
@@ -85,12 +92,14 @@
 	return l;
 }
 
-Loc *locreg(Mode m)
+Loc *
+locreg(Mode m)
 {
 	return locregid(maxregid++, m);
 }
 
-Loc *locphysreg(Reg r)
+Loc *
+locphysreg(Reg r)
 {
 	static Loc *physregs[Nreg] = {0,};
 
@@ -101,7 +110,8 @@
 	return physregs[r];
 }
 
-Loc *locmem(long disp, Loc *base, Loc *idx, Mode mode)
+Loc *
+locmem(long disp, Loc *base, Loc *idx, Mode mode)
 {
 	Loc *l;
 
@@ -115,7 +125,8 @@
 	return l;
 }
 
-Loc *locmems(long disp, Loc *base, Loc *idx, int scale, Mode mode)
+Loc *
+locmems(long disp, Loc *base, Loc *idx, int scale, Mode mode)
 {
 	Loc *l;
 
@@ -124,7 +135,8 @@
 	return l;
 }
 
-Loc *locmeml(char *disp, Loc *base, Loc *idx, Mode mode)
+Loc *
+locmeml(char *disp, Loc *base, Loc *idx, Mode mode)
 {
 	Loc *l;
 
@@ -138,7 +150,8 @@
 	return l;
 }
 
-Loc *locmemls(char *disp, Loc *base, Loc *idx, int scale, Mode mode)
+Loc *
+locmemls(char *disp, Loc *base, Loc *idx, int scale, Mode mode)
 {
 	Loc *l;
 
@@ -148,7 +161,8 @@
 }
 
 
-Loc *loclit(long val, Mode m)
+Loc *
+loclit(long val, Mode m)
 {
 	Loc *l;
 
@@ -159,7 +173,8 @@
 	return l;
 }
 
-Loc *coreg(Reg r, Mode m)
+Loc *
+coreg(Reg r, Mode m)
 {
 	Reg crtab[][Nmode + 1] = {
 		[Ral]  = {Rnone, Ral,  Rax,  Reax, Rrax},
--- a/6/main.c
+++ b/6/main.c
@@ -32,7 +32,8 @@
 size_t nincpaths;
 Asmsyntax asmsyntax;
 
-static void usage(char *prog)
+static void
+usage(char *prog)
 {
 	printf("%s [-?|-h] [-o outfile] [-d[dbgopts]] inputs\n", prog);
 	printf("\t-?|-h\tPrint this help\n");
@@ -52,7 +53,8 @@
 	printf("\t\tu: log type unifications\n");
 }
 
-static void swapout(char* buf, size_t sz, char* suf) {
+static void
+swapout(char* buf, size_t sz, char* suf) {
 	char* psuffix;
 	psuffix = strrchr(outfile, '.');
 	if (psuffix != NULL)
@@ -61,7 +63,8 @@
 		bprintf(buf, sz, "%s%s", outfile, suf);
 }
 
-static void assemble(char *asmsrc, char *path)
+static void
+assemble(char *asmsrc, char *path)
 {
 	char *asmcmd[] = Asmcmd;
 	char objfile[1024];
@@ -98,7 +101,7 @@
 		if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
 			die("Couldn't run assembler");
 	}
-	/* 
+	/*
 	We don't want to keep the asm source around, but it's useful
 	for deubgging without mapping to line numbers.
 	*/
@@ -106,7 +109,8 @@
 		unlink(asmsrc);
 }
 
-static char *dirname(char *path)
+static char *
+dirname(char *path)
 {
 	char *p;
 
@@ -117,7 +121,8 @@
 		return xstrdup(".");
 }
 
-static char *gentempfile(char *buf, size_t bufsz, char *path, char *suffix)
+static char *
+gentempfile(char *buf, size_t bufsz, char *path, char *suffix)
 {
 	char *tmpdir;
 	char *base;
@@ -136,7 +141,8 @@
 	return buf;
 }
 
-static int hasmain(Node *file)
+static int
+hasmain(Node *file)
 {
 	Node *n, *name;
 
@@ -150,7 +156,8 @@
 	return 1;
 }
 
-static void genuse(char *path)
+static void
+genuse(char *path)
 {
 	FILE *f;
 	char buf[1024];
@@ -174,7 +181,8 @@
 	fclose(f);
 }
 
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
 {
 	char buf[1024];
 	Stab *globls;
--- a/6/peep.c
+++ b/6/peep.c
@@ -16,11 +16,12 @@
 #include "asm.h"
 
 
-/* we sometimes leave dead code generated after 
+/* we sometimes leave dead code generated after
  * a non-conditional jump. This code scans for
- * the non-conditional exit from the BB, and truncates
+ * the non-conditional exit from the BB, and truncate
  * at that point */
-static void deadcode(Isel *s, Asmbb *bb)
+static void
+deadcode(Isel *s, Asmbb *bb)
 {
 	size_t i;
 
@@ -40,8 +41,9 @@
  *      jmp .l1
  *      .l1:
  * TODO: check for jumps over jumps.
- */     
-static void nopjmp(Isel *s, Asmbb *bb, size_t idx)
+ */
+static void
+nopjmp(Isel *s, Asmbb *bb, size_t idx)
 {
 	Insn *jmp;
 	Loc *targ;
@@ -79,7 +81,8 @@
 	}
 }
 
-void peep(Isel *s)
+void
+peep(Isel *s)
 {
 	size_t i;
 
--- a/6/ra.c
+++ b/6/ra.c
@@ -136,7 +136,8 @@
 	[Classflt] = 16,
 };
 
-Rclass rclass(Loc *l)
+Rclass
+rclass(Loc *l)
 {
 	switch (l->mode) {
 	case ModeNone:	return Classbad;
@@ -153,7 +154,8 @@
 }
 
 /* %esp, %ebp are not in the allocatable pool */
-static int isfixreg(Loc *l)
+static int
+isfixreg(Loc *l)
 {
 	if (l->reg.colour == Resp)
 		return 1;
@@ -162,7 +164,8 @@
 	return 0;
 }
 
-static size_t uses(Insn *insn, regid *u)
+static size_t
+uses(Insn *insn, regid *u)
 {
 	size_t i, j;
 	int k;
@@ -169,7 +172,7 @@
 	Loc *m;
 
 	j = 0;
-	/* Add all the registers used and defined. Duplicates
+	/* Add all the registers used and defined. Duplicate
 	 * in this list are fine, since they're being added to
 	 * a set anyways */
 	for (i = 0; i < Maxarg; i++) {
@@ -205,13 +208,14 @@
 	return j;
 }
 
-static size_t defs(Insn *insn, regid *d)
+static size_t
+defs(Insn *insn, regid *d)
 {
 	size_t i, j;
 	int k;
 
 	j = 0;
-	/* Add all the registers dsed and defined. Duplicates
+	/* Add all the registers dsed and defined. Duplicate
 	 * in this list are fine, since they're being added to
 	 * a set anyways */
 	for (i = 0; i < Maxarg; i++) {
@@ -234,7 +238,8 @@
 }
 
 /* The uses and defs for an entire BB. */
-static void udcalc(Asmbb *bb)
+static void
+udcalc(Asmbb *bb)
 {
 	regid   u[Nreg], d[Nreg];
 	size_t nu, nd;
@@ -253,12 +258,14 @@
 	}
 }
 
-static int istrivial(Isel *s, regid r)
+static int
+istrivial(Isel *s, regid r)
 {
 	return s->degree[r] < _K[rclass(locmap[r])];
 }
 
-static void liveness(Isel *s)
+static void
+liveness(Isel *s)
 {
 	Bitset *old;
 	Asmbb **bb;
@@ -301,7 +308,8 @@
 }
 
 /* we're only interested in register->register moves */
-static int ismove(Insn *i)
+static int
+ismove(Insn *i)
 {
 	if (i->op != Imov && i->op != Imovs)
 		return 0;
@@ -308,7 +316,8 @@
 	return i->args[0]->type == Locreg && i->args[1]->type == Locreg;
 }
 
-static int gbhasedge(Isel *s, size_t u, size_t v)
+static int
+gbhasedge(Isel *s, size_t u, size_t v)
 {
 	size_t i;
 	i = (s->nreg * v) + u;
@@ -315,7 +324,8 @@
 	return (s->gbits[i/Sizetbits] & (1ULL <<(i % Sizetbits))) != 0;
 }
 
-static void gbputedge(Isel *s, size_t u, size_t v)
+static void
+gbputedge(Isel *s, size_t u, size_t v)
 {
 	size_t i, j;
 
@@ -326,12 +336,13 @@
 	assert(gbhasedge(s, u, v) && gbhasedge(s, v, u));
 }
 
-static int wlfind(Loc **wl, size_t nwl, regid v, size_t *idx)
+static int
+wlfind(Loc **wl, size_t nwl, regid v, size_t *idx)
 {
 	size_t i;
 
 	for (i = 0; i < nwl; i++) {
-		if (wl[i]->reg.id == v) { 
+		if (wl[i]->reg.id == v) {
 			*idx = i;
 			return 1;
 		}
@@ -345,7 +356,8 @@
  * we should not increment the degree, since that would
  * be double counting.
  */
-static int degreechange(Isel *s, regid u, regid v)
+static int
+degreechange(Isel *s, regid u, regid v)
 {
 	regid phys, virt, r;
 	size_t i;
@@ -369,7 +381,8 @@
 	return 1;
 }
 
-static void alputedge(Isel *s, regid u, regid v)
+static void
+alputedge(Isel *s, regid u, regid v)
 {
 	if (s->ngadj[u] == s->gadjsz[u]) {
 		s->gadjsz[u] = s->gadjsz[u]*2 + 1;
@@ -379,19 +392,22 @@
 	s->ngadj[u]++;
 }
 
-static void wlput(Loc ***wl, size_t *nwl, Loc *l)
+static void
+wlput(Loc ***wl, size_t *nwl, Loc *l)
 {
 	lappend(wl, nwl, l);
 	l->list = wl;
 }
 
-static void wldel(Isel *s, Loc ***wl, size_t *nwl, size_t idx)
+static void
+wldel(Isel *s, Loc ***wl, size_t *nwl, size_t idx)
 {
 	(*wl)[idx]->list = NULL;
 	ldel(wl, nwl, idx);
 }
 
-static void wlputset(Bitset *bs, regid r)
+static void
+wlputset(Bitset *bs, regid r)
 {
 	bsput(bs, r);
 	locmap[r]->list = bs;
@@ -398,7 +414,8 @@
 }
 
 
-static void addedge(Isel *s, regid u, regid v)
+static void
+addedge(Isel *s, regid u, regid v)
 {
 	if (u == v || gbhasedge(s, u, v))
 		return;
@@ -423,7 +440,8 @@
 	}
 }
 
-static void gfree(Isel *s)
+static void
+gfree(Isel *s)
 {
 	size_t i;
 
@@ -434,7 +452,8 @@
 	free(s->ngadj);
 }
 
-static void setup(Isel *s)
+static void
+setup(Isel *s)
 {
 	size_t gchunks;
 	size_t i;
@@ -471,7 +490,8 @@
 		s->degree[i] = 1<<16;
 }
 
-static void build(Isel *s)
+static void
+build(Isel *s)
 {
 	regid u[Nreg], d[Nreg];
 	size_t nu, nd;
@@ -536,7 +556,7 @@
 					wlputset(s->initial, d[k]);
 			}
 
-			/* moves get special treatment, since we don't want spurious
+			/* moves get special treatment, since we don't want spuriou
 			 * edges between the src and dest */
 			if (ismove(insn)) {
 				/* live \= uses(i) */
@@ -585,7 +605,8 @@
 #undef DEL
 }
 
-static int adjavail(Isel *s, regid r)
+static int
+adjavail(Isel *s, regid r)
 {
 	if (locmap[r]->list == &s->selstk)
 		return 0;
@@ -594,7 +615,8 @@
 	return 1;
 }
 
-static size_t nodemoves(Isel *s, regid n, Insn ***pil)
+static size_t
+nodemoves(Isel *s, regid n, Insn ***pil)
 {
 	size_t i, count;
 	regid rid;
@@ -612,7 +634,8 @@
 }
 
 
-static int moverelated(Isel *s, regid n)
+static int
+moverelated(Isel *s, regid n)
 {
 	size_t i;
 
@@ -625,7 +648,8 @@
 	return 0;
 }
 
-static void mkworklist(Isel *s)
+static void
+mkworklist(Isel *s)
 {
 	size_t i;
 
@@ -643,7 +667,8 @@
 	}
 }
 
-static void enablemove(Isel *s, regid n)
+static void
+enablemove(Isel *s, regid n)
 {
 	size_t i, j;
 	Insn **il;
@@ -665,7 +690,8 @@
 	free(il);
 }
 
-static void decdegree(Isel *s, regid m)
+static void
+decdegree(Isel *s, regid m)
 {
 	int before, after;
 	int found;
@@ -715,7 +741,8 @@
 	}
 }
 
-static void simp(Isel *s)
+static void
+simp(Isel *s)
 {
 	Loc *l;
 	regid m;
@@ -730,11 +757,12 @@
 	}
 }
 
-static regid getmappedalias(Loc **aliasmap, size_t nreg, regid id)
+static regid
+getmappedalias(Loc **aliasmap, size_t nreg, regid id)
 {
-	/* 
+	/*
 	 * if we get called from rewrite(), we can get a register that
-	 * we just created, with an id bigger than the number of entries
+	 * we just created, with an id bigger than the number of entrie
 	 * in the alias map. We should just return its id in that case.
 	 */
 	while (id < nreg) {
@@ -745,12 +773,14 @@
 	return id;
 }
 
-static regid getalias(Isel *s, regid id)
+static regid
+getalias(Isel *s, regid id)
 {
 	return getmappedalias(s->aliasmap, s->nreg, id);
 }
 
-static void wladd(Isel *s, regid u)
+static void
+wladd(Isel *s, regid u)
 {
 	size_t i;
 
@@ -767,7 +797,8 @@
 	wlput(&s->wlsimp, &s->nwlsimp, locmap[u]);
 }
 
-static int conservative(Isel *s, regid u, regid v)
+static int
+conservative(Isel *s, regid u, regid v)
 {
 	int k;
 	size_t i;
@@ -788,12 +819,14 @@
 }
 
 /* FIXME: is this actually correct? */
-static int ok(Isel *s, regid t, regid r)
+static int
+ok(Isel *s, regid t, regid r)
 {
 	return istrivial(s, t) || bshas(s->prepainted, t) || gbhasedge(s, t, r);
 }
 
-static int combinable(Isel *s, regid u, regid v)
+static int
+combinable(Isel *s, regid u, regid v)
 {
 	regid t;
 	size_t i;
@@ -816,7 +849,8 @@
 	return 1;
 }
 
-static void combine(Isel *s, regid u, regid v)
+static void
+combine(Isel *s, regid u, regid v)
 {
 	regid t;
 	size_t idx;
@@ -862,7 +896,8 @@
 	}
 }
 
-static int constrained(Isel *s, regid u, regid v)
+static int
+constrained(Isel *s, regid u, regid v)
 {
 	size_t i;
 
@@ -875,7 +910,8 @@
 	return gbhasedge(s, u, v);
 }
 
-static void coalesce(Isel *s)
+static void
+coalesce(Isel *s)
 {
 	Insn *m;
 	regid u, v, tmp;
@@ -909,7 +945,8 @@
 	}
 }
 
-static int mldel(Insn ***ml, size_t *nml, Bitset *bs, Insn *m)
+static int
+mldel(Insn ***ml, size_t *nml, Bitset *bs, Insn *m)
 {
 	size_t i;
 	if (bshas(bs, m->uid)) {
@@ -924,7 +961,8 @@
 	return 0;
 }
 
-static void freezemoves(Isel *s, Loc *u)
+static void
+freezemoves(Isel *s, Loc *u)
 {
 	size_t i;
 	Insn **ml;
@@ -956,7 +994,8 @@
 	lfree(&ml, &nml);
 }
 
-static void freeze(Isel *s)
+static void
+freeze(Isel *s)
 {
 	Loc *l;
 
@@ -966,7 +1005,8 @@
 }
 
 /* Select the spill candidates */
-static void selspill(Isel *s)
+static void
+selspill(Isel *s)
 {
 	size_t i;
 	Loc *m;
@@ -999,7 +1039,8 @@
  * Selects the colours for registers, spilling to the
  * stack if no free registers can be found.
  */
-static int paint(Isel *s)
+static int
+paint(Isel *s)
 {
 	int taken[Nreg];
 	Loc *n, *w;
@@ -1042,7 +1083,8 @@
 	return spilled;
 }
 
-static Loc *mapfind(Isel *s, Htab *map, Loc *old)
+static Loc *
+mapfind(Isel *s, Htab *map, Loc *old)
 {
 	Loc *new;
 	Loc *base;
@@ -1077,7 +1119,8 @@
 	return old;
 }
 
-static Loc *spillslot(Isel *s, regid reg)
+static Loc *
+spillslot(Isel *s, regid reg)
 {
 	size_t stkoff;
 
@@ -1085,7 +1128,8 @@
 	return locmem(-stkoff, locphysreg(Rrbp), NULL, locmap[reg]->mode);
 }
 
-static void updatelocs(Isel *s, Htab *map, Insn *insn)
+static void
+updatelocs(Isel *s, Htab *map, Insn *insn)
 {
 	size_t i;
 
@@ -1097,10 +1141,11 @@
 
 /*
  * Takes two tables for remappings, of size Nreg/Nreg,
- * and fills them, storign the number of uses or defs. Returns
+ * and fills them, storign the number of uses or defs. Return
  * whether there are any remappings at all.
  */
-static int remap(Isel *s, Htab *map, Insn *insn, regid *use, size_t nuse, regid *def, size_t ndef)
+static int
+remap(Isel *s, Htab *map, Insn *insn, regid *use, size_t nuse, regid *def, size_t ndef)
 {
 	regid ruse, rdef;
 	int remapped;
@@ -1133,7 +1178,8 @@
 	return remapped;
 }
 
-static int nopmov(Isel *s, Insn *insn)
+static int
+nopmov(Isel *s, Insn *insn)
 {
 	if (insn->op != Imov)
 		return 0;
@@ -1143,12 +1189,13 @@
 	return insn->args[0]->reg.id == insn->args[1]->reg.id && !bshas(s->prepainted, insn->args[0]->reg.id);
 }
 
-void replacealias(Isel *s, Loc **map, size_t nreg, Insn *insn)
+void
+replacealias(Isel *s, Loc **map, size_t nreg, Insn *insn)
 {
 	size_t i;
 	Loc *l;
 
-	if (!map) 
+	if (!map)
 		return;
 	for (i = 0; i < insn->nargs; i++) {
 		l = insn->args[i];
@@ -1163,7 +1210,8 @@
 	}
 }
 
-static ulong reglochash(void *p)
+static ulong
+reglochash(void *p)
 {
 	Loc *l;
 
@@ -1172,7 +1220,8 @@
 }
 
 
-static int regloceq(void *pa, void *pb)
+static int
+regloceq(void *pa, void *pb)
 {
 	Loc *a, *b;
 
@@ -1184,7 +1233,8 @@
  * Rewrite instructions using spilled registers, inserting
  * appropriate loads and stores into the BB
  */
-static void rewritebb(Isel *s, Asmbb *bb, Loc **aliasmap)
+static void
+rewritebb(Isel *s, Asmbb *bb, Loc **aliasmap)
 {
 	regid use[Nreg], def[Nreg];
 	size_t nuse, ndef;
@@ -1249,7 +1299,8 @@
 	bb->ni = nnew;
 }
 
-static void addspill(Isel *s, Loc *l)
+static void
+addspill(Isel *s, Loc *l)
 {
 	s->stksz->lit += modesize[l->mode];
 	s->stksz->lit = align(s->stksz->lit, modesize[l->mode]);
@@ -1261,9 +1312,9 @@
 	htput(s->spillslots, itop(l->reg.id), itop(s->stksz->lit));
 }
 
-/* 
- * Rewrites the function code so that it no longer contains
- * references to spilled registers. Every use of spilled regs
+/*
+ * Rewrites the function code so that it no longer contain
+ * references to spilled registers. Every use of spilled reg
  *
  *      insn %rX,%rY
  *
@@ -1273,7 +1324,8 @@
  *      insn %rZ,%rW
  *      mov %rW,234(%rsp)
  */
-static void rewrite(Isel *s, Loc **aliasmap)
+static void
+rewrite(Isel *s, Loc **aliasmap)
 {
 	size_t i;
 
@@ -1289,7 +1341,7 @@
 	bsclear(s->spilled);
 }
 
-/* 
+/*
  * Coalescing registers leaves a lot
  * of moves that look like
  *
@@ -1297,7 +1349,8 @@
  *
  * This is useless. This deletes them.
  */
-static void delnops(Isel *s)
+static void
+delnops(Isel *s)
 {
 	Insn *insn;
 	Asmbb *bb;
@@ -1325,7 +1378,8 @@
 		dumpasm(s, stdout);
 }
 
-void regalloc(Isel *s)
+void
+regalloc(Isel *s)
 {
 	int spilled;
 	size_t i;
@@ -1374,7 +1428,8 @@
 	gfree(s);
 }
 
-void wlprint(FILE *fd, char *name, Loc **wl, size_t nwl)
+void
+wlprint(FILE *fd, char *name, Loc **wl, size_t nwl)
 {
 	size_t i;
 	char *sep;
@@ -1390,7 +1445,8 @@
 	fprintf(fd, "]\n");
 }
 
-static void setprint(FILE *fd, Bitset *s)
+static void
+setprint(FILE *fd, Bitset *s)
 {
 	char *sep;
 	size_t i;
@@ -1405,7 +1461,8 @@
 	fprintf(fd, "\n");
 }
 
-static void locsetprint(FILE *fd, Bitset *s)
+static void
+locsetprint(FILE *fd, Bitset *s)
 {
 	char *sep;
 	size_t i;
@@ -1421,7 +1478,8 @@
 	fprintf(fd, "\n");
 }
 
-static void printedge(FILE *fd, char *msg, size_t a, size_t b)
+static void
+printedge(FILE *fd, char *msg, size_t a, size_t b)
 {
 	fprintf(fd, "\t%s ", msg);
 	dbglocprint(fd, locmap[a], 'x');
@@ -1430,7 +1488,8 @@
 	fprintf(fd, "\n");
 }
 
-void dumpasm(Isel *s, FILE *fd)
+void
+dumpasm(Isel *s, FILE *fd)
 {
 	size_t i, j;
 	char *sep;
--- a/6/simp.c
+++ b/6/simp.c
@@ -19,12 +19,14 @@
 
 /* takes a list of nodes, and reduces it (and it's subnodes) to a list
  * following these constraints:
- *      - All nodes are expression nodes
- *      - Nodes with side effects are root nodes
- *      - All nodes operate on machine-primitive types and tuples
+ *      - All nodes are expression node
+ *      - Nodes with side effects are root node
+ *      - All nodes operate on machine-primitive types and tuple
  */
-typedef struct Simp Simp;
-struct Simp {
+typedef
+struct Simp Simp;
+struct
+Simp {
 	int isglobl;
 
 	Node **stmts;
@@ -67,7 +69,8 @@
 Type *tyvoid;
 Node *abortoob;
 
-static void append(Simp *s, Node *n)
+static void
+append(Simp *s, Node *n)
 {
 	if (debugopt['S'])
 		dump(n, stdout);
@@ -75,23 +78,27 @@
 	lappend(&s->stmts, &s->nstmts, n);
 }
 
-static int ispure(Node *n)
+static int
+ispure(Node *n)
 {
 	return opispure[exprop(n)];
 }
 
-size_t alignto(size_t sz, Type *t)
+size_t
+alignto(size_t sz, Type *t)
 {
 	return align(sz, tyalign(t));
 }
 
-static Type *base(Type *t)
+static Type *
+base(Type *t)
 {
 	assert(t->nsub == 1);
 	return t->sub[0];
 }
 
-static Node *add(Node *a, Node *b)
+static Node *
+add(Node *a, Node *b)
 {
 	Node *n;
 
@@ -101,7 +108,8 @@
 	return n;
 }
 
-static Node *addk(Node *n, uvlong v)
+static Node *
+addk(Node *n, uvlong v)
 {
 	Node *k;
 
@@ -110,7 +118,8 @@
 	return add(n, k);
 }
 
-static Node *sub(Node *a, Node *b)
+static Node *
+sub(Node *a, Node *b)
 {
 	Node *n;
 
@@ -119,7 +128,8 @@
 	return n;
 }
 
-static Node *mul(Node *a, Node *b)
+static Node *
+mul(Node *a, Node *b)
 {
 	Node *n;
 
@@ -128,7 +138,8 @@
 	return n;
 }
 
-static int addressable(Simp *s, Node *a)
+static int
+addressable(Simp *s, Node *a)
 {
 	if (a->type == Ndecl || (a->type == Nexpr && exprop(a) == Ovar))
 		return hthas(s->envoff, a) || hthas(s->stkoff, a) || hthas(s->globls, a);
@@ -136,7 +147,8 @@
 		return stacknode(a);
 }
 
-int stacknode(Node *n)
+int
+stacknode(Node *n)
 {
 	if (n->type == Nexpr)
 		return isstacktype(n->expr.type);
@@ -144,7 +156,8 @@
 		return isstacktype(n->decl.type);
 }
 
-int floatnode(Node *n)
+int
+floatnode(Node *n)
 {
 	if (n->type == Nexpr)
 		return istyfloat(n->expr.type);
@@ -152,7 +165,8 @@
 		return istyfloat(n->decl.type);
 }
 
-static void forcelocal(Simp *s, Node *n)
+static void
+forcelocal(Simp *s, Node *n)
 {
 	assert(n->type == Ndecl || (n->type == Nexpr && exprop(n) == Ovar));
 	s->stksz += size(n);
@@ -164,7 +178,8 @@
 	htput(s->stkoff, n, itop(s->stksz));
 }
 
-static void declarelocal(Simp *s, Node *n)
+static void
+declarelocal(Simp *s, Node *n)
 {
 	if (stacknode(n))
 		forcelocal(s, n);
@@ -172,7 +187,8 @@
 
 /* takes the address of a node, possibly converting it to
  * a pointer to the base type 'bt' */
-static Node *addr(Simp *s, Node *a, Type *bt)
+static Node *
+addr(Simp *s, Node *a, Type *bt)
 {
 	Node *n;
 
@@ -186,7 +202,8 @@
 	return n;
 }
 
-static Node *load(Node *a)
+static Node *
+load(Node *a)
 {
 	Node *n;
 
@@ -196,7 +213,8 @@
 	return n;
 }
 
-static Node *deref(Node *a, Type *t)
+static Node *
+deref(Node *a, Type *t)
 {
 	Node *n;
 
@@ -209,7 +227,8 @@
 	return n;
 }
 
-static Node *set(Node *a, Node *b)
+static Node *
+set(Node *a, Node *b)
 {
 	Node *n;
 
@@ -223,7 +242,8 @@
 	return n;
 }
 
-static void def(Simp *s, Node *var)
+static void
+def(Simp *s, Node *var)
 {
 	Node *d;
 
@@ -232,7 +252,8 @@
 	append(s, d);
 }
 
-static Node *disp(Srcloc loc, uint v)
+static Node *
+disp(Srcloc loc, uint v)
 {
 	Node *n;
 
@@ -241,7 +262,8 @@
 	return n;
 }
 
-static Node *word(Srcloc loc, uint v)
+static Node *
+word(Srcloc loc, uint v)
 {
 	Node *n;
 
@@ -250,7 +272,8 @@
 	return n;
 }
 
-static Node *temp(Simp *simp, Node *e)
+static Node *
+temp(Simp *simp, Node *e)
 {
 	Node *t, *dcl;
 
@@ -261,7 +284,8 @@
 	return t;
 }
 
-static void cjmp(Simp *s, Node *cond, Node *iftrue, Node *iffalse)
+static void
+cjmp(Simp *s, Node *cond, Node *iftrue, Node *iffalse)
 {
 	Node *jmp;
 
@@ -269,13 +293,15 @@
 	append(s, jmp);
 }
 
-static Node *slicelen(Simp *s, Node *sl)
+static Node *
+slicelen(Simp *s, Node *sl)
 {
 	/* *(&sl + sizeof(size_t)) */
 	return load(addk(addr(s, rval(s, sl, NULL), tyintptr), Ptrsz));
 }
 
-Node *loadvar(Simp *s, Node *n, Node *dst)
+Node *
+loadvar(Simp *s, Node *n, Node *dst)
 {
 	Node *p, *f, *r;
 
@@ -293,7 +319,8 @@
 	return r;
 }
 
-static Node *seqlen(Simp *s, Node *n, Type *ty)
+static Node *
+seqlen(Simp *s, Node *n, Type *ty)
 {
 	Node *t, *r;
 
@@ -310,7 +337,8 @@
 }
 
 
-static Node *uconid(Simp *s, Node *n)
+static Node *
+uconid(Simp *s, Node *n)
 {
 	Ucon *uc;
 
@@ -322,7 +350,8 @@
 	return word(uc->loc, uc->id);
 }
 
-static void simpblk(Simp *s, Node *n)
+static void
+simpblk(Simp *s, Node *n)
 {
 	size_t i;
 
@@ -332,7 +361,8 @@
 	}
 }
 
-static Node *geninitdecl(Node *init, Type *ty, Node **dcl)
+static Node *
+geninitdecl(Node *init, Type *ty, Node **dcl)
 {
 	Node *n, *d, *r;
 	char lbl[128];
@@ -354,7 +384,8 @@
 	return r;
 }
 
-static Node *simpcode(Simp *s, Node *fn)
+static Node *
+simpcode(Simp *s, Node *fn)
 {
 	Node *r, *d;
 
@@ -364,7 +395,8 @@
 	return r;
 }
 
-static Node *simpblob(Simp *s, Node *blob)
+static Node *
+simpblob(Simp *s, Node *blob)
 {
 	Node *r, *d;
 
@@ -374,7 +406,8 @@
 	return r;
 }
 
-static Node *ptrsized(Simp *s, Node *v)
+static Node *
+ptrsized(Simp *s, Node *v)
 {
 	if (size(v) == Ptrsz)
 		return v;
@@ -386,7 +419,8 @@
 	return v;
 }
 
-static Node *membaddr(Simp *s, Node *n)
+static Node *
+membaddr(Simp *s, Node *n)
 {
 	Node *t, *u, *r;
 	Node **args;
@@ -405,7 +439,8 @@
 	return r;
 }
 
-static void checkidx(Simp *s, Op op, Node *len, Node *idx)
+static void
+checkidx(Simp *s, Op op, Node *len, Node *idx)
 {
 	Node *cmp, *die;
 	Node *ok, *fail;
@@ -427,7 +462,8 @@
 	append(s, ok);
 }
 
-static Node *idxaddr(Simp *s, Node *seq, Node *idx)
+static Node *
+idxaddr(Simp *s, Node *seq, Node *idx)
 {
 	Node *a, *t, *u, *v, *w; /* temps */
 	Node *r; /* result */
@@ -456,7 +492,8 @@
 	return r;
 }
 
-static Node *slicebase(Simp *s, Node *n, Node *off)
+static Node *
+slicebase(Simp *s, Node *n, Node *off)
 {
 	Node *u, *v;
 	Type *ty;
@@ -481,7 +518,8 @@
 	}
 }
 
-static Node *loadidx(Simp *s, Node *arr, Node *idx)
+static Node *
+loadidx(Simp *s, Node *arr, Node *idx)
 {
 	Node *v, *a;
 
@@ -490,7 +528,8 @@
 	return v;
 }
 
-static Node *lval(Simp *s, Node *n)
+static Node *
+lval(Simp *s, Node *n)
 {
 	Node *r;
 	Node **args;
@@ -517,7 +556,8 @@
 	return r;
 }
 
-static Node *intconvert(Simp *s, Node *from, Type *to, int issigned)
+static Node *
+intconvert(Simp *s, Node *from, Type *to, int issigned)
 {
 	Node *r;
 	size_t fromsz, tosz;
@@ -537,7 +577,8 @@
 	return r;
 }
 
-static Node *simpcast(Simp *s, Node *val, Type *to)
+static Node *
+simpcast(Simp *s, Node *val, Type *to)
 {
 	Node *r;
 	Type *t;
@@ -622,7 +663,8 @@
 
 /* Simplifies taking a slice of an array, pointer,
  * or other slice down to primitive pointer operations */
-static Node *simpslice(Simp *s, Node *n, Node *dst)
+static Node *
+simpslice(Simp *s, Node *n, Node *dst)
 {
 	Node *t;
 	Node *start, *end, *arg;
@@ -665,7 +707,8 @@
 	return t;
 }
 
-static Node *visit(Simp *s, Node *n)
+static Node *
+visit(Simp *s, Node *n)
 {
 	size_t i;
 	Node *r;
@@ -686,7 +729,8 @@
 	return r;
 }
 
-static Node *tupget(Simp *s, Node *tup, size_t idx, Node *dst)
+static Node *
+tupget(Simp *s, Node *tup, size_t idx, Node *dst)
 {
 	Node *plv, *prv, *sz, *stor, *dcl;
 	size_t off, i;
@@ -718,7 +762,8 @@
 	return dst;
 }
 
-static Node *assign(Simp *s, Node *lhs, Node *rhs)
+static Node *
+assign(Simp *s, Node *lhs, Node *rhs)
 {
 	Node *t, *u, *v, *r;
 
@@ -747,7 +792,8 @@
 	return r;
 }
 
-static Node *assignat(Simp *s, Node *r, size_t off, Node *val)
+static Node *
+assignat(Simp *s, Node *r, size_t off, Node *val)
 {
 	Node *pval, *pdst;
 	Node *sz;
@@ -770,7 +816,8 @@
  * value by evaluating the rvalue of each node on the
  * rhs and assigning it to the correct offset from the
  * head of the tuple. */
-static Node *simptup(Simp *s, Node *n, Node *dst)
+static Node *
+simptup(Simp *s, Node *n, Node *dst)
 {
 	Node **args;
 	Node *r;
@@ -790,7 +837,8 @@
 	return dst;
 }
 
-static Node *simpucon(Simp *s, Node *n, Node *dst)
+static Node *
+simpucon(Simp *s, Node *n, Node *dst)
 {
 	Node *tmp, *u, *tag, *elt, *sz;
 	Node *r;
@@ -839,7 +887,8 @@
 	return tmp;
 }
 
-static Node *simpuget(Simp *s, Node *n, Node *dst)
+static Node *
+simpuget(Simp *s, Node *n, Node *dst)
 {
 	Node *u, *p, *l;
 	size_t o;
@@ -856,7 +905,8 @@
 
 
 
-static Node *vatypeinfo(Simp *s, Node *n)
+static Node *
+vatypeinfo(Simp *s, Node *n)
 {
 	Node *ti, *tp, *td, *tn;
 	Type *ft, *vt, **st;
@@ -901,7 +951,8 @@
 	return tp;
 }
 
-static Node *capture(Simp *s, Node *n, Node *dst)
+static Node *
+capture(Simp *s, Node *n, Node *dst)
 {
 	Node *fn, *t, *f, *e, *val, *dcl, *fp, *envsz;
 	size_t nenv, nenvt, off, i;
@@ -955,13 +1006,15 @@
 	return dst;
 }
 
-static Node *getenvptr(Simp *s, Node *n)
+static Node *
+getenvptr(Simp *s, Node *n)
 {
 	assert(tybase(exprtype(n))->type == Tyfunc);
 	return load(addr(s, n, tyintptr));
 }
 
-static Node *getcode(Simp *s, Node *n)
+static Node *
+getcode(Simp *s, Node *n)
 {
 	Node *r, *p, *d;
 	Type *ty;
@@ -980,7 +1033,8 @@
 	return r;
 }
 
-static Node *simpcall(Simp *s, Node *n, Node *dst)
+static Node *
+simpcall(Simp *s, Node *n, Node *dst)
 {
 	Node *r, *call, *fn;
 	size_t i, nargs;
@@ -1039,7 +1093,8 @@
 	return r;
 }
 
-static Node *rval(Simp *s, Node *n, Node *dst)
+static Node *
+rval(Simp *s, Node *n, Node *dst)
 {
 	Node *t, *u, *v; /* temporary nodes */
 	Node *r; /* expression result */
@@ -1121,7 +1176,7 @@
 		case Llbl:
 			r = n;
 			break;
-		case Lint: 
+		case Lint:
 			/* we can only have up to 4 byte immediates, but they
 			 * can be moved into 64 bit regs */
 			if ((uint64_t)args[0]->lit.intval < 0x7fffffffULL)
@@ -1176,7 +1231,7 @@
 		break;
 	case Oneg:
 		if (istyfloat(exprtype(n))) {
-			t = mkfloat(n->loc, -1.0); 
+			t = mkfloat(n->loc, -1.0);
 			u = mkexpr(n->loc, Olit, t, NULL);
 			t->lit.type = n->expr.type;
 			u->expr.type = n->expr.type;
@@ -1218,13 +1273,15 @@
 	return r;
 }
 
-static void declarearg(Simp *s, Node *n)
+static void
+declarearg(Simp *s, Node *n)
 {
 	assert(n->type == Ndecl || (n->type == Nexpr && exprop(n) == Ovar));
 	lappend(&s->args, &s->nargs, n);
 }
 
-static int islbl(Node *n)
+static int
+islbl(Node *n)
 {
 	Node *l;
 	if (exprop(n) != Olit)
@@ -1233,7 +1290,8 @@
 	return l->type == Nlit && l->lit.littype == Llbl;
 }
 
-static Node *simp(Simp *s, Node *n)
+static Node *
+simp(Simp *s, Node *n)
 {
 	Node *r;
 
@@ -1264,7 +1322,8 @@
  * and simpler representation, which maps easily and
  * directly to assembly instructions.
  */
-static void simpinit(Simp *s, Node *f)
+static void
+simpinit(Simp *s, Node *f)
 {
 	Node *dcl;
 	Type *ty;
@@ -1295,7 +1354,8 @@
 	append(s, s->endlbl);
 }
 
-static int isexport(Node *dcl)
+static int
+isexport(Node *dcl)
 {
 	Node *n;
 
@@ -1310,7 +1370,8 @@
 	return 0;
 }
 
-static int envcmp(const void *pa, const void *pb)
+static int
+envcmp(const void *pa, const void *pb)
 {
 	const Node *a, *b;
 
@@ -1319,7 +1380,8 @@
 	return b->decl.did - a->decl.did;
 }
 
-static void collectenv(Simp *s, Node *fn)
+static void
+collectenv(Simp *s, Node *fn)
 {
 	size_t nenv, i;
 	Node **env;
@@ -1344,7 +1406,8 @@
 	free(env);
 }
 
-static Func *simpfn(Simp *s, char *name, Node *dcl)
+static Func *
+simpfn(Simp *s, char *name, Node *dcl)
 {
 	Node *n;
 	size_t i;
@@ -1401,7 +1464,8 @@
 	return fn;
 }
 
-static void extractsub(Simp *s, Node *e)
+static void
+extractsub(Simp *s, Node *e)
 {
 	size_t i;
 	Node *sub;
@@ -1433,7 +1497,8 @@
 	}
 }
 
-static void simpconstinit(Simp *s, Node *dcl)
+static void
+simpconstinit(Simp *s, Node *dcl)
 {
 	Node *e;
 
@@ -1464,7 +1529,8 @@
 	}
 }
 
-void simpglobl(Node *dcl, Htab *globls, Func ***fn, size_t *nfn, Node ***blob, size_t *nblob)
+void
+simpglobl(Node *dcl, Htab *globls, Func ***fn, size_t *nfn, Node ***blob, size_t *nblob)
 {
 	Simp s = {0,};
 	char *name;
--- a/6/typeinfo.c
+++ b/6/typeinfo.c
@@ -20,7 +20,8 @@
 
 Blob *tydescsub(Type *ty);
 
-size_t blobsz(Blob *b)
+size_t
+blobsz(Blob *b)
 {
 	size_t n;
 	size_t i;
@@ -53,7 +54,8 @@
 	return 0;
 }
 
-void namevec(Blob ***sub, size_t *nsub, Node *n)
+void
+namevec(Blob ***sub, size_t *nsub, Node *n)
 {
 	char *buf;
 	size_t len;
@@ -71,7 +73,8 @@
 	lappend(sub, nsub, mkblobbytes(buf, len));
 }
 
-static void structmemb(Blob ***sub, size_t *nsub, Node *sdecl)
+static void
+structmemb(Blob ***sub, size_t *nsub, Node *sdecl)
 {
 	Blob *b;
 
@@ -80,7 +83,8 @@
 	lappend(sub, nsub, b);
 }
 
-static void unionmemb(Blob ***sub, size_t *nsub, Ucon *ucon)
+static void
+unionmemb(Blob ***sub, size_t *nsub, Ucon *ucon)
 {
 	namevec(sub, nsub, ucon->name);
 	if (ucon->etype) {
@@ -91,13 +95,15 @@
 	}
 }
 
-static void encodetypeinfo(Blob ***sub, size_t *nsub, Type *t)
+static void
+encodetypeinfo(Blob ***sub, size_t *nsub, Type *t)
 {
 	lappend(sub, nsub, mkblobi(Btimin, tysize(t)));
 	lappend(sub, nsub, mkblobi(Btimin, tyalign(t)));
 }
 
-Blob *tydescsub(Type *ty)
+Blob *
+tydescsub(Type *ty)
 {
 	Blob **sub, *sz, *bt, *b;
 	size_t i, nsub;
@@ -191,7 +197,8 @@
 	return b;
 }
 
-Blob *namedesc(Type *ty)
+Blob *
+namedesc(Type *ty)
 {
 	Blob **sub;
 	size_t nsub;
@@ -204,7 +211,8 @@
 	return mkblobseq(sub, nsub);
 }
 
-Blob *tydescblob(Type *ty)
+Blob *
+tydescblob(Type *ty)
 {
 	char buf[512];
 	Blob *b, *sz, *sub;
@@ -229,7 +237,8 @@
 	return b;
 }
 
-size_t tysize(Type *t)
+size_t
+tysize(Type *t)
 {
 	size_t sz;
 	size_t i;
@@ -309,7 +318,8 @@
 	return -1;
 }
 
-size_t tyalign(Type *ty)
+size_t
+tyalign(Type *ty)
 {
 	size_t align, i;
 
@@ -340,7 +350,8 @@
 }
 
 /* gets the byte offset of 'memb' within the aggregate type 'aggr' */
-ssize_t tyoffset(Type *ty, Node *memb)
+ssize_t
+tyoffset(Type *ty, Node *memb)
 {
 	size_t i;
 	size_t off;
@@ -361,7 +372,8 @@
 	return 0;
 }
 
-size_t size(Node *n)
+size_t
+size(Node *n)
 {
 	Type *t;
 
@@ -372,7 +384,8 @@
 	return tysize(t);
 }
 
-ssize_t offset(Node *aggr, Node *memb)
+ssize_t
+offset(Node *aggr, Node *memb)
 {
 	return tyoffset(exprtype(aggr), memb);
 }
--- a/mi/cfg.c
+++ b/mi/cfg.c
@@ -15,7 +15,8 @@
 #include "mi.h"
 
 
-static Bb *mkbb(Cfg *cfg)
+static Bb *
+mkbb(Cfg *cfg)
 {
 	Bb *bb;
 
@@ -28,7 +29,8 @@
 }
 
 
-static void strlabel(Cfg *cfg, char *lbl, Bb *bb)
+static void
+strlabel(Cfg *cfg, char *lbl, Bb *bb)
 {
 	if (htget(cfg->lblmap, lbl) != bb) {
 		htput(cfg->lblmap, lbl, bb);
@@ -36,12 +38,14 @@
 	}
 }
 
-static void label(Cfg *cfg, Node *lbl, Bb *bb)
+static void
+label(Cfg *cfg, Node *lbl, Bb *bb)
 {
 	strlabel(cfg, lblstr(lbl), bb);
 }
 
-static int isnonretcall(Node *fn)
+static int
+isnonretcall(Node *fn)
 {
 	Node *dcl;
 
@@ -51,7 +55,8 @@
 	return dcl->decl.isnoret;
 }
 
-static int addnode(Cfg *cfg, Bb *bb, Node *n)
+static int
+addnode(Cfg *cfg, Bb *bb, Node *n)
 {
 	switch (exprop(n)) {
 	case Ojmp:
@@ -74,7 +79,8 @@
 	return 0;
 }
 
-static int islabel(Node *n)
+static int
+islabel(Node *n)
 {
 	Node *l;
 	if (n->type != Nexpr)
@@ -89,7 +95,8 @@
 	return 1;
 }
 
-static Bb *addlabel(Cfg *cfg, Bb *bb, Node **nl, size_t i, Srcloc loc)
+static Bb *
+addlabel(Cfg *cfg, Bb *bb, Node **nl, size_t i, Srcloc loc)
 {
 	/* if the current block assumes fall-through, insert an explicit jump */
 	if (i > 0 && nl[i - 1]->type == Nexpr) {
@@ -102,7 +109,8 @@
 	return bb;
 }
 
-void delete(Cfg *cfg, Bb *bb)
+void
+delete(Cfg *cfg, Bb *bb)
 {
 	size_t i, j;
 
@@ -121,7 +129,8 @@
 	cfg->bb[bb->id] = NULL;
 }
 
-void noexit(Cfg *cfg, Bb *bb)
+void
+noexit(Cfg *cfg, Bb *bb)
 {
 	size_t i;
 	for (i = 0; bsiter(bb->succ, &i); i++)
@@ -129,7 +138,8 @@
 	bsclear(bb->succ);
 }
 
-void trimdead(Cfg *cfg, Bb *bb)
+void
+trimdead(Cfg *cfg, Bb *bb)
 {
 	size_t i;
 
@@ -162,7 +172,8 @@
 	}
 }
 
-void trim(Cfg *cfg)
+void
+trim(Cfg *cfg)
 {
 	Bb *bb;
 	size_t i;
@@ -184,7 +195,8 @@
 	}
 }
 
-Cfg *mkcfg(Node *fn, Node **nl, size_t nn)
+Cfg *
+mkcfg(Node *fn, Node **nl, size_t nn)
 {
 	Cfg *cfg;
 	Bb *pre, *post;
@@ -265,7 +277,8 @@
 	return cfg;
 }
 
-void dumpbb(Bb *bb, FILE *fd)
+void
+dumpbb(Bb *bb, FILE *fd)
 {
 	size_t i;
 	char *sep;
@@ -305,7 +318,8 @@
 	fprintf(fd, "\n");
 }
 
-void dumpcfg(Cfg *cfg, FILE *fd)
+void
+dumpcfg(Cfg *cfg, FILE *fd)
 {
 	size_t i;
 
--- a/mi/dfcheck.c
+++ b/mi/dfcheck.c
@@ -14,7 +14,8 @@
 #include "parse.h"
 #include "mi.h"
 
-static void checkundef(Node *n, Reaching *r, Bitset *reach, Bitset *kill)
+static void
+checkundef(Node *n, Reaching *r, Bitset *reach, Bitset *kill)
 {
 	size_t i, j, did;
 	Node *def;
@@ -64,7 +65,8 @@
 	}
 }
 
-static void checkreach(Cfg *cfg)
+static void
+checkreach(Cfg *cfg)
 {
 	Bitset *reach, *kill;
 	size_t i, j, k;
@@ -97,7 +99,8 @@
 	reachingfree(r);
 }
 
-static void checkpredret(Cfg *cfg, Bb *bb)
+static void
+checkpredret(Cfg *cfg, Bb *bb)
 {
 	Bb *pred;
 	Op op;
@@ -116,7 +119,8 @@
 	}
 }
 
-static void checkret(Cfg *cfg)
+static void
+checkret(Cfg *cfg)
 {
 	Type *ft;
 
@@ -128,7 +132,8 @@
 	checkpredret(cfg, cfg->end);
 }
 
-void check(Cfg *cfg)
+void
+check(Cfg *cfg)
 {
 	checkret(cfg);
 	checkreach(cfg);
--- a/mi/flatten.c
+++ b/mi/flatten.c
@@ -18,9 +18,9 @@
 
 /* takes a list of nodes, and reduces it (and it's subnodes) to a list
  * following these constraints:
- *      - All nodes are expression nodes
- *      - Nodes with side effects are root nodes
- *      - All nodes operate on machine-primitive types and tuples
+ *      - All nodes are expression node
+ *      - Nodes with side effects are root node
+ *      - All nodes operate on machine-primitive types and tuple
  */
 typedef struct Flattenctx Flattenctx;
 struct Flattenctx {
@@ -55,7 +55,8 @@
 static Node *lval(Flattenctx *s, Node *n);
 static Node *assign(Flattenctx *s, Node *lhs, Node *rhs);
 
-static void append(Flattenctx *s, Node *n)
+static void
+append(Flattenctx *s, Node *n)
 {
 	if (debugopt['F'])
 		dump(n, stdout);
@@ -62,7 +63,8 @@
 	lappend(&s->stmts, &s->nstmts, n);
 }
 
-static void cjmp(Flattenctx *s, Node *cond, Node *iftrue, Node *iffalse)
+static void
+cjmp(Flattenctx *s, Node *cond, Node *iftrue, Node *iffalse)
 {
 	Node *jmp;
 
@@ -71,7 +73,8 @@
 	append(s, jmp);
 }
 
-static void jmp(Flattenctx *s, Node *lbl)
+static void
+jmp(Flattenctx *s, Node *lbl)
 {
 	Node *n;
 
@@ -80,7 +83,8 @@
 	append(s, n);
 }
 
-static Node *asn(Node *a, Node *b)
+static Node *
+asn(Node *a, Node *b)
 {
 	Node *n;
 
@@ -93,7 +97,8 @@
 	return n;
 }
 
-static int islbl(Node *n)
+static int
+islbl(Node *n)
 {
 	Node *l;
 	if (exprop(n) != Olit)
@@ -102,7 +107,8 @@
 	return l->type == Nlit && l->lit.littype == Llbl;
 }
 
-static Node *temp(Flattenctx *flatten, Node *e)
+static Node *
+temp(Flattenctx *flatten, Node *e)
 {
 	Node *t, *dcl;
 
@@ -111,7 +117,8 @@
 	return t;
 }
 
-static Node *add(Node *a, Node *b)
+static Node *
+add(Node *a, Node *b)
 {
 	Node *n;
 
@@ -120,7 +127,8 @@
 	return n;
 }
 
-static Node *addk(Node *n, uvlong v)
+static Node *
+addk(Node *n, uvlong v)
 {
 	Node *k;
 
@@ -129,7 +137,8 @@
 	return add(n, k);
 }
 
-static Node *sub(Node *a, Node *b)
+static Node *
+sub(Node *a, Node *b)
 {
 	Node *n;
 
@@ -138,7 +147,8 @@
 	return n;
 }
 
-static Node *subk(Node *n, uvlong v)
+static Node *
+subk(Node *n, uvlong v)
 {
 	Node *k;
 
@@ -147,7 +157,8 @@
 	return sub(n, k);
 }
 
-static Node *seqlen(Flattenctx *s, Node *n, Type *ty)
+static Node *
+seqlen(Flattenctx *s, Node *n, Type *ty)
 {
 	Node *r;
 
@@ -165,7 +176,8 @@
 	return r;
 }
 
-static Node *visit(Flattenctx *s, Node *n)
+static Node *
+visit(Flattenctx *s, Node *n)
 {
 	size_t i;
 	Node *r;
@@ -187,7 +199,8 @@
 	return r;
 }
 
-static void flattencond(Flattenctx *s, Node *n, Node *ltrue, Node *lfalse)
+static void
+flattencond(Flattenctx *s, Node *n, Node *ltrue, Node *lfalse)
 {
 	Node **args;
 	Node *v, *lnext;
@@ -225,7 +238,8 @@
  *              t = false
  *      ;;
  */
-static Node *flattenlazy(Flattenctx *s, Node *n)
+static Node *
+flattenlazy(Flattenctx *s, Node *n)
 {
 	Node *r, *t, *u;
 	Node *ltrue, *lfalse, *ldone;
@@ -261,7 +275,8 @@
 	return r;
 }
 
-static Node *destructure(Flattenctx *s, Node *lhs, Node *rhs)
+static Node *
+destructure(Flattenctx *s, Node *lhs, Node *rhs)
 {
 	Node *lv, *rv, *idx;
 	Node **args;
@@ -285,13 +300,15 @@
 	return rhs;
 }
 
-static Node *comparecomplex(Flattenctx *s, Node *n, Op op)
+static Node *
+comparecomplex(Flattenctx *s, Node *n, Op op)
 {
 	fatal(n, "Complex comparisons not yet supported\n");
 	return NULL;
 }
 
-static Node *compare(Flattenctx *s, Node *n, int fields)
+static Node *
+compare(Flattenctx *s, Node *n, int fields)
 {
 	const Op cmpmap[Numops][3] = {
 		[Oeq] = {Oeq, Oueq, Ofeq},
@@ -334,7 +351,8 @@
 	return r;
 }
 
-static Node *assign(Flattenctx *s, Node *lhs, Node *rhs)
+static Node *
+assign(Flattenctx *s, Node *lhs, Node *rhs)
 {
 	Node *r, *t, *u;
 
@@ -350,7 +368,8 @@
 	return r;
 }
 
-static Node *rval(Flattenctx *s, Node *n)
+static Node *
+rval(Flattenctx *s, Node *n)
 {
 	Node *t, *u, *v; /* temporary nodes */
 	Node *r; /* expression result */
@@ -456,7 +475,7 @@
 		case Lchr:
 		case Lbool:
 		case Llbl:
-		case Lint: 
+		case Lint:
 		case Lstr:
 		case Lflt:
 		case Lfunc:
@@ -521,7 +540,8 @@
 	return r;
 }
 
-static Node *lval(Flattenctx *s, Node *n)
+static Node *
+lval(Flattenctx *s, Node *n)
 {
 	Node *r;
 
@@ -548,7 +568,8 @@
 	return r;
 }
 
-static void flattenblk(Flattenctx *fc, Node *n)
+static void
+flattenblk(Flattenctx *fc, Node *n)
 {
 	size_t i;
 
@@ -558,7 +579,7 @@
 	}
 }
 
-/* init; while cond; body;; 
+/* init; while cond; body;;
  *    => init
  *       jmp :cond
  *       :body
@@ -569,7 +590,8 @@
  *            cjmp (cond) :body :end
  *       :end
  */
-static void flattenloop(Flattenctx *s, Node *n)
+static void
+flattenloop(Flattenctx *s, Node *n)
 {
 	Node *lbody;
 	Node *lend;
@@ -611,7 +633,8 @@
 
 /* if foo; bar; else baz;;
  *      => cjmp (foo) :bar :baz */
-static void flattenif(Flattenctx *s, Node *n, Node *exit)
+static void
+flattenif(Flattenctx *s, Node *n, Node *exit)
 {
 	Node *l1, *l2, *l3;
 	Node *iftrue, *iffalse;
@@ -639,7 +662,7 @@
 		append(s, s->incqueue[i]);
 	lfree(&s->incqueue, &s->nqueue);
 	/* because lots of bunched up end labels are ugly,
-	 * coalesce them by handling 'elif'-like constructs
+	 * coalesce them by handling 'elif'-like construct
 	 * separately */
 	if (iffalse && iffalse->type == Nifstmt) {
 		flattenif(s, iffalse, exit);
@@ -652,7 +675,8 @@
 		flatten(s, l3);
 }
 
-static void flattenloopmatch(Flattenctx *s, Node *pat, Node *val, Node *ltrue, Node *lfalse)
+static void
+flattenloopmatch(Flattenctx *s, Node *pat, Node *val, Node *ltrue, Node *lfalse)
 {
 	Node **cap, **out, *lload;
 	size_t i, ncap, nout;
@@ -672,7 +696,7 @@
 	jmp(s, ltrue);
 }
 
-/* pat; seq; 
+/* pat; seq;
  *      body;;
  *
  * =>
@@ -692,7 +716,8 @@
  *           matchval = load
  *      :end
  */
-static void flattenidxiter(Flattenctx *s, Node *n)
+static void
+flattenidxiter(Flattenctx *s, Node *n)
 {
 	Node *lbody, *lstep, *lcond, *lmatch, *lend;
 	Node *idx, *len, *dcl, *seq, *val, *done;
@@ -745,7 +770,8 @@
 	s->nloopexit--;
 }
 
-static Node *itertraitfn(Srcloc loc, Trait *tr, char *fn, Type *ty)
+static Node *
+itertraitfn(Srcloc loc, Trait *tr, char *fn, Type *ty)
 {
 	Node *proto, *dcl, *var;
 	char *name;
@@ -783,7 +809,8 @@
  * 		...load matches...
  * 	:end
  */
-static void flattentraititer(Flattenctx *s, Node *n)
+static void
+flattentraititer(Flattenctx *s, Node *n)
 {
 	Node *lbody, *lclean, *lstep, *lmatch, *lend;
 	Node *done, *val, *iter, *valptr, *iterptr;
@@ -839,7 +866,8 @@
 	s->nloopexit--;
 }
 
-static void flatteniter(Flattenctx *s, Node *n)
+static void
+flatteniter(Flattenctx *s, Node *n)
 {
 	switch (tybase(exprtype(n->iterstmt.seq))->type) {
 	case Tyarray:	flattenidxiter(s, n);	break;
@@ -847,7 +875,8 @@
 	default:	flattentraititer(s, n);	break;
 	}
 }
-static void flattenmatch(Flattenctx *fc, Node *n)
+static void
+flattenmatch(Flattenctx *fc, Node *n)
 {
 	Node *val;
 	Node **match;
@@ -862,7 +891,8 @@
 		flatten(fc, match[i]);
 }
 
-static void flattenexpr(Flattenctx *fc, Node *n)
+static void
+flattenexpr(Flattenctx *fc, Node *n)
 {
 	Node *r;
 	size_t i;
@@ -880,7 +910,8 @@
 	lfree(&fc->incqueue, &fc->nqueue);
 }
 
-static Node *flatten(Flattenctx *fc, Node *n)
+static Node *
+flatten(Flattenctx *fc, Node *n)
 {
 	Node *r, *u, *t;
 
@@ -914,7 +945,8 @@
 	return r;
 }
 
-static Node *flatteninit(Node *dcl)
+static Node *
+flatteninit(Node *dcl)
 {
 	Flattenctx fc = {0,};
 	Node *lit, *fn, *blk, *body;
@@ -931,7 +963,8 @@
 	return dcl;
 }
 
-static int ismain(Node *n)
+static int
+ismain(Node *n)
 {
 	n = n->decl.name;
 	if (n->name.ns)
@@ -939,7 +972,8 @@
 	return strcmp(n->name.name, "main") == 0;
 }
 
-Node *flattenfn(Node *dcl)
+Node *
+flattenfn(Node *dcl)
 {
 	if (ismain(dcl))
 		dcl->decl.vis = Vishidden;
@@ -954,7 +988,8 @@
 	return dcl;
 }
 
-int isconstfn(Node *n)
+int
+isconstfn(Node *n)
 {
 	Node *d, *e;
 	Type *t;
--- a/mi/match.c
+++ b/mi/match.c
@@ -46,7 +46,8 @@
 void dtreedump(FILE *fd, Dtree *dt);
 
 
-static Node *utag(Node *n)
+static Node *
+utag(Node *n)
 {
 	Node *tag;
 
@@ -55,7 +56,8 @@
 	return tag;
 }
 
-static Node *uvalue(Node *n, Type *ty)
+static Node *
+uvalue(Node *n, Type *ty)
 {
 	Node *elt;
 
@@ -64,7 +66,8 @@
 	return elt;
 }
 
-static Node *tupelt(Node *n, size_t i)
+static Node *
+tupelt(Node *n, size_t i)
 {
 	Node *idx, *elt;
 
@@ -75,7 +78,8 @@
 	return elt;
 }
 
-static Node *arrayelt(Node *n, size_t i)
+static Node *
+arrayelt(Node *n, size_t i)
 {
 	Node *idx, *elt;
 
@@ -86,7 +90,8 @@
 	return elt;
 }
 
-static Node *findmemb(Node *pat, Node *name)
+static Node *
+findmemb(Node *pat, Node *name)
 {
 	Node *n;
 	size_t i;
@@ -99,7 +104,8 @@
 	return NULL;
 }
 
-static Dtree *dtbytag(Dtree *t, Ucon *uc)
+static Dtree *
+dtbytag(Dtree *t, Ucon *uc)
 {
 	uint32_t tagval;
 	Node *taglit;
@@ -115,7 +121,8 @@
 	return NULL;
 }
 
-static Node *structmemb(Node *n, Node *name, Type *ty)
+static Node *
+structmemb(Node *n, Node *name, Type *ty)
 {
 	Node *elt;
 
@@ -124,7 +131,8 @@
 	return elt;
 }
 
-static Node *addcapture(Node *n, Node **cap, size_t ncap)
+static Node *
+addcapture(Node *n, Node **cap, size_t ncap)
 {
 	Node **blk;
 	size_t nblk, i;
@@ -142,7 +150,8 @@
 	return n;
 }
 
-static Dtree *mkdtree(Srcloc loc, Node *lbl)
+static Dtree *
+mkdtree(Srcloc loc, Node *lbl)
 {
 	static int ndtree;
 	Dtree *t;
@@ -154,7 +163,8 @@
 	return t;
 }
 
-static Dtree *nextnode(Srcloc loc, size_t idx, size_t count, Dtree *accept)
+static Dtree *
+nextnode(Srcloc loc, size_t idx, size_t count, Dtree *accept)
 {
 	if (idx == count - 1)
 		return accept;
@@ -162,7 +172,8 @@
 		return mkdtree(loc, genlbl(loc));
 }
 
-static size_t nconstructors(Type *t)
+static size_t
+nconstructors(Type *t)
 {
 	if (!t)
 		return 0;
@@ -209,7 +220,8 @@
 	return 0;
 }
 
-static int verifymatch(Dtree *t)
+static int
+verifymatch(Dtree *t)
 {
 	size_t i;
 	int ret;
@@ -226,7 +238,8 @@
 	return ret;
 }
 
-static int acceptall(Dtree *t, Dtree *accept)
+static int
+acceptall(Dtree *t, Dtree *accept)
 {
 	size_t i;
 	int ret;
@@ -249,7 +262,8 @@
 	return ret;
 }
 
-static int isnonrecursive(Dtree *dt, Type *ty)
+static int
+isnonrecursive(Dtree *dt, Type *ty)
 {
 	if (istyprimitive(ty) || ty->type == Tyvoid || ty->type == Tyfunc || ty->type == Typtr)
 		return 1;
@@ -260,12 +274,14 @@
 	return 0;
 }
 
-static int ismatchable(Type *ty)
+static int
+ismatchable(Type *ty)
 {
 	return ty->type != Tyfunc && ty->type != Tycode && ty->type != Tyvalist;
 }
 
-static int addwildrec(Srcloc loc, Type *ty, Dtree *start, Dtree *accept, Dtree ***end, size_t *nend)
+static int
+addwildrec(Srcloc loc, Type *ty, Dtree *start, Dtree *accept, Dtree ***end, size_t *nend)
 {
 	Dtree *next, **last, **tail;
 	size_t i, j, nelt, nlast, ntail;
@@ -378,7 +394,8 @@
 	return ret;
 }
 
-static int addwild(Node *pat, Node *val, Dtree *start, Dtree *accept, Node ***cap, size_t *ncap, Dtree ***end, size_t *nend)
+static int
+addwild(Node *pat, Node *val, Dtree *start, Dtree *accept, Node ***cap, size_t *ncap, Dtree ***end, size_t *nend)
 {
 	Node *asn;
 
@@ -390,7 +407,8 @@
 	return addwildrec(pat->loc, exprtype(pat), start, accept, end, nend);
 }
 
-static int addunion(Node *pat, Node *val, Dtree *start, Dtree *accept, Node ***cap, size_t *ncap, Dtree ***end, size_t *nend)
+static int
+addunion(Node *pat, Node *val, Dtree *start, Dtree *accept, Node ***cap, size_t *ncap, Dtree ***end, size_t *nend)
 {
 	Node *tagid;
 	Dtree *next;
@@ -431,7 +449,8 @@
 	return 1;
 }
 
-static int addstr(Node *pat, Node *val, Dtree *start, Dtree *accept, Node ***cap, size_t *ncap, Dtree ***end, size_t *nend)
+static int
+addstr(Node *pat, Node *val, Dtree *start, Dtree *accept, Node ***cap, size_t *ncap, Dtree ***end, size_t *nend)
 {
 	Dtree **tail, **last, *next;
 	size_t i, j, n, ntail, nlast;
@@ -469,7 +488,7 @@
 		tail = NULL;
 		ntail = 0;
 		next = nextnode(pat->loc, i, n, accept);
-		for (j = 0; j < nlast; j++) 
+		for (j = 0; j < nlast; j++)
 			if (addpat(p, v, last[j], next, NULL, NULL, &tail, &ntail))
 				ret = 1;
 		lfree(&last, &nlast);
@@ -481,7 +500,8 @@
 	return ret;
 }
 
-static int addlit(Node *pat, Node *val, Dtree *start, Dtree *accept, Node ***cap, size_t *ncap, Dtree ***end, size_t *nend)
+static int
+addlit(Node *pat, Node *val, Dtree *start, Dtree *accept, Node ***cap, size_t *ncap, Dtree ***end, size_t *nend)
 {
 	size_t i;
 
@@ -513,7 +533,8 @@
 	}
 }
 
-static int addtup(Node *pat, Node *val, Dtree *start, Dtree *accept, Node ***cap, size_t *ncap, Dtree ***end, size_t *nend)
+static int
+addtup(Node *pat, Node *val, Dtree *start, Dtree *accept, Node ***cap, size_t *ncap, Dtree ***end, size_t *nend)
 {
 	size_t nargs, nlast, ntail, i, j;
 	Dtree *next, **last, **tail;
@@ -531,7 +552,7 @@
 		next = nextnode(args[i]->loc, i, nargs, accept);
 		tail = NULL;
 		ntail = 0;
-		for (j = 0; j < nlast; j++) 
+		for (j = 0; j < nlast; j++)
 			if (addpat(pat->expr.args[i], tupelt(val, i), last[j], next, cap, ncap, &tail, &ntail))
 				ret = 1;
 		lfree(&last, &nlast);
@@ -543,7 +564,8 @@
 	return ret;
 }
 
-static int addarr(Node *pat, Node *val, Dtree *start, Dtree *accept, Node ***cap, size_t *ncap, Dtree ***end, size_t *nend)
+static int
+addarr(Node *pat, Node *val, Dtree *start, Dtree *accept, Node ***cap, size_t *ncap, Dtree ***end, size_t *nend)
 {
 	size_t nargs, nlast, ntail, i, j;
 	Dtree *next, **last, **tail;
@@ -561,7 +583,7 @@
 		next = nextnode(args[i]->loc, i, nargs, accept);
 		tail = NULL;
 		ntail = 0;
-		for (j = 0; j < nlast; j++) 
+		for (j = 0; j < nlast; j++)
 			if (addpat(pat->expr.args[i], arrayelt(val, i), last[j], next, cap, ncap, &tail, &ntail))
 				ret = 1;
 		lfree(&last, &nlast);
@@ -573,7 +595,8 @@
 	return ret;
 }
 
-static int addstruct(Node *pat, Node *val, Dtree *start, Dtree *accept, Node ***cap, size_t *ncap, Dtree ***end, size_t *nend)
+static int
+addstruct(Node *pat, Node *val, Dtree *start, Dtree *accept, Node ***cap, size_t *ncap, Dtree ***end, size_t *nend)
 {
 	Dtree *next, **last, **tail;
 	Node *memb, *name;
@@ -613,7 +636,8 @@
 	return ret;
 }
 
-static int addderefpat(Node *pat, Node *val, Dtree *start, Dtree *accept, Node ***cap, size_t *ncap, Dtree ***end, size_t *nend)
+static int
+addderefpat(Node *pat, Node *val, Dtree *start, Dtree *accept, Node ***cap, size_t *ncap, Dtree ***end, size_t *nend)
 {
 	Node *deref;
 	Dtree *walk;
@@ -630,7 +654,8 @@
 	return addpat(pat->expr.args[0], deref, walk, accept, cap, ncap, end, nend);
 }
 
-static int addpat(Node *pat, Node *val, Dtree *start, Dtree *accept, Node ***cap, size_t *ncap, Dtree ***end, size_t *nend)
+static int
+addpat(Node *pat, Node *val, Dtree *start, Dtree *accept, Node ***cap, size_t *ncap, Dtree ***end, size_t *nend)
 {
 	int ret;
 	Node *dcl;
@@ -678,7 +703,8 @@
 
 
 /* val must be a pure, fully evaluated value */
-Dtree *gendtree(Node *m, Node *val, Node **lbl, size_t nlbl)
+Dtree *
+gendtree(Node *m, Node *val, Node **lbl, size_t nlbl)
 {
 	Dtree *start, *accept, **end;
 	Node **pat, **cap;
@@ -706,7 +732,8 @@
 	return start;
 }
 
-void genmatchcode(Dtree *dt, Node ***out, size_t *nout)
+void
+genmatchcode(Dtree *dt, Node ***out, size_t *nout)
 {
 	Node *jmp, *eq, *fail;
 	int emit;
@@ -752,7 +779,8 @@
 	}
 }
 
-void genonematch(Node *pat, Node *val, Node *iftrue, Node *iffalse, Node ***out, size_t *nout, Node ***cap, size_t *ncap)
+void
+genonematch(Node *pat, Node *val, Node *iftrue, Node *iffalse, Node ***out, size_t *nout, Node ***cap, size_t *ncap)
 {
 	Dtree *start, *accept, *reject, **end;
 	size_t nend;
@@ -771,7 +799,8 @@
 	genmatchcode(start, out, nout);
 }
 
-void genmatch(Node *m, Node *val, Node ***out, size_t *nout)
+void
+genmatch(Node *m, Node *val, Node ***out, size_t *nout)
 {
 	Node **pat, **lbl, *end, *endlbl;
 	size_t npat, nlbl, i;
@@ -807,7 +836,8 @@
 }
 
 
-void dtreedumplit(FILE *fd, Dtree *dt, Node *n, size_t depth)
+void
+dtreedumplit(FILE *fd, Dtree *dt, Node *n, size_t depth)
 {
 	char *s;
 
@@ -824,7 +854,8 @@
 	}
 }
 
-void dtreedumpnode(FILE *fd, Dtree *dt, size_t depth)
+void
+dtreedumpnode(FILE *fd, Dtree *dt, size_t depth)
 {
 	size_t i;
 
@@ -841,7 +872,8 @@
 	}
 }
 
-void dtreedump(FILE *fd, Dtree *dt)
+void
+dtreedump(FILE *fd, Dtree *dt)
 {
 	dtreedumpnode(fd, dt, 0);
 }
--- a/mi/reaching.c
+++ b/mi/reaching.c
@@ -14,7 +14,8 @@
 #include "parse.h"
 #include "mi.h"
 
-Node *assignee(Node *n)
+Node *
+assignee(Node *n)
 {
 	Node *a;
 
@@ -44,7 +45,8 @@
 	return NULL;
 }
 
-static void collectdefs(Cfg *cfg, size_t **defs, size_t *ndefs)
+static void
+collectdefs(Cfg *cfg, size_t **defs, size_t *ndefs)
 {
 	size_t i, j, did;
 	Node *n;
@@ -66,7 +68,8 @@
 	}
 }
 
-static void genkill(Bb *bb, size_t **defs, size_t *ndefs, Bitset *gen, Bitset *kill)
+static void
+genkill(Bb *bb, size_t **defs, size_t *ndefs, Bitset *gen, Bitset *kill)
 {
 	size_t i, j, did;
 	Node *n;
@@ -85,7 +88,8 @@
 	}
 }
 
-void bsdump(Bitset *bs)
+void
+bsdump(Bitset *bs)
 {
 	size_t i;
 	for (i = 0; bsiter(bs, &i); i++)
@@ -93,7 +97,8 @@
 	printf("\n");
 }
 
-Reaching *reaching(Cfg *cfg)
+Reaching *
+reaching(Cfg *cfg)
 {
 	Bitset **in, **out;
 	Bitset **gen, **kill;
@@ -100,7 +105,7 @@
 	Bitset *bbin, *bbout;
 	Reaching *reaching;
 	size_t **defs;        /* mapping from did => [def,list] */
-	size_t *ndefs;      
+	size_t *ndefs;
 	size_t i, j;
 	int changed;
 
@@ -163,7 +168,8 @@
 	return reaching;
 }
 
-void reachingfree(Reaching *r)
+void
+reachingfree(Reaching *r)
 {
 	size_t i;
 
--- a/muse/muse.c
+++ b/muse/muse.c
@@ -27,7 +27,8 @@
 size_t nextralibs;
 char *localincpath;
 
-static void usage(char *prog)
+static void
+usage(char *prog)
 {
 	printf("%s [-hIdos] [-o outfile] [-p pkgname] [-m] inputs\n", prog);
 	printf("\t-h\tprint this help\n");
@@ -37,7 +38,8 @@
 	printf("\t-s\tShow the contents of usefiles `inputs`\n");
 }
 
-static void mergeuse(char *path)
+static void
+mergeuse(char *path)
 {
 	FILE *f;
 	Stab *st;
@@ -50,7 +52,8 @@
 	fclose(f);
 }
 
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
 {
 	Optctx ctx;
 	size_t i;
--- a/parse/dump.c
+++ b/parse/dump.c
@@ -14,7 +14,8 @@
 #include "parse.h"
 
 /* outputs a fully qualified name */
-static void outname(Node *n, FILE *fd)
+static void
+outname(Node *n, FILE *fd)
 {
 	if (n->name.ns)
 		fprintf(fd, "%s.", n->name.ns);
@@ -24,7 +25,8 @@
 /* outputs a sym in a one-line short form (ie,
  * the initializer is not printed, and the node is not
  * expressed in indented tree. */
-static void outsym(Node *s, FILE *fd, int depth)
+static void
+outsym(Node *s, FILE *fd, int depth)
 {
 	char buf[1024];
 
@@ -36,9 +38,10 @@
 	fprintf(fd, " : %s\n", tyfmt(buf, 1024, s->decl.type));
 }
 
-void dumpsym(Node *s, FILE *fd) { outsym(s, fd, 0); }
+void
+dumpsym(Node *s, FILE *fd) { outsym(s, fd, 0); }
 
-/* Outputs a symbol table, and it's sub-tables
+/* Outputs a symbol table, and it's sub-table
  * recursively, with a sigil describing the symbol
  * type, as follows:
  *      T       type
@@ -47,7 +50,8 @@
  *
  * Does not print captured variables.
  */
-static void outstab(Stab *st, FILE *fd, int depth)
+static void
+outstab(Stab *st, FILE *fd, int depth)
 {
 	size_t i, n;
 	char *name;
@@ -99,9 +103,14 @@
 	}
 }
 
-void dumpstab(Stab *st, FILE *fd) { outstab(st, fd, 0); }
+void
+dumpstab(Stab *st, FILE *fd)
+{
+	outstab(st, fd, 0);
+}
 
-void dumpfilestabs(Node *file, int depth, FILE *fd)
+void
+dumpfilestabs(Node *file, int depth, FILE *fd)
 {
 	size_t nk, i;
 	void **k;
@@ -113,10 +122,11 @@
 	free(k);
 }
 
-/* Outputs a node in indented tree form. This is
+/* Outputs a node in indented tree form. This i
  * not a full serialization, but mainly an aid for
  * understanding and debugging. */
-static void outnode(Node *n, FILE *fd, int depth)
+static void
+outnode(Node *n, FILE *fd, int depth)
 {
 	size_t i;
 	char *ty;
@@ -255,6 +265,8 @@
 	}
 }
 
-void dump(Node *n, FILE *fd) { outnode(n, fd, 0); }
+void
+dump(Node *n, FILE *fd) { outnode(n, fd, 0); }
 
-void dumpn(Node *n) { dump(n, stdout); }
+void
+dumpn(Node *n) { dump(n, stdout); }
--- a/parse/err.c
+++ b/parse/err.c
@@ -15,7 +15,8 @@
 #include "parse.h"
 
 /* errors */
-void die(char *msg, ...)
+void
+die(char *msg, ...)
 {
 	va_list ap;
 
@@ -26,7 +27,8 @@
 	abort();
 }
 
-void fatal(Node *n, char *msg, ...)
+void
+fatal(Node *n, char *msg, ...)
 {
 	va_list ap;
 
@@ -35,7 +37,8 @@
 	va_end(ap);
 }
 
-void lfatal(Srcloc l, char *msg, ...)
+void
+lfatal(Srcloc l, char *msg, ...)
 {
 	va_list ap;
 
@@ -44,7 +47,8 @@
 	va_end(ap);
 }
 
-void lfatalv(Srcloc l, char *msg, va_list ap)
+void
+lfatalv(Srcloc l, char *msg, va_list ap)
 {
 	fprintf(stdout, "%s:%d: ", fname(l), lnum(l));
 	vfprintf(stdout, msg, ap);
--- a/parse/export.c
+++ b/parse/export.c
@@ -18,7 +18,8 @@
 static void tagtype(Stab *st, Type *t, int ingeneric, int hidelocal);
 static void tagnode(Stab *st, Node *n, int ingeneric, int hidelocal);
 
-void tagreflect(Type *t)
+void
+tagreflect(Type *t)
 {
 	size_t i;
 
@@ -46,7 +47,8 @@
 	}
 }
 
-static void tagtrait(Stab *st, Trait *tr, int ingeneric, int hidelocal)
+static void
+tagtrait(Stab *st, Trait *tr, int ingeneric, int hidelocal)
 {
 	size_t i;
 
@@ -64,7 +66,8 @@
 		tagnode(st, tr->proto[i], ingeneric, hidelocal);
 }
 
-static void tagtype(Stab *st, Type *t, int ingeneric, int hidelocal)
+static void
+tagtype(Stab *st, Type *t, int ingeneric, int hidelocal)
 {
 	size_t i;
 
@@ -100,7 +103,8 @@
 	}
 }
 
-int isexportinit(Node *n)
+int
+isexportinit(Node *n)
 {
 	if (n->decl.isgeneric && !n->decl.trait)
 		return 1;
@@ -110,7 +114,8 @@
 	return 0;
 }
 
-static void tagnode(Stab *st, Node *n, int ingeneric, int hidelocal)
+static void
+tagnode(Stab *st, Node *n, int ingeneric, int hidelocal)
 {
 	size_t i;
 	Node *d;
@@ -201,7 +206,8 @@
 	}
 }
 
-void tagexports(Node *file, int hidelocal)
+void
+tagexports(Node *file, int hidelocal)
 {
 	size_t i, j, n;
 	Trait *tr;
--- a/parse/fold.c
+++ b/parse/fold.c
@@ -13,7 +13,8 @@
 #include "util.h"
 #include "parse.h"
 
-static int getintlit(Node *n, vlong *v)
+static int
+getintlit(Node *n, vlong *v)
 {
 	Node *l;
 
@@ -26,7 +27,8 @@
 	return 1;
 }
 
-static int isintval(Node *n, vlong val)
+static int
+isintval(Node *n, vlong val)
 {
 	vlong v;
 
@@ -35,7 +37,8 @@
 	return v == val;
 }
 
-static Node *val(Srcloc loc, vlong val, Type *t)
+static Node *
+val(Srcloc loc, vlong val, Type *t)
 {
 	Node *l, *n;
 
@@ -46,7 +49,8 @@
 	return n;
 }
 
-static int issmallconst(Node *dcl)
+static int
+issmallconst(Node *dcl)
 {
 	Type *t;
 
@@ -60,7 +64,8 @@
 	return 0;
 }
 
-static Node *foldcast(Node *n)
+static Node *
+foldcast(Node *n)
 {
 	Type *to, *from;
 	Node *sub;
@@ -96,7 +101,8 @@
 	return n;
 }
 
-int idxcmp(const void *pa, const void *pb)
+int
+idxcmp(const void *pa, const void *pb)
 {
 	Node *a, *b;
 	vlong av, bv;
@@ -116,7 +122,8 @@
 		return 1;
 }
 
-Node *fold(Node *n, int foldvar)
+Node *
+fold(Node *n, int foldvar)
 {
 	Node **args, *r;
 	Type *t;
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -64,7 +64,8 @@
 static Type *tyfix(Inferstate *st, Node *ctx, Type *orig, int noerr);
 static void typesub(Inferstate *st, Node *n, int noerr);
 
-static void ctxstrcall(char *buf, size_t sz, Inferstate *st, Node *n)
+static void
+ctxstrcall(char *buf, size_t sz, Inferstate *st, Node *n)
 {
 	char *p, *end, *sep, *t;
 	size_t nargs, i;
@@ -103,7 +104,8 @@
 	free(t);
 }
 
-static char *nodetystr(Inferstate *st, Node *n)
+static char *
+nodetystr(Inferstate *st, Node *n)
 {
 	Type *t;
 
@@ -119,7 +121,8 @@
 		return strdup("unknown");
 }
 
-static void marksrc(Inferstate *st, Type *t, Srcloc l)
+static void
+marksrc(Inferstate *st, Type *t, Srcloc l)
 {
 	t = tf(st, t);
 	if (t->tid >= st->nusrc) {
@@ -130,7 +133,8 @@
 		st->usrc[t->tid] = l;
 }
 
-static char *srcstr(Inferstate *st, Type *ty)
+static char *
+srcstr(Inferstate *st, Type *ty)
 {
 	char src[128];
 	Srcloc l;
@@ -148,7 +152,8 @@
 
 /* Tries to give a good string describing the context
  * for the sake of error messages. */
-static char *ctxstr(Inferstate *st, Node *n)
+static char *
+ctxstr(Inferstate *st, Node *n)
 {
 	char *t, *t1, *t2, *t3;
 	char *s, *d;
@@ -210,7 +215,7 @@
 			case Omemb:
 				bprintf(buf, sizeof buf, "<%s>.%s", t1, namestr(args[1]));
 				break;
-			default: 
+			default:
 				bprintf(buf, sizeof buf, "%s:%s", d, t);
 				break;
 			}
@@ -227,7 +232,8 @@
 	return s;
 }
 
-static void addspecialization(Inferstate *st, Node *n, Stab *stab)
+static void
+addspecialization(Inferstate *st, Node *n, Stab *stab)
 {
 	Node *dcl;
 
@@ -237,7 +243,8 @@
 	lappend(&st->genericdecls, &st->ngenericdecls, dcl);
 }
 
-static void additerspecializations(Inferstate *st, Node *n, Stab *stab)
+static void
+additerspecializations(Inferstate *st, Node *n, Stab *stab)
 {
 	Trait *tr;
 	Type *ty;
@@ -259,13 +266,15 @@
 	}
 }
 
-static void delayedcheck(Inferstate *st, Node *n, Stab *s)
+static void
+delayedcheck(Inferstate *st, Node *n, Stab *s)
 {
 	lappend(&st->postcheck, &st->npostcheck, n);
 	lappend(&st->postcheckscope, &st->npostcheckscope, s);
 }
 
-static void typeerror(Inferstate *st, Type *a, Type *b, Node *ctx, char *msg)
+static void
+typeerror(Inferstate *st, Type *a, Type *b, Node *ctx, char *msg)
 {
 	char *t1, *t2, *s1, *s2, *c;
 
@@ -287,7 +296,8 @@
 
 /* Set a scope's enclosing scope up correctly.
  * We don't do this in the parser for some reason. */
-static void setsuper(Stab *st, Stab *super)
+static void
+setsuper(Stab *st, Stab *super)
 {
 	Stab *s;
 
@@ -299,7 +309,8 @@
 
 /* If the current environment binds a type,
  * we return true */
-static int isbound(Inferstate *st, Type *t)
+static int
+isbound(Inferstate *st, Type *t)
 {
 	ssize_t i;
 
@@ -314,7 +325,8 @@
  * Recursive types that contain themselves through
  * pointers or slices are fine, but any other self-inclusion
  * would lead to a value of infinite size */
-static int occurs_rec(Inferstate *st, Type *sub, Bitset *bs)
+static int
+occurs_rec(Inferstate *st, Type *sub, Bitset *bs)
 {
 	size_t i;
 
@@ -323,7 +335,7 @@
 	bsput(bs, sub->tid);
 	switch (sub->type) {
 	case Typtr:
-	case Tyslice: 
+	case Tyslice:
 		break;
 	case Tystruct:
 		for (i = 0; i < sub->nmemb; i++)
@@ -348,7 +360,8 @@
 	return 0;
 }
 
-static int occursin(Inferstate *st, Type *a, Type *b)
+static int
+occursin(Inferstate *st, Type *a, Type *b)
 {
 	Bitset *bs;
 	int r;
@@ -360,7 +373,8 @@
 	return r;
 }
 
-static int occurs(Inferstate *st, Type *t)
+static int
+occurs(Inferstate *st, Type *t)
 {
 	Bitset *bs;
 	int r;
@@ -371,7 +385,8 @@
 	return r;
 }
 
-static int needfreshenrec(Inferstate *st, Type *t, Bitset *visited)
+static int
+needfreshenrec(Inferstate *st, Type *t, Bitset *visited)
 {
 	size_t i;
 
@@ -405,7 +420,8 @@
 	return 0;
 }
 
-static int needfreshen(Inferstate *st, Type *t)
+static int
+needfreshen(Inferstate *st, Type *t)
 {
 	Bitset *visited;
 	int ret;
@@ -417,7 +433,8 @@
 }
 
 /* Freshens the type of a declaration. */
-static Type *tyfreshen(Inferstate *st, Tysubst *subst, Type *t)
+static Type *
+tyfreshen(Inferstate *st, Tysubst *subst, Type *t)
 {
 	if (!needfreshen(st, t)) {
 		if (debugopt['u'])
@@ -438,7 +455,8 @@
 }
 
 /* Resolves a type and all its subtypes recursively. */
-static void tyresolve(Inferstate *st, Type *t)
+static void
+tyresolve(Inferstate *st, Type *t)
 {
 	size_t i;
 	Type *base;
@@ -446,7 +464,7 @@
 	if (t->resolved)
 		return;
 
-	/* type resolution should never throw errors about non-generics
+	/* type resolution should never throw errors about non-generic
 	 * showing up within a generic type, so we push and pop a generic
 	 * around resolution */
 	st->ingeneric++;
@@ -504,7 +522,8 @@
 	st->ingeneric--;
 }
 
-Type *tysearch(Type *t)
+Type *
+tysearch(Type *t)
 {
 	if (!t)
 		return t;
@@ -513,7 +532,8 @@
 	return t;
 }
 
-static Type *remapping(Type *t)
+static Type *
+remapping(Type *t)
 {
 	Stab *ns;
 	Type *lu;
@@ -544,7 +564,8 @@
 }
 
 /* Look up the best type to date in the unification table, returning it */
-static Type *tylookup(Type *t)
+static Type *
+tylookup(Type *t)
 {
 	Type *lu;
 
@@ -567,7 +588,8 @@
 	return t;
 }
 
-static Type *tysubstmap(Inferstate *st, Tysubst *subst, Type *t, Type *orig)
+static Type *
+tysubstmap(Inferstate *st, Tysubst *subst, Type *t, Type *orig)
 {
 	size_t i;
 
@@ -578,7 +600,8 @@
 	return t;
 }
 
-static Type *tysubst(Inferstate *st, Type *t, Type *orig)
+static Type *
+tysubst(Inferstate *st, Type *t, Type *orig)
 {
 	Tysubst *subst;
 
@@ -591,7 +614,8 @@
 
 /* find the most accurate type mapping we have (ie,
  * the end of the unification chain */
-static Type *tf(Inferstate *st, Type *orig)
+static Type *
+tf(Inferstate *st, Type *orig)
 {
 	int isgeneric;
 	Type *t;
@@ -617,7 +641,8 @@
 }
 
 /* set the type of any typable node */
-static void settype(Inferstate *st, Node *n, Type *t)
+static void
+settype(Inferstate *st, Node *n, Type *t)
 {
 	t = tf(st, t);
 	switch (n->type) {
@@ -632,7 +657,8 @@
 }
 
 /* Gets the type of a literal value */
-static Type *littype(Node *n)
+static Type *
+littype(Node *n)
 {
 	Type *t;
 
@@ -653,7 +679,8 @@
 	return n->lit.type;
 }
 
-static Type *delayeducon(Inferstate *st, Type *fallback)
+static Type *
+delayeducon(Inferstate *st, Type *fallback)
 {
 	Type *t;
 	char *from, *to;
@@ -673,7 +700,8 @@
 }
 
 /* Finds the type of any typable node */
-static Type *type(Inferstate *st, Node *n)
+static Type *
+type(Inferstate *st, Node *n)
 {
 	Type *t;
 
@@ -690,7 +718,8 @@
 	return tf(st, t);
 }
 
-static Ucon *uconresolve(Inferstate *st, Node *n)
+static Ucon *
+uconresolve(Inferstate *st, Node *n)
 {
 	Ucon *uc;
 	Node **args;
@@ -712,7 +741,8 @@
 	return uc;
 }
 
-static void putbindingsrec(Inferstate *st, Htab *bt, Type *t, Bitset *visited)
+static void
+putbindingsrec(Inferstate *st, Htab *bt, Type *t, Bitset *visited)
 {
 	size_t i;
 
@@ -757,7 +787,8 @@
 
 /* Binds the type parameters present in the
  * current type into the type environment */
-static void putbindings(Inferstate *st, Htab *bt, Type *t)
+static void
+putbindings(Inferstate *st, Htab *bt, Type *t)
 {
 	Bitset *visited;
 
@@ -768,7 +799,8 @@
 	bsfree(visited);
 }
 
-static void tybindall(Inferstate *st, Type *t)
+static void
+tybindall(Inferstate *st, Type *t)
 {
 	Htab *bt;
 
@@ -777,7 +809,8 @@
 	putbindings(st, bt, t);
 }
 
-static void tybind(Inferstate *st, Type *t)
+static void
+tybind(Inferstate *st, Type *t)
 {
 	Htab *bt;
 	size_t i;
@@ -794,7 +827,8 @@
 
 /* Binds the type parameters in the
  * declaration into the type environment */
-static void bind(Inferstate *st, Node *n)
+static void
+bind(Inferstate *st, Node *n)
 {
 	Htab *bt;
 
@@ -813,7 +847,8 @@
 
 /* Rolls back the binding of type parameters in
  * the type environment */
-static void unbind(Inferstate *st, Node *n)
+static void
+unbind(Inferstate *st, Node *n)
 {
 	if(!n->decl.isgeneric)
 		return;
@@ -822,7 +857,8 @@
 	st->ingeneric--;
 }
 
-static void tyunbind(Inferstate *st)
+static void
+tyunbind(Inferstate *st)
 {
 	htfree(tybindings[ntybindings - 1]);
 	lpop(&tybindings, &ntybindings);
@@ -832,7 +868,8 @@
  * type variables, the constraint is added to the required
  * constraint list. Otherwise, the type is checked to see
  * if it has the required constraint */
-static void constrain(Inferstate *st, Node *ctx, Type *a, Trait *c)
+static void
+constrain(Inferstate *st, Node *ctx, Type *a, Trait *c)
 {
 	if (a->type == Tyvar) {
 		if (!a->traits)
@@ -844,7 +881,8 @@
 }
 
 /* does b satisfy all the constraints of a? */
-static int checktraits(Type *a, Type *b)
+static int
+checktraits(Type *a, Type *b)
 {
 	/* a has no traits to satisfy */
 	if (!a->traits)
@@ -857,7 +895,8 @@
 	return bsissubset(a->traits, b->traits);
 }
 
-static void verifytraits(Inferstate *st, Node *ctx, Type *a, Type *b)
+static void
+verifytraits(Inferstate *st, Node *ctx, Type *a, Type *b)
 {
 	size_t i, n;
 	Srcloc l;
@@ -888,7 +927,8 @@
 }
 
 /* Merges the constraints on types */
-static void mergetraits(Inferstate *st, Node *ctx, Type *a, Type *b)
+static void
+mergetraits(Inferstate *st, Node *ctx, Type *a, Type *b)
 {
 	if (b->type == Tyvar) {
 		/* make sure that if a = b, both have same traits */
@@ -907,7 +947,8 @@
  * direction should we unify. A lower ranked type
  * should be mapped to the higher ranked (ie, more
  * specific) type. */
-static int tyrank(Inferstate *st, Type *t)
+static int
+tyrank(Inferstate *st, Type *t)
 {
 	/* plain tyvar */
 	if (t->type == Tyvar) {
@@ -920,7 +961,8 @@
 	return 2;
 }
 
-static void unionunify(Inferstate *st, Node *ctx, Type *u, Type *v)
+static void
+unionunify(Inferstate *st, Node *ctx, Type *u, Type *v)
 {
 	size_t i, j;
 	int found;
@@ -952,7 +994,8 @@
 	}
 }
 
-static void structunify(Inferstate *st, Node *ctx, Type *u, Type *v)
+static void
+structunify(Inferstate *st, Node *ctx, Type *u, Type *v)
 {
 	size_t i, j;
 	int found;
@@ -981,7 +1024,8 @@
 	}
 }
 
-static void membunify(Inferstate *st, Node *ctx, Type *u, Type *v)
+static void
+membunify(Inferstate *st, Node *ctx, Type *u, Type *v)
 {
 	if (hthas(st->delayed, u))
 		u = htget(st->delayed, u);
@@ -995,7 +1039,8 @@
 		structunify(st, ctx, u, v);
 }
 
-static Type *basetype(Inferstate *st, Type *a)
+static Type *
+basetype(Inferstate *st, Type *a)
 {
 	Type *t;
 
@@ -1011,7 +1056,8 @@
 	return t;
 }
 
-static void checksize(Inferstate *st, Node *ctx, Type *a, Type *b)
+static void
+checksize(Inferstate *st, Node *ctx, Type *a, Type *b)
 {
 	if (a->asize)
 		a->asize = fold(a->asize, 1);
@@ -1033,13 +1079,15 @@
 				tystr(a), tystr(b), ctxstr(st, ctx));
 }
 
-static int hasargs(Type *t)
+static int
+hasargs(Type *t)
 {
 	return t->type == Tyname && t->narg > 0;
 }
 
 /* Unifies two types, or errors if the types are not unifiable. */
-static Type *unify(Inferstate *st, Node *ctx, Type *u, Type *v)
+static Type *
+unify(Inferstate *st, Node *ctx, Type *u, Type *v)
 {
 	Type *t, *r;
 	Type *a, *b;
@@ -1151,7 +1199,8 @@
 /* Applies unifications to function calls.
  * Funciton application requires a slightly
  * different approach to unification. */
-static void unifycall(Inferstate *st, Node *n)
+static void
+unifycall(Inferstate *st, Node *n)
 {
 	size_t i;
 	Type *ft;
@@ -1191,7 +1240,8 @@
 	settype(st, n, ft->sub[0]);
 }
 
-static void unifyparams(Inferstate *st, Node *ctx, Type *a, Type *b)
+static void
+unifyparams(Inferstate *st, Node *ctx, Type *a, Type *b)
 {
 	size_t i;
 
@@ -1212,7 +1262,8 @@
 		unify(st, ctx, a->arg[i], b->arg[i]);
 }
 
-static void loaduses(Node *n)
+static void
+loaduses(Node *n)
 {
 	size_t i;
 
@@ -1221,7 +1272,8 @@
 		readuse(n->file.uses[i], n->file.globls, Visintern);
 }
 
-static Type *initvar(Inferstate *st, Node *n, Node *s)
+static Type *
+initvar(Inferstate *st, Node *n, Node *s)
 {
 	Type *t, *param;
 	Tysubst *subst;
@@ -1272,7 +1324,8 @@
  * member. If it is, it transforms it into the variable
  * reference we should have, instead of the Omemb expr
  * that we do have */
-static Node *checkns(Inferstate *st, Node *n, Node **ret)
+static Node *
+checkns(Inferstate *st, Node *n, Node **ret)
 {
 	Node *var, *name, *nsname;
 	Node **args;
@@ -1306,7 +1359,8 @@
 	return var;
 }
 
-static void inferstruct(Inferstate *st, Node *n, int *isconst)
+static void
+inferstruct(Inferstate *st, Node *n, int *isconst)
 {
 	size_t i;
 
@@ -1321,7 +1375,8 @@
 	settype(st, n, mktyvar(n->loc));
 }
 
-static int64_t arraysize(Inferstate *st, Node *n)
+static int64_t
+arraysize(Inferstate *st, Node *n)
 {
 	int64_t sz, off, i;
 	Node **args, *idx;
@@ -1351,7 +1406,8 @@
 	return sz;
 }
 
-static void inferarray(Inferstate *st, Node *n, int *isconst)
+static void
+inferarray(Inferstate *st, Node *n, int *isconst)
 {
 	size_t i;
 	Type *t;
@@ -1369,7 +1425,8 @@
 	settype(st, n, t);
 }
 
-static void infertuple(Inferstate *st, Node *n, int *isconst)
+static void
+infertuple(Inferstate *st, Node *n, int *isconst)
 {
 	Type **types;
 	size_t i;
@@ -1385,7 +1442,8 @@
 	settype(st, n, mktytuple(n->loc, types, n->expr.nargs));
 }
 
-static void inferucon(Inferstate *st, Node *n, int *isconst)
+static void
+inferucon(Inferstate *st, Node *n, int *isconst)
 {
 	Ucon *uc;
 	Type *t;
@@ -1410,7 +1468,8 @@
 	tyunbind(st);
 }
 
-static void inferpat(Inferstate *st, Node **np, Node *val, Node ***bind, size_t *nbind)
+static void
+inferpat(Inferstate *st, Node **np, Node *val, Node ***bind, size_t *nbind)
 {
 	size_t i;
 	Node **args;
@@ -1484,7 +1543,8 @@
 	}
 }
 
-void addbindings(Inferstate *st, Node *n, Node **bind, size_t nbind)
+void
+addbindings(Inferstate *st, Node *n, Node **bind, size_t nbind)
 {
 	size_t i;
 
@@ -1496,7 +1556,8 @@
 	}
 }
 
-static void infersub(Inferstate *st, Node *n, Type *ret, int *sawret, int *exprconst)
+static void
+infersub(Inferstate *st, Node *n, Type *ret, int *sawret, int *exprconst)
 {
 	Node **args;
 	size_t i, nargs;
@@ -1523,7 +1584,8 @@
 	*exprconst = n->expr.isconst;
 }
 
-static void inferexpr(Inferstate *st, Node **np, Type *ret, int *sawret)
+static void
+inferexpr(Inferstate *st, Node **np, Type *ret, int *sawret)
 {
 	Node **args;
 	size_t i, nargs;
@@ -1733,7 +1795,7 @@
 				   fatal(n, "unable to find label %s in function scope\n", args[0]->lit.lblname);
 			   *np = s;
 			   break;
-		   default: 
+		   default:
 			   n->expr.isconst = 1;
 			   break;
 		   }
@@ -1786,7 +1848,8 @@
 	}
 }
 
-static void inferfunc(Inferstate *st, Node *n)
+static void
+inferfunc(Inferstate *st, Node *n)
 {
 	size_t i;
 	int sawret;
@@ -1800,7 +1863,8 @@
 		unify(st, n, type(st, n)->sub[0], mktype(Zloc, Tyvoid));
 }
 
-static void specializeimpl(Inferstate *st, Node *n)
+static void
+specializeimpl(Inferstate *st, Node *n)
 {
 	Node *dcl, *proto, *name, *sym;
 	Tysubst *subst;
@@ -1881,7 +1945,8 @@
 	}
 }
 
-static void inferdecl(Inferstate *st, Node *n)
+static void
+inferdecl(Inferstate *st, Node *n)
 {
 	Type *t;
 
@@ -1899,7 +1964,8 @@
 	}
 }
 
-static void inferstab(Inferstate *st, Stab *s)
+static void
+inferstab(Inferstate *st, Stab *s)
 {
 	void **k;
 	size_t n, i;
@@ -1929,7 +1995,8 @@
 	free(k);
 }
 
-static void infernode(Inferstate *st, Node **np, Type *ret, int *sawret)
+static void
+infernode(Inferstate *st, Node **np, Type *ret, int *sawret)
 {
 	size_t i, nbound;
 	Node **bound, *n, *pat;
@@ -2047,9 +2114,10 @@
 	}
 }
 
-/* returns the final type for t, after all unifications
+/* returns the final type for t, after all unification
  * and default constraint selections */
-static Type *tyfix(Inferstate *st, Node *ctx, Type *orig, int noerr)
+static Type *
+tyfix(Inferstate *st, Node *ctx, Type *orig, int noerr)
 {
 	static Type *tyint, *tyflt;
 	Type *t, *delayed, *base;
@@ -2123,13 +2191,15 @@
 	return t;
 }
 
-static void checkcast(Inferstate *st, Node *n, Node ***rem, size_t *nrem, Stab ***remscope, size_t *nremscope)
+static void
+checkcast(Inferstate *st, Node *n, Node ***rem, size_t *nrem, Stab ***remscope, size_t *nremscope)
 {
-	/* FIXME: actually verify the casts. Right now, it's ok to leave this
+	/* FIXME: actually verify the casts. Right now, it's ok to leave thi
 	 * unimplemented because bad casts get caught by the backend. */
 }
 
-static void infercompn(Inferstate *st, Node *n, Node ***rem, size_t *nrem, Stab ***remscope, size_t *nremscope)
+static void
+infercompn(Inferstate *st, Node *n, Node ***rem, size_t *nrem, Stab ***remscope, size_t *nremscope)
 {
 	Node *aggr;
 	Node *memb;
@@ -2150,7 +2220,7 @@
 			constrain(st, n, type(st, n), traittab[Tcint]);
 			found = 1;
 		}
-	/* 
+	/*
  	 * otherwise, we search aggregate types for the member, and unify
 	 * the expression with the member type; ie:
 	 *
@@ -2186,7 +2256,8 @@
 				ctxstr(st, memb), ctxstr(st, aggr));
 }
 
-static void checkstruct(Inferstate *st, Node *n, Node ***rem, size_t *nrem, Stab ***remscope, size_t *nremscope)
+static void
+checkstruct(Inferstate *st, Node *n, Node ***rem, size_t *nrem, Stab ***remscope, size_t *nremscope)
 {
 	Type *t, *et;
 	Node *val, *name;
@@ -2231,7 +2302,8 @@
 	}
 }
 
-static void checkvar(Inferstate *st, Node *n, Node ***rem, size_t *nrem, Stab ***remscope, size_t *nremscope)
+static void
+checkvar(Inferstate *st, Node *n, Node ***rem, size_t *nrem, Stab ***remscope, size_t *nremscope)
 {
 	Node *proto, *dcl;
 	Type *ty;
@@ -2248,7 +2320,8 @@
 	unify(st, n, type(st, n), ty);
 }
 
-static void postcheckpass(Inferstate *st, Node ***rem, size_t *nrem, Stab ***remscope, size_t *nremscope)
+static void
+postcheckpass(Inferstate *st, Node ***rem, size_t *nrem, Stab ***remscope, size_t *nremscope)
 {
 	size_t i;
 	Node *n;
@@ -2267,7 +2340,8 @@
 	}
 }
 
-static void postcheck(Inferstate *st)
+static void
+postcheck(Inferstate *st)
 {
 	size_t nrem, nremscope;
 	Stab **remscope;
@@ -2293,7 +2367,8 @@
 /* After inference, replace all
  * types in symbol tables with
  * the final computed types */
-static void stabsub(Inferstate *st, Stab *s)
+static void
+stabsub(Inferstate *st, Stab *s)
 {
 	void **k;
 	size_t n, i;
@@ -2328,7 +2403,8 @@
 	free(k);
 }
 
-static void checkrange(Inferstate *st, Node *n)
+static void
+checkrange(Inferstate *st, Node *n)
 {
 	Type *t;
 	int64_t sval;
@@ -2361,7 +2437,8 @@
 	}
 }
 
-static int initcompatible(Type *t)
+static int
+initcompatible(Type *t)
 {
 	if (t->type != Tyfunc)
 		return 0;
@@ -2372,7 +2449,8 @@
 	return 1;
 }
 
-static int maincompatible(Type *t)
+static int
+maincompatible(Type *t)
 {
 	if (t->nsub > 2)
 		return 0;
@@ -2392,7 +2470,8 @@
 	return 1;
 }
 
-static void verifyop(Inferstate *st, Node *n)
+static void
+verifyop(Inferstate *st, Node *n)
 {
 	Type *ty;
 
@@ -2411,9 +2490,10 @@
 	}
 }
 
-/* After type inference, replace all types
+/* After type inference, replace all type
  * with the final computed type */
-static void typesub(Inferstate *st, Node *n, int noerr)
+static void
+typesub(Inferstate *st, Node *n, int noerr)
 {
 	size_t i;
 
@@ -2512,7 +2592,8 @@
 	}
 }
 
-static Type *itertype(Inferstate *st, Node *n, Type *ret)
+static Type *
+itertype(Inferstate *st, Node *n, Type *ret)
 {
 	Type *it, *val, *itp, *valp, *fn;
 
@@ -2531,7 +2612,8 @@
 /* Take generics and build new versions of them
  * with the type parameters replaced with the
  * specialized types */
-static void specialize(Inferstate *st, Node *f)
+static void
+specialize(Inferstate *st, Node *f)
 {
 	Node *d, *n, *name;
 	Type *ty, *it;
@@ -2574,7 +2656,8 @@
 	}
 }
 
-void applytraits(Inferstate *st, Node *f)
+void
+applytraits(Inferstate *st, Node *f)
 {
 	size_t i, j;
 	Node *impl, *n;
@@ -2617,7 +2700,8 @@
 	popstab();
 }
 
-void verify(Inferstate *st, Node *f)
+void
+verify(Inferstate *st, Node *f)
 {
 	Node *n;
 	size_t i;
@@ -2635,7 +2719,8 @@
 	}
 }
 
-void infer(Node *file)
+void
+infer(Node *file)
 {
 	Inferstate st = {
 		0,
--- a/parse/node.c
+++ b/parse/node.c
@@ -18,15 +18,24 @@
 Node **decls;
 size_t ndecls;
 
-char *fname(Srcloc l) { return file->file.files[l.file]; }
+char *
+fname(Srcloc l)
+{
+	return file->file.files[l.file];
+}
 
-int lnum(Srcloc l) { return l.line; }
+int
+lnum(Srcloc l)
+{
+	return l.line;
+}
 
 /*
  * Bah, this is going to need to know how to fold things.
  * FIXME: teach it.
  */
-uvlong arraysz(Node *sz)
+uvlong
+arraysz(Node *sz)
 {
 	Node *n;
 
@@ -42,7 +51,8 @@
 	return n->lit.intval;
 }
 
-Node *mknode(Srcloc loc, Ntype nt)
+Node *
+mknode(Srcloc loc, Ntype nt)
 {
 	Node *n;
 
@@ -54,7 +64,8 @@
 	return n;
 }
 
-Node *mkfile(char *name)
+Node *
+mkfile(char *name)
 {
 	Node *n;
 
@@ -64,7 +75,8 @@
 	return n;
 }
 
-Node *mkuse(Srcloc loc, char *use, int islocal)
+Node *
+mkuse(Srcloc loc, char *use, int islocal)
 {
 	Node *n;
 
@@ -75,7 +87,8 @@
 	return n;
 }
 
-Node *mksliceexpr(Srcloc loc, Node *sl, Node *base, Node *off)
+Node *
+mksliceexpr(Srcloc loc, Node *sl, Node *base, Node *off)
 {
 	if (!base)
 		base = mkintlit(loc, 0);
@@ -84,7 +97,8 @@
 	return mkexpr(loc, Oslice, sl, base, off, NULL);
 }
 
-Node *mkexprl(Srcloc loc, Op op, Node **args, size_t nargs)
+Node *
+mkexprl(Srcloc loc, Op op, Node **args, size_t nargs)
 {
 	Node *n;
 
@@ -95,7 +109,8 @@
 	return n;
 }
 
-Node *mkexpr(Srcloc loc, int op, ...)
+Node *
+mkexpr(Srcloc loc, int op, ...)
 {
 	Node *n;
 	va_list ap;
@@ -111,7 +126,8 @@
 	return n;
 }
 
-Node *mkcall(Srcloc loc, Node *fn, Node **args, size_t nargs)
+Node *
+mkcall(Srcloc loc, Node *fn, Node **args, size_t nargs)
 {
 	Node *n;
 	size_t i;
@@ -122,7 +138,8 @@
 	return n;
 }
 
-Node *mkifstmt(Srcloc loc, Node *cond, Node *iftrue, Node *iffalse)
+Node *
+mkifstmt(Srcloc loc, Node *cond, Node *iftrue, Node *iffalse)
 {
 	Node *n;
 
@@ -134,7 +151,8 @@
 	return n;
 }
 
-Node *mkloopstmt(Srcloc loc, Node *init, Node *cond, Node *incr, Node *body)
+Node *
+mkloopstmt(Srcloc loc, Node *init, Node *cond, Node *incr, Node *body)
 {
 	Node *n;
 
@@ -148,7 +166,8 @@
 	return n;
 }
 
-Node *mkiterstmt(Srcloc loc, Node *elt, Node *seq, Node *body)
+Node *
+mkiterstmt(Srcloc loc, Node *elt, Node *seq, Node *body)
 {
 	Node *n;
 
@@ -160,7 +179,8 @@
 	return n;
 }
 
-Node *mkmatchstmt(Srcloc loc, Node *val, Node **matches, size_t nmatches)
+Node *
+mkmatchstmt(Srcloc loc, Node *val, Node **matches, size_t nmatches)
 {
 	Node *n;
 
@@ -171,7 +191,8 @@
 	return n;
 }
 
-Node *mkmatch(Srcloc loc, Node *pat, Node *body)
+Node *
+mkmatch(Srcloc loc, Node *pat, Node *body)
 {
 	Node *n;
 
@@ -181,7 +202,8 @@
 	return n;
 }
 
-Node *mkfunc(Srcloc loc, Node **args, size_t nargs, Type *ret, Node *body)
+Node *
+mkfunc(Srcloc loc, Node **args, size_t nargs, Type *ret, Node *body)
 {
 	Node *n;
 	Node *f;
@@ -205,7 +227,8 @@
 	return n;
 }
 
-Node *mkblock(Srcloc loc, Stab *scope)
+Node *
+mkblock(Srcloc loc, Stab *scope)
 {
 	Node *n;
 
@@ -214,7 +237,8 @@
 	return n;
 }
 
-Node *mkimplstmt(Srcloc loc, Node *name, Type *t, Type **aux, size_t naux, Node **decls, size_t ndecls)
+Node *
+mkimplstmt(Srcloc loc, Node *name, Type *t, Type **aux, size_t naux, Node **decls, size_t ndecls)
 {
 	Node *n;
 
@@ -229,7 +253,8 @@
 	return n;
 }
 
-Node *mklbl(Srcloc loc, char *lbl)
+Node *
+mklbl(Srcloc loc, char *lbl)
 {
 	Node *n;
 
@@ -241,7 +266,8 @@
 	return mkexpr(loc, Olit, n, NULL);
 }
 
-char *genlblstr(char *buf, size_t sz, char *suffix)
+char *
+genlblstr(char *buf, size_t sz, char *suffix)
 {
 	static int nextlbl;
 	size_t len;
@@ -251,7 +277,8 @@
 	return buf;
 }
 
-Node *genlbl(Srcloc loc)
+Node *
+genlbl(Srcloc loc)
 {
 	char buf[128];
 
@@ -259,7 +286,8 @@
 	return mklbl(loc, buf);
 }
 
-Node *mkstr(Srcloc loc, Str val)
+Node *
+mkstr(Srcloc loc, Str val)
 {
 	Node *n;
 
@@ -272,7 +300,8 @@
 	return n;
 }
 
-Node *mkint(Srcloc loc, uvlong val)
+Node *
+mkint(Srcloc loc, uvlong val)
 {
 	Node *n;
 
@@ -283,11 +312,13 @@
 	return n;
 }
 
-Node *mkintlit(Srcloc loc, uvlong val) {
+Node *
+mkintlit(Srcloc loc, uvlong val) {
 	return mkexpr(loc, Olit, mkint(loc, val), NULL);
 }
 
-Node *mkchar(Srcloc loc, uint32_t val)
+Node *
+mkchar(Srcloc loc, uint32_t val)
 {
 	Node *n;
 
@@ -298,7 +329,8 @@
 	return n;
 }
 
-Node *mkfloat(Srcloc loc, double val)
+Node *
+mkfloat(Srcloc loc, double val)
 {
 	Node *n;
 
@@ -309,13 +341,15 @@
 	return n;
 }
 
-Node *mkidxinit(Srcloc loc, Node *idx, Node *init)
+Node *
+mkidxinit(Srcloc loc, Node *idx, Node *init)
 {
 	init->expr.idx = idx;
 	return init;
 }
 
-Node *mkname(Srcloc loc, char *name)
+Node *
+mkname(Srcloc loc, char *name)
 {
 	Node *n;
 
@@ -325,7 +359,8 @@
 	return n;
 }
 
-Node *mknsname(Srcloc loc, char *ns, char *name)
+Node *
+mknsname(Srcloc loc, char *ns, char *name)
 {
 	Node *n;
 
@@ -337,7 +372,8 @@
 	return n;
 }
 
-Node *mkdecl(Srcloc loc, Node *name, Type *ty)
+Node *
+mkdecl(Srcloc loc, Node *name, Type *ty)
 {
 	Node *n;
 
@@ -349,7 +385,8 @@
 	return n;
 }
 
-Node *gentemp(Srcloc loc, Type *ty, Node **dcl)
+Node *
+gentemp(Srcloc loc, Type *ty, Node **dcl)
 {
 	char buf[128];
 	static int nexttmp;
@@ -366,7 +403,8 @@
 	return r;
 }
 
-Ucon *mkucon(Srcloc loc, Node *name, Type *ut, Type *et)
+Ucon *
+mkucon(Srcloc loc, Node *name, Type *ut, Type *et)
 {
 	Ucon *uc;
 
@@ -378,7 +416,8 @@
 	return uc;
 }
 
-Node *mkbool(Srcloc loc, int val)
+Node *
+mkbool(Srcloc loc, int val)
 {
 	Node *n;
 
@@ -389,7 +428,8 @@
 	return n;
 }
 
-Node *mkboollit(Srcloc loc, int val) {
+Node *
+mkboollit(Srcloc loc, int val) {
 	Node *e;
 
 	e = mkexpr(loc, Olit, mkbool(loc, val), NULL);
@@ -397,7 +437,8 @@
 	return e;
 }
 
-Node *mkvoid(Srcloc loc)
+Node *
+mkvoid(Srcloc loc)
 {
 	Node *n;
 
@@ -406,7 +447,8 @@
 	return n;
 }
 
-char *declname(Node *n)
+char *
+declname(Node *n)
 {
 	Node *name;
 	assert(n->type == Ndecl);
@@ -414,19 +456,22 @@
 	return name->name.name;
 }
 
-Type *decltype(Node * n)
+Type *
+decltype(Node * n)
 {
 	assert(n->type == Ndecl);
 	return nodetype(n);
 }
 
-Type *exprtype(Node *n)
+Type *
+exprtype(Node *n)
 {
 	assert(n->type == Nexpr);
 	return nodetype(n);
 }
 
-Type *nodetype(Node *n)
+Type *
+nodetype(Node *n)
 {
 	switch (n->type) {
 	case Ndecl:	return n->decl.type;	break;
@@ -437,12 +482,14 @@
 	return NULL;
 }
 
-int liteq(Node *a, Node *b)
+int
+liteq(Node *a, Node *b)
 {
 	return litvaleq(a, b) && tyeq(a->lit.type, b->lit.type);
 }
 
-int litvaleq(Node *a, Node *b)
+int
+litvaleq(Node *a, Node *b)
 {
 	assert(a->type == Nlit && b->type == Nlit);
 	if (a->lit.littype != b->lit.littype)
@@ -463,7 +510,8 @@
 }
 
 /* name hashing */
-ulong namehash(void *p)
+ulong
+namehash(void *p)
 {
 	Node *n;
 
@@ -471,7 +519,8 @@
 	return strhash(namestr(n)) ^ strhash(n->name.ns);
 }
 
-int nameeq(void *p1, void *p2)
+int
+nameeq(void *p1, void *p2)
 {
 	Node *a, *b;
 	a = p1;
@@ -482,7 +531,8 @@
 	return streq(namestr(a), namestr(b)) && streq(a->name.ns, b->name.ns);
 }
 
-void setns(Node *n, char *ns)
+void
+setns(Node *n, char *ns)
 {
 	assert(!ns || !n->name.ns || !strcmp(n->name.ns, ns));
 
@@ -491,13 +541,15 @@
 	n->name.ns = strdup(ns);
 }
 
-Op exprop(Node *e)
+Op
+exprop(Node *e)
 {
 	assert(e->type == Nexpr);
 	return e->expr.op;
 }
 
-char *namestr(Node *name)
+char *
+namestr(Node *name)
 {
 	if (!name)
 		return "";
@@ -505,7 +557,8 @@
 	return name->name.name;
 }
 
-char *lblstr(Node *n)
+char *
+lblstr(Node *n)
 {
 	assert(exprop(n) == Olit);
 	assert(n->expr.args[0]->type == Nlit);
@@ -513,7 +566,8 @@
 	return n->expr.args[0]->lit.lblval;
 }
 
-static size_t did(Node *n)
+static size_t
+did(Node *n)
 {
 	if (n->type == Ndecl) {
 		return n->decl.did;
@@ -527,7 +581,8 @@
 }
 
 /* Hashes a Ovar expr or an Ndecl  */
-ulong varhash(void *dcl)
+ulong
+varhash(void *dcl)
 {
 	/* large-prime hash. meh. */
 	return did(dcl) * 366787;
@@ -534,4 +589,5 @@
 }
 
 /* Checks if the did of two vars are equal */
-int vareq(void *a, void *b) { return did(a) == did(b); }
+int
+vareq(void *a, void *b) { return did(a) == did(b); }
--- a/parse/specialize.c
+++ b/parse/specialize.c
@@ -15,7 +15,8 @@
 
 static Node *specializenode(Node *g, Tysubst *tsmap);
 
-Tysubst *mksubst()
+Tysubst *
+mksubst()
 {
 	Tysubst *subst;
 
@@ -24,7 +25,8 @@
 	return subst;
 }
 
-void substfree(Tysubst *subst)
+void
+substfree(Tysubst *subst)
 {
 	size_t i;
 
@@ -33,12 +35,14 @@
 	lfree(&subst->subst, &subst->nsubst);
 }
 
-void substpush(Tysubst *subst)
+void
+substpush(Tysubst *subst)
 {
 	lappend(&subst->subst, &subst->nsubst, mkht(tyhash, tyeq));
 }
 
-void substpop(Tysubst *subst)
+void
+substpop(Tysubst *subst)
 {
 	Htab *ht;
 
@@ -46,12 +50,14 @@
 	htfree(ht);
 }
 
-void substput(Tysubst *subst, Type *from, Type *to)
+void
+substput(Tysubst *subst, Type *from, Type *to)
 {
 	htput(subst->subst[subst->nsubst - 1], from, to);
 }
 
-Type *substget(Tysubst *subst, Type *from)
+Type *
+substget(Tysubst *subst, Type *from)
 {
 	Type *t;
 	size_t i;
@@ -65,7 +71,8 @@
 	return t;
 }
 
-void addtraits(Type *t, Bitset *traits)
+void
+addtraits(Type *t, Bitset *traits)
 {
 	size_t b;
 
@@ -76,7 +83,7 @@
 
 /*
  * Duplicates the type 't', with all bound type
- * parameters substituted with the substitions
+ * parameters substituted with the substition
  * described in 'tsmap'
  *
  * Returns a fresh type with all unbound type
@@ -83,7 +90,8 @@
  * parameters (type schemes in most literature)
  * replaced with type variables that we can unify
  * against */
-Type *tyspecialize(Type *orig, Tysubst *tsmap, Htab *delayed, Htab *trbase)
+Type *
+tyspecialize(Type *orig, Tysubst *tsmap, Htab *delayed, Htab *trbase)
 {
 	Type *t, *ret, *tmp, *var, *base;
 	Type **arg;
@@ -162,7 +170,7 @@
 		if (delayed && hthas(delayed, t)) {
 			tmp = htget(delayed, t);
 			htput(delayed, ret, tyspecialize(tmp, tsmap, delayed, trbase));
-		} 
+		}
 		break;
 	default:
 		if (t->nsub > 0) {
@@ -178,10 +186,11 @@
 	return ret;
 }
 
-/* Checks if the type 't' is generic, and if it is
+/* Checks if the type 't' is generic, and if it i
  * substitutes the types. This is here for efficiency,
  * so we don't gratuitously duplicate types */
-static Type *tysubst(Type *t, Tysubst *tsmap)
+static Type *
+tysubst(Type *t, Tysubst *tsmap)
 {
 	if (hasparams(t))
 		return tyspecialize(t, tsmap, NULL, NULL);
@@ -193,7 +202,8 @@
  * Fills the substitution map with a mapping from
  * the type parameter 'from' to it's substititon 'to'
  */
-static void fillsubst(Tysubst *tsmap, Type *to, Type *from)
+static void
+fillsubst(Tysubst *tsmap, Type *to, Type *from)
 {
 	size_t i;
 
@@ -216,7 +226,8 @@
  * Fixes up nodes. This involves fixing up the
  * declaration identifiers once we specialize
  */
-static void fixup(Node *n)
+static void
+fixup(Node *n)
 {
 	size_t i;
 	Node *d;
@@ -312,7 +323,8 @@
  * need to be specialized to make it concrete
  * instead of generic, and returns it.
  */
-static Node *specializenode(Node *n, Tysubst *tsmap)
+static Node *
+specializenode(Node *n, Tysubst *tsmap)
 {
 	Node *r;
 	size_t i;
@@ -437,7 +449,8 @@
 	return r;
 }
 
-Node *genericname(Node *n, Type *param, Type *t)
+Node *
+genericname(Node *n, Type *param, Type *t)
 {
 	char buf[1024];
 	char *p;
@@ -462,7 +475,8 @@
 }
 
 /* this doesn't walk through named types, so it can't recurse infinitely. */
-int matchquality(Type *pat, Type *to)
+int
+matchquality(Type *pat, Type *to)
 {
 	int match, q;
 	size_t i;
@@ -543,7 +557,8 @@
 	return match;
 }
 
-Node *bestimpl(Node *n, Type *to)
+Node *
+bestimpl(Node *n, Type *to)
 {
 	Node **gimpl, **ambig, *match;
 	size_t ngimpl, nambig, i;
@@ -577,10 +592,11 @@
 
 /*
  * Takes a generic declaration, and creates a specialized
- * duplicate of it with type 'to'. It also generates
+ * duplicate of it with type 'to'. It also generate
  * a name for this specialized node, and returns it in '*name'.
  */
-Node *specializedcl(Node *gnode, Type *param, Type *to, Node **name)
+Node *
+specializedcl(Node *gnode, Type *param, Type *to, Node **name)
 {
 	extern int stabstkoff;
 	Tysubst *tsmap;
@@ -648,7 +664,8 @@
  *      ...
  * }
  */
-static Node *initdecl(Node *file, Node *name, Type *tyvoidfn)
+static Node *
+initdecl(Node *file, Node *name, Type *tyvoidfn)
 {
 	Node *dcl;
 
@@ -665,7 +682,8 @@
 	return dcl;
 }
 
-static void callinit(Node *block, Node *init, Type *tyvoid, Type *tyvoidfn)
+static void
+callinit(Node *block, Node *init, Type *tyvoid, Type *tyvoidfn)
 {
 	Node *call, *var;
 
@@ -679,7 +697,8 @@
 	lappend(&block->block.stmts, &block->block.nstmts, call);
 }
 
-void geninit(Node *file)
+void
+geninit(Node *file)
 {
 	Node *name, *decl, *func, *block, *init;
 	Type *tyvoid, *tyvoidfn;
--- a/parse/stab.c
+++ b/parse/stab.c
@@ -33,19 +33,22 @@
 int stabstkoff;
 
 /* scope management */
-Stab *curstab()
+Stab *
+curstab()
 {
 	assert(stabstkoff > 0);
 	return stabstk[stabstkoff - 1];
 }
 
-void pushstab(Stab *st)
+void
+pushstab(Stab *st)
 {
 	assert(stabstkoff < Maxstabdepth);
 	stabstk[stabstkoff++] = st;
 }
 
-void popstab(void)
+void
+popstab(void)
 {
 	assert(stabstkoff > 0);
 	stabstkoff--;
@@ -54,17 +57,20 @@
 /* name hashing: we want namespaced lookups to find the
  * name even if we haven't set the namespace up, since
  * we can update it after the fact. */
-ulong nsnamehash(void *n)
+ulong
+nsnamehash(void *n)
 {
 	return strhash(namestr(n));
 }
 
-int nsnameeq(void *a, void *b)
+int
+nsnameeq(void *a, void *b)
 {
 	return a == b || !strcmp(namestr(a), namestr(b));
 }
 
-static ulong implhash(void *p)
+static ulong
+implhash(void *p)
 {
 	Node *n;
 	ulong h;
@@ -75,7 +81,8 @@
 	return h;
 }
 
-Stab *findstab(Stab *st, Node *n)
+Stab *
+findstab(Stab *st, Node *n)
 {
 	Stab *ns;
 
@@ -90,7 +97,8 @@
 	return st;
 }
 
-static int impleq(void *pa, void *pb)
+static int
+impleq(void *pa, void *pb)
 {
 	Node *a, *b;
 
@@ -101,7 +109,8 @@
 	return 0;
 }
 
-Stab *mkstab(int isfunc)
+Stab *
+mkstab(int isfunc)
 {
 	Stab *st;
 
@@ -119,7 +128,8 @@
 	return st;
 }
 
-Node *getclosed(Stab *st, Node *n)
+Node *
+getclosed(Stab *st, Node *n)
 {
 	while (st && !st->env)
 		st = st->super;
@@ -128,7 +138,8 @@
 	return NULL;
 }
 
-Node **getclosure(Stab *st, size_t *n)
+Node **
+getclosure(Stab *st, size_t *n)
 {
 	size_t nkeys, i;
 	void **keys;
@@ -153,15 +164,16 @@
 
 /*
  * Searches for declarations from current
- * scope, and all enclosing scopes. Does
+ * scope, and all enclosing scopes. Doe
  * not resolve namespaces -- that is the job
  * of the caller of this function.
  *
- * If a resoved name is not global, and is
+ * If a resoved name is not global, and i
  * not in the current scope, it is recorded
  * in the scope's closure.
  */
-Node *getdcl(Stab *st, Node *n)
+Node *
+getdcl(Stab *st, Node *n)
 {
 	Node *s;
 	Stab *fn;
@@ -182,7 +194,8 @@
 	return NULL;
 }
 
-void putlbl(Stab *st, char *name, Node *lbl)
+void
+putlbl(Stab *st, char *name, Node *lbl)
 {
 	assert(st && st->isfunc);
 	if (hthas(st->lbl, name))
@@ -190,7 +203,8 @@
 	htput(st->lbl, name, lbl);
 }
 
-Node *getlbl(Stab *st, Srcloc loc, char *name)
+Node *
+getlbl(Stab *st, Srcloc loc, char *name)
 {
 	while (st && !st->isfunc)
 		st = st->super;
@@ -199,7 +213,8 @@
 	return htget(st->lbl, name);
 }
 
-Type *gettype_l(Stab *st, Node *n)
+Type *
+gettype_l(Stab *st, Node *n)
 {
 	Tydefn *t;
 
@@ -208,7 +223,8 @@
 	return NULL;
 }
 
-Type *gettype(Stab *st, Node *n)
+Type *
+gettype(Stab *st, Node *n)
 {
 	Tydefn *t;
 
@@ -220,7 +236,8 @@
 	return NULL;
 }
 
-int hastype(Stab *st, Node *n)
+int
+hastype(Stab *st, Node *n)
 {
 	do {
 		if (hthas(st->ty, n))
@@ -230,7 +247,8 @@
 	return 0;
 }
 
-Ucon *getucon(Stab *st, Node *n)
+Ucon *
+getucon(Stab *st, Node *n)
 {
 	Ucon *uc;
 
@@ -242,7 +260,8 @@
 	return NULL;
 }
 
-Trait *gettrait(Stab *st, Node *n)
+Trait *
+gettrait(Stab *st, Node *n)
 {
 	Traitdefn *c;
 
@@ -256,11 +275,13 @@
 	return NULL;
 }
 
-Stab *getns(Node *file, char *name) {
+Stab *
+getns(Node *file, char *name) {
 	return htget(file->file.ns, name);
 }
 
-static int mergedecl(Node *old, Node *new)
+static int
+mergedecl(Node *old, Node *new)
 {
 	Node *e, *g;
 
@@ -320,7 +341,8 @@
 	return 1;
 }
 
-void forcedcl(Stab *st, Node *s)
+void
+forcedcl(Stab *st, Node *s)
 {
 	setns(s->decl.name, st->name);
 	htput(st->dcl, s->decl.name, s);
@@ -327,7 +349,8 @@
 	assert(htget(st->dcl, s->decl.name) != NULL);
 }
 
-void putdcl(Stab *st, Node *s)
+void
+putdcl(Stab *st, Node *s)
 {
 	Node *old;
 
@@ -340,7 +363,8 @@
 				lnum(s->loc));
 }
 
-void updatetype(Stab *st, Node *n, Type *t)
+void
+updatetype(Stab *st, Node *n, Type *t)
 {
 	Tydefn *td;
 
@@ -350,7 +374,8 @@
 	td->type = t;
 }
 
-int mergetype(Type *old, Type *new)
+int
+mergetype(Type *old, Type *new)
 {
 	if (!new) {
 		lfatal(old->loc, "double prototyping of %s", tystr(old));
@@ -370,7 +395,8 @@
 	return 0;
 }
 
-void puttype(Stab *st, Node *n, Type *t)
+void
+puttype(Stab *st, Node *n, Type *t)
 {
 	Tydefn *td;
 	Type *ty;
@@ -398,7 +424,8 @@
 	}
 }
 
-void putucon(Stab *st, Ucon *uc)
+void
+putucon(Stab *st, Ucon *uc)
 {
 	Ucon *old;
 
@@ -410,7 +437,8 @@
 	htput(st->uc, uc->name, uc);
 }
 
-static int mergetrait(Trait *old, Trait *new)
+static int
+mergetrait(Trait *old, Trait *new)
 {
 	if (old->isproto && !new->isproto)
 		*old = *new;
@@ -421,7 +449,8 @@
 	return 1;
 }
 
-void puttrait(Stab *st, Node *n, Trait *c)
+void
+puttrait(Stab *st, Node *n, Trait *c)
 {
 	Traitdefn *td;
 	Trait *t;
@@ -444,7 +473,8 @@
 	htput(st->tr, td->name, td);
 }
 
-static int mergeimpl(Node *old, Node *new)
+static int
+mergeimpl(Node *old, Node *new)
 {
 	Vis vis;
 
@@ -466,7 +496,8 @@
 	return 1;
 }
 
-void putimpl(Stab *st, Node *n)
+void
+putimpl(Stab *st, Node *n)
 {
 	Node *impl;
 
@@ -484,7 +515,8 @@
 	htput(st->impl, n, n);
 }
 
-Node *getimpl(Stab *st, Node *n)
+Node *
+getimpl(Stab *st, Node *n)
 {
 	Node *imp;
 
@@ -496,7 +528,8 @@
 	return NULL;
 }
 
-void putns(Node *file, Stab *scope)
+void
+putns(Node *file, Stab *scope)
 {
 	Stab *s;
 
@@ -508,10 +541,11 @@
 
 /*
  * Sets the namespace of a symbol table, and
- * changes the namespace of all contained symbols
+ * changes the namespace of all contained symbol
  * to match it.
  */
-void updatens(Stab *st, char *name)
+void
+updatens(Stab *st, char *name)
 {
 	void **k;
 	size_t i, nk;
--- a/parse/tok.c
+++ b/parse/tok.c
@@ -27,7 +27,8 @@
 static int fbufsz;
 static char *fbuf;
 
-static int peekn(int n)
+static int
+peekn(int n)
 {
 	if (fidx + n >= fbufsz)
 		return End;
@@ -35,9 +36,14 @@
 		return fbuf[fidx + n];
 }
 
-static int peek(void) { return peekn(0); }
+static int
+peek(void)
+{
+	return peekn(0);
+}
 
-static int next(void)
+static int
+next(void)
 {
 	int c;
 
@@ -46,7 +52,8 @@
 	return c;
 }
 
-static void unget(void)
+static void
+unget(void)
 {
 	fidx--;
 	assert(fidx >= 0);
@@ -58,7 +65,8 @@
  * returns true if there was a match,
  * false otherwise.
  */
-static int match(char c)
+static int
+match(char c)
 {
 	if (peek() == c) {
 		next();
@@ -68,7 +76,8 @@
 	}
 }
 
-static Tok *mktok(int tt)
+static Tok *
+mktok(int tt)
 {
 	Tok *t;
 
@@ -78,11 +87,13 @@
 	return t;
 }
 
-static int identchar(int c) {
+static int
+identchar(int c) {
     return isalnum(c) || c == '_' || c == '$';
 }
 
-static void eatcomment(void)
+static void
+eatcomment(void)
 {
 	int depth;
 	int startln;
@@ -121,7 +132,8 @@
  * we also consume '\n'. ';' is still
  * accepted as a line ending.
  */
-static void eatspace(void)
+static void
+eatspace(void)
 {
 	int c;
 	int ignorenl;
@@ -157,7 +169,8 @@
  * token type to use for the
  * identifier.
  */
-static int kwd(char *s)
+static int
+kwd(char *s)
 {
 	static const struct {
 		char *kw;
@@ -211,7 +224,8 @@
 	return Tident;
 }
 
-static int identstr(char *buf, size_t sz)
+static int
+identstr(char *buf, size_t sz)
 {
 	size_t i;
 	char c;
@@ -225,7 +239,8 @@
 	return i;
 }
 
-static Tok *kwident(void)
+static Tok *
+kwident(void)
 {
 	char buf[1024];
 	Tok *t;
@@ -237,7 +252,8 @@
 	return t;
 }
 
-static void append(char **buf, size_t *len, size_t *sz, int c)
+static void
+append(char **buf, size_t *len, size_t *sz, int c)
 {
 	if (!*sz) {
 		*sz = 16;
@@ -252,7 +268,8 @@
 	(*len)++;
 }
 
-static void encode(char *buf, size_t len, uint32_t c)
+static void
+encode(char *buf, size_t len, uint32_t c)
 {
 	int mark;
 	size_t i;
@@ -273,7 +290,8 @@
  * Appends a unicode codepoint 'c' to a growable buffer 'buf',
  * resizing if needed.
  */
-static void appendc(char **buf, size_t *len, size_t *sz, uint32_t c)
+static void
+appendc(char **buf, size_t *len, size_t *sz, uint32_t c)
 {
 	size_t i, charlen;
 	char charbuf[5] = {0};
@@ -294,7 +312,8 @@
 		append(buf, len, sz, charbuf[i]);
 }
 
-static int ishexval(char c)
+static int
+ishexval(char c)
 {
 	if (c >= 'a' && c <= 'f')
 		return 1;
@@ -308,7 +327,8 @@
 /*
  * Converts a character to its hex value.
  */
-static int hexval(char c)
+static int
+hexval(char c)
 {
 	if (c >= 'a' && c <= 'f')
 		return c - 'a' + 10;
@@ -321,7 +341,8 @@
 }
 
 /* \u{abc} */
-static int32_t unichar(void)
+static int32_t
+unichar(void)
 {
 	uint32_t v;
 	int c;
@@ -346,7 +367,8 @@
  * shared between strings and characters.
  * Unknown escape codes are ignored.
  */
-static int decode(char **buf, size_t *len, size_t *sz)
+static int
+decode(char **buf, size_t *len, size_t *sz)
 {
 	char c, c1, c2;
 	int32_t v;
@@ -382,7 +404,8 @@
 	return v;
 }
 
-static Tok *strlit(void)
+static Tok *
+strlit(void)
 {
 	Tok *t;
 	int c;
@@ -418,7 +441,8 @@
 	return t;
 }
 
-static uint32_t readutf(char c, char **buf, size_t *buflen, size_t *sz)
+static uint32_t
+readutf(char c, char **buf, size_t *buflen, size_t *sz)
 {
 	size_t i, len;
 	uint32_t val;
@@ -446,7 +470,8 @@
 	return val;
 }
 
-static Tok *charlit(void)
+static Tok *
+charlit(void)
 {
 	Tok *t;
 	int c;
@@ -479,7 +504,8 @@
 	return t;
 }
 
-static Tok *oper(void)
+static Tok *
+oper(void)
 {
 	int tt;
 	char c;
@@ -623,7 +649,8 @@
 	return mktok(tt);
 }
 
-static Tok *number(int base)
+static Tok *
+number(int base)
 {
 	Tok *t;
 	int start;
@@ -694,7 +721,8 @@
 		 *   b -> 8 bit
 		 */
 		unsignedval = 0;
-nextsuffix:
+nextsuffix
+:
 		switch (peek()) {
 		case 'u':
 			if (unsignedval == 1)
@@ -741,7 +769,8 @@
 	return t;
 }
 
-static Tok *numlit(void)
+static Tok *
+numlit(void)
 {
 	Tok *t;
 
@@ -764,7 +793,8 @@
 	return t;
 }
 
-static Tok *typaram(void)
+static Tok *
+typaram(void)
 {
 	Tok *t;
 	char buf[1024];
@@ -779,7 +809,8 @@
 	return t;
 }
 
-static Tok *toknext(void)
+static Tok *
+toknext(void)
 {
 	Tok *t;
 	int c;
@@ -811,7 +842,8 @@
 	return t;
 }
 
-void tokinit(char *file)
+void
+tokinit(char *file)
 {
 	int fd;
 	int n;
@@ -845,7 +877,8 @@
 }
 
 /* Interface to yacc */
-int yylex(void)
+int
+yylex(void)
 {
 	curtok = toknext();
 	yylval.tok = curtok;
@@ -852,7 +885,8 @@
 	return curtok->type;
 }
 
-void yyerror(const char *s)
+void
+yyerror(const char *s)
 {
 	fprintf(stderr, "%s:%d: %s", filename, curloc.line, s);
 	if (curtok->id)
--- a/parse/type.c
+++ b/parse/type.c
@@ -39,9 +39,14 @@
 #undef Ty
 };
 
-int isstacktype(Type *t) { return stackness[tybase(t)->type]; }
+int
+isstacktype(Type *t)
+{
+	return stackness[tybase(t)->type];
+}
 
-Type *tydedup(Type *ty)
+Type *
+tydedup(Type *ty)
 {
 	Type *had;
 
@@ -55,7 +60,8 @@
 	return had;
 }
 
-Type *mktype(Srcloc loc, Ty ty)
+Type *
+mktype(Srcloc loc, Ty ty)
 {
 	Type *t;
 	int i;
@@ -91,7 +97,8 @@
  * Shallowly duplicates a type, so we can frob
  * its internals later
  */
-Type *tydup(Type *t)
+Type *
+tydup(Type *t)
 {
 	Type *r;
 
@@ -125,7 +132,8 @@
  * Creates a Tyvar with the same
  * constrants as the 'like' type
  */
-Type *mktylike(Srcloc loc, Ty like)
+Type *
+mktylike(Srcloc loc, Ty like)
 {
 	Type *t;
 	int i;
@@ -137,7 +145,8 @@
 }
 
 /* steals memb, funcs */
-Trait *mktrait(Srcloc loc, Node *name, Type *param,
+Trait *
+mktrait(Srcloc loc, Node *name, Type *param,
 	Type **aux, size_t naux,
 	Node **proto, size_t nproto,
 	int isproto)
@@ -163,7 +172,8 @@
 	return t;
 }
 
-Type *mktyvar(Srcloc loc)
+Type *
+mktyvar(Srcloc loc)
 {
 	Type *t;
 
@@ -171,7 +181,8 @@
 	return t;
 }
 
-Type *mktyparam(Srcloc loc, char *name)
+Type *
+mktyparam(Srcloc loc, char *name)
 {
 	Type *t;
 
@@ -180,7 +191,8 @@
 	return t;
 }
 
-Type *mktyunres(Srcloc loc, Node *name, Type **arg, size_t narg)
+Type *
+mktyunres(Srcloc loc, Node *name, Type **arg, size_t narg)
 {
 	Type *t;
 
@@ -192,7 +204,8 @@
 	return t;
 }
 
-Type *mktygeneric(Srcloc loc, Node *name, Type **param, size_t nparam, Type *base)
+Type *
+mktygeneric(Srcloc loc, Node *name, Type **param, size_t nparam, Type *base)
 {
 	Type *t;
 
@@ -207,7 +220,8 @@
 	return t;
 }
 
-Type *mktyname(Srcloc loc, Node *name, Type *base)
+Type *
+mktyname(Srcloc loc, Node *name, Type *base)
 {
 	Type *t;
 
@@ -220,7 +234,8 @@
 	return t;
 }
 
-Type *mktyarray(Srcloc loc, Type *base, Node *sz)
+Type *
+mktyarray(Srcloc loc, Type *base, Node *sz)
 {
 	Type *t;
 
@@ -234,7 +249,8 @@
 	return t;
 }
 
-Type *mktyslice(Srcloc loc, Type *base)
+Type *
+mktyslice(Srcloc loc, Type *base)
 {
 	Type *t;
 
@@ -245,7 +261,8 @@
 	return t;
 }
 
-Type *mktyptr(Srcloc loc, Type *base)
+Type *
+mktyptr(Srcloc loc, Type *base)
 {
 	Type *t;
 
@@ -256,7 +273,8 @@
 	return t;
 }
 
-Type *mktytuple(Srcloc loc, Type **sub, size_t nsub)
+Type *
+mktytuple(Srcloc loc, Type **sub, size_t nsub)
 {
 	Type *t;
 	size_t i;
@@ -269,7 +287,8 @@
 	return t;
 }
 
-Type *mktyfunc(Srcloc loc, Node **args, size_t nargs, Type *ret)
+Type *
+mktyfunc(Srcloc loc, Node **args, size_t nargs, Type *ret)
 {
 	Type *t;
 	size_t i;
@@ -283,7 +302,8 @@
 	return t;
 }
 
-Type *mktystruct(Srcloc loc, Node **decls, size_t ndecls)
+Type *
+mktystruct(Srcloc loc, Node **decls, size_t ndecls)
 {
 	Type *t;
 	Htab *ht;
@@ -307,7 +327,8 @@
 	return t;
 }
 
-Type *mktyunion(Srcloc loc, Ucon **decls, size_t ndecls)
+Type *
+mktyunion(Srcloc loc, Ucon **decls, size_t ndecls)
 {
 	Type *t;
 
@@ -317,7 +338,8 @@
 	return t;
 }
 
-Ucon *finducon(Type *ty, Node *name)
+Ucon *
+finducon(Type *ty, Node *name)
 {
 	size_t i;
 
@@ -328,7 +350,8 @@
 	return NULL;
 }
 
-int istyunsigned(Type *t)
+int
+istyunsigned(Type *t)
 {
 	switch (tybase(t)->type) {
 	case Tybyte:
@@ -343,7 +366,8 @@
 	}
 }
 
-int istysigned(Type *t)
+int
+istysigned(Type *t)
 {
 	switch (tybase(t)->type) {
 	case Tyint8:
@@ -355,19 +379,22 @@
 	}
 }
 
-int istyfloat(Type *t)
+int
+istyfloat(Type *t)
 {
 	t = tybase(t);
 	return t->type == Tyflt32 || t->type == Tyflt64;
 }
 
-int istyprimitive(Type *t) { return istysigned(t) || istyunsigned(t) || istyfloat(t); }
+int
+istyprimitive(Type *t) { return istysigned(t) || istyunsigned(t) || istyfloat(t); }
 
 /*
  * Checks if a type contains any type
  * parameers at all (ie, if it generic).
  */
-int hasparamsrec(Type *t, Bitset *visited)
+int
+hasparamsrec(Type *t, Bitset *visited)
 {
 	size_t i;
 
@@ -406,7 +433,8 @@
 	return 0;
 }
 
-int hasparams(Type *t)
+int
+hasparams(Type *t)
 {
 	Bitset *visited;
 
@@ -418,7 +446,8 @@
 	return t->hasparams;
 }
 
-Type *tybase(Type *t)
+Type *
+tybase(Type *t)
 {
 	assert(t != NULL);
 	while (t->type == Tyname || t->type == Tygeneric)
@@ -426,7 +455,8 @@
 	return t;
 }
 
-static int namefmt(char *buf, size_t len, Node *n)
+static int
+namefmt(char *buf, size_t len, Node *n)
 {
 	char *p;
 	char *end;
@@ -439,7 +469,8 @@
 	return len - (end - p);
 }
 
-int settrait(Type *t, Trait *c)
+int
+settrait(Type *t, Trait *c)
 {
 	if (!t->traits)
 		t->traits = mkbs();
@@ -447,9 +478,11 @@
 	return 1;
 }
 
-int hastrait(Type *t, Trait *c) { return t->traits && bshas(t->traits, c->uid); }
+int
+hastrait(Type *t, Trait *c) { return t->traits && bshas(t->traits, c->uid); }
 
-int traitfmt(char *buf, size_t len, Type *t)
+int
+traitfmt(char *buf, size_t len, Type *t)
 {
 	size_t i;
 	char *p;
@@ -473,7 +506,8 @@
 	return p - buf;
 }
 
-static int fmtstruct(char *buf, size_t len, Bitset *visited, Type *t)
+static int
+fmtstruct(char *buf, size_t len, Bitset *visited, Type *t)
 {
 	size_t i;
 	char *end, *p;
@@ -492,7 +526,8 @@
 	return p - buf;
 }
 
-static int fmtunion(char *buf, size_t len, Bitset *visited, Type *t)
+static int
+fmtunion(char *buf, size_t len, Bitset *visited, Type *t)
 {
 	char subbuf[512];
 	char *name, *ns, *sep;
@@ -524,7 +559,8 @@
 	return p - buf;
 }
 
-static int fmtlist(char *buf, size_t len, Bitset *visited, Type **arg, size_t narg)
+static int
+fmtlist(char *buf, size_t len, Bitset *visited, Type **arg, size_t narg)
 {
 	char *end, *p, *sep;
 	size_t i;
@@ -542,7 +578,8 @@
 	return p - buf;
 }
 
-static int tybfmt(char *buf, size_t len, Bitset *visited, Type *t)
+static int
+tybfmt(char *buf, size_t len, Bitset *visited, Type *t)
 {
 	size_t i;
 	char *p;
@@ -658,7 +695,8 @@
 	return p - buf;
 }
 
-char *tyfmt(char *buf, size_t len, Type *t)
+char *
+tyfmt(char *buf, size_t len, Type *t)
 {
 	Bitset *bs;
 
@@ -668,7 +706,8 @@
 	return buf;
 }
 
-char *traitstr(Type *t)
+char *
+traitstr(Type *t)
 {
 	char buf[1024];
 	traitfmt(buf, 1024, t);
@@ -675,7 +714,8 @@
 	return strdup(buf);
 }
 
-char *tystr(Type *t)
+char *
+tystr(Type *t)
 {
 	char buf[1024];
 	tyfmt(buf, 1024, t);
@@ -682,7 +722,8 @@
 	return strdup(buf);
 }
 
-ulong tyhash(void *ty)
+ulong
+tyhash(void *ty)
 {
 	size_t i;
 	Type *t;
@@ -703,7 +744,8 @@
 	return hash;
 }
 
-int tyeq_rec(Type *a, Type *b, Bitset *avisited, Bitset *bvisited, int search)
+int
+tyeq_rec(Type *a, Type *b, Bitset *avisited, Bitset *bvisited, int search)
 {
 	Type *x, *y;
 	size_t i;
@@ -804,7 +846,8 @@
 	return ret;
 }
 
-int tystricteq(void *a, void *b)
+int
+tystricteq(void *a, void *b)
 {
 	Bitset *avisited, *bvisited;
 	int eq;
@@ -819,7 +862,8 @@
 	return eq;
 }
 
-int tyeq(void *a, void *b)
+int
+tyeq(void *a, void *b)
 {
 	Bitset *avisited, *bvisited;
 	int eq;
@@ -834,7 +878,8 @@
 	return eq;
 }
 
-size_t tyidfmt(char *buf, size_t sz, Type *ty)
+size_t
+tyidfmt(char *buf, size_t sz, Type *ty)
 {
 	size_t i;
 	char *p, *end;
@@ -919,7 +964,8 @@
 	return p - buf;
 }
 
-void iterableinit(Stab *st, Trait *tr)
+void
+iterableinit(Stab *st, Trait *tr)
 {
 	Node *func, *arg, **args;
 	Type *ty;
@@ -942,7 +988,7 @@
 
 	func = mkdecl(Zloc, mkname(Zloc, "__iternext__"), ty);
 	func->decl.trait = tr;
-	func->decl.impls = mkht(tyhash, tyeq); 
+	func->decl.impls = mkht(tyhash, tyeq);
 	func->decl.isgeneric = 1;
 	func->decl.isconst = 1;
 	func->decl.isglobl = 1;
@@ -962,7 +1008,7 @@
 
 	func = mkdecl(Zloc, mkname(Zloc, "__iterfin__"), ty);
 	func->decl.trait = tr;
-	func->decl.impls = mkht(tyhash, tyeq); 
+	func->decl.impls = mkht(tyhash, tyeq);
 	func->decl.isgeneric = 1;
 	func->decl.isconst = 1;
 	func->decl.isglobl = 1;
@@ -972,7 +1018,8 @@
 	putdcl(st, func);
 }
 
-void tyinit(Stab *st)
+void
+tyinit(Stab *st)
 {
 	int i;
 	Type *ty;
--- a/parse/use.c
+++ b/parse/use.c
@@ -38,9 +38,9 @@
 /* type fixup list */
 static Htab *tydeduptab;	/* map from name -> type, contains all Tynames loaded ever */
 static Htab *trdeduptab;	/* map from name -> type, contains all Tynames loaded ever */
-static Htab *tidmap;	/* map from tid -> type */
-static Htab *trmap;	/* map from trait id -> trait */
-static Htab *initmap;	/* map from init name -> int */
+static Htab *tidmap;		/* map from tid -> type */
+static Htab *trmap;		/* map from trait id -> trait */
+static Htab *initmap;		/* map from init name -> int */
 
 #define Builtinmask (1 << 30)
 static Typefix *typefix;	/* list of types we need to replace */
@@ -49,10 +49,11 @@
 static Traitfix *traitfix;	/* list of traits we need to replace */
 static size_t ntraitfix;	/* size of replacement list */
 
-static Node **implfix;	/* list of impls we need to fix up */
+static Node **implfix;		/* list of impls we need to fix up */
 static size_t nimplfix;		/* size of replacement list */
 
-void addextlibs(Node *file, char **libs, size_t nlibs)
+void
+addextlibs(Node *file, char **libs, size_t nlibs)
 {
 	size_t i, j;
 
@@ -65,9 +66,10 @@
 }
 
 /* Outputs a symbol table to file in a way that can be
- * read back usefully. Only writes declarations, types
+ * read back usefully. Only writes declarations, type
  * and sub-namespaces. Captured variables are ommitted. */
-static void wrstab(FILE *fd, Stab *val)
+static void
+wrstab(FILE *fd, Stab *val)
 {
 	size_t n, i;
 	void **keys;
@@ -93,7 +95,8 @@
 
 /* Reads a symbol table from file. The converse
  * of wrstab. */
-static Stab *rdstab(FILE *fd, int isfunc)
+static Stab *
+rdstab(FILE *fd, int isfunc)
 {
 	Stab *st;
 	Type *ty;
@@ -118,7 +121,8 @@
 	return st;
 }
 
-static void wrucon(FILE *fd, Ucon *uc)
+static void
+wrucon(FILE *fd, Ucon *uc)
 {
 	wrint(fd, uc->loc.line);
 	wrint(fd, uc->id);
@@ -129,7 +133,8 @@
 		wrtype(fd, uc->etype);
 }
 
-static Ucon *rducon(FILE *fd, Type *ut)
+static Ucon *
+rducon(FILE *fd, Type *ut)
 {
 	Type *et;
 	Node *name;
@@ -154,10 +159,11 @@
 }
 
 /* Writes the name and type of a variable,
- * but only writes its intializer for things
+ * but only writes its intializer for thing
  * we want to inline cross-file (currently,
  * the only cross-file inline is generics) */
-static void wrsym(FILE *fd, Node *val)
+static void
+wrsym(FILE *fd, Node *val)
 {
 	/* sym */
 	wrint(fd, val->loc.line);
@@ -177,7 +183,8 @@
 		pickle(fd, val->decl.init);
 }
 
-static Node *rdsym(FILE *fd, Trait *ctx)
+static Node *
+rdsym(FILE *fd, Trait *ctx)
 {
 	int line;
 	Node *name;
@@ -209,7 +216,8 @@
 /* Writes types to a file. Errors on
  * internal only types like Tyvar that
  * will not be meaningful in another file*/
-static void typickle(FILE *fd, Type *ty)
+static void
+typickle(FILE *fd, Type *ty)
 {
 	size_t i;
 
@@ -221,7 +229,7 @@
 	wrbyte(fd, ty->vis);
 	/* tid is generated; don't write */
 	/* FIXME: since we only support hardcoded traits, we just write
-	* out the set of them. we should write out the trait list as
+	* out the set of them. we should write out the trait list a
 	* well */
 	if (!ty->traits) {
 		wrint(fd, 0);
@@ -277,7 +285,8 @@
 	}
 }
 
-static void traitpickle(FILE *fd, Trait *tr)
+static void
+traitpickle(FILE *fd, Trait *tr)
 {
 	size_t i;
 
@@ -293,7 +302,8 @@
 		wrsym(fd, tr->proto[i]);
 }
 
-static void wrtype(FILE *fd, Type *ty)
+static void
+wrtype(FILE *fd, Type *ty)
 {
 	if (ty->tid >= Builtinmask)
 		die("Type id %d for %s too big", ty->tid, tystr(ty));
@@ -303,7 +313,8 @@
 		wrint(fd, ty->tid);
 }
 
-static void rdtype(FILE *fd, Type **dest)
+static void
+rdtype(FILE *fd, Type **dest)
 {
 	uintptr_t tid;
 
@@ -316,7 +327,8 @@
 	}
 }
 
-static void rdtrait(FILE *fd, Trait **dest, Type *ty)
+static void
+rdtrait(FILE *fd, Trait **dest, Type *ty)
 {
 	uintptr_t tid;
 
@@ -335,7 +347,8 @@
 /* Writes types to a file. Errors on
  * internal only types like Tyvar that
  * will not be meaningful in another file */
-static Type *tyunpickle(FILE *fd)
+static Type *
+tyunpickle(FILE *fd)
 {
 	size_t i, n;
 	Type *ty;
@@ -401,7 +414,8 @@
 	return ty;
 }
 
-Trait *traitunpickle(FILE *fd)
+Trait *
+traitunpickle(FILE *fd)
 {
 	Trait *tr;
 	Node *proto;
@@ -409,7 +423,7 @@
 	intptr_t uid;
 
 	/* create an empty trait */
-	tr = mktrait(Zloc, NULL, NULL, 
+	tr = mktrait(Zloc, NULL, NULL,
 		NULL, 0,
 		NULL, 0,
 		0);
@@ -439,7 +453,8 @@
  * in-memory representation. Minimal
  * checking is done, so a bad type can
  * crash the compiler */
-static void pickle(FILE *fd, Node *n)
+static void
+pickle(FILE *fd, Node *n)
 {
 	size_t i;
 
@@ -572,7 +587,8 @@
 /* Unpickles a node from a file. Minimal checking
  * is done. Specifically, no checks are done for
  * sane arities, a bad file can crash the compiler */
-static Node *unpickle(FILE *fd)
+static Node *
+unpickle(FILE *fd)
 {
 	size_t i;
 	Ntype type;
@@ -722,7 +738,8 @@
 	return n;
 }
 
-static Stab *findstab(Stab *st, char *pkg)
+static Stab *
+findstab(Stab *st, char *pkg)
 {
 	Stab *s;
 
@@ -742,7 +759,8 @@
 	return s;
 }
 
-static int isspecialization(Type *t1, Type *t2)
+static int
+isspecialization(Type *t1, Type *t2)
 {
 	if ((t1->type != Tygeneric || t2->type != Tyname) &&
 			(t1->type != Tyname || t2->type != Tygeneric) &&
@@ -752,7 +770,8 @@
 	return nameeq(t1->name, t2->name);
 }
 
-static void fixtypemappings(Stab *st)
+static void
+fixtypemappings(Stab *st)
 {
 	size_t i;
 	Type *t, *u, *old;
@@ -760,7 +779,7 @@
 	/*
 	* merge duplicate definitions.
 	* This allows us to compare named types by id, instead
-	* of doing a deep walk through the type. This ability is
+	* of doing a deep walk through the type. This ability i
 	* depended on when we do type inference.
 	*/
 	for (i = 0; i < ntypefix; i++) {
@@ -796,7 +815,8 @@
 	lfree(&typefix, &ntypefix);
 }
 
-static void fixtraitmappings(Stab *st)
+static void
+fixtraitmappings(Stab *st)
 {
 	size_t i;
 	Trait *t, *tr;
@@ -804,7 +824,7 @@
 	/*
 	* merge duplicate definitions.
 	* This allows us to compare named types by id, instead
-	* of doing a deep walk through the type. This ability is
+	* of doing a deep walk through the type. This ability i
 	* depended on when we do type inference.
 	*/
 	for (i = 0; i < ntraitfix; i++) {
@@ -828,7 +848,8 @@
 	ntraitfix = 0;
 }
 
-static void protomap(Trait *tr, Type *ty, Node *dcl)
+static void
+protomap(Trait *tr, Type *ty, Node *dcl)
 {
 	size_t i, len;
 	char *protoname, *dclname, *p;
@@ -852,7 +873,8 @@
 	}
 }
 
-static void fiximplmappings(Stab *st)
+static void
+fiximplmappings(Stab *st)
 {
 	Node *impl;
 	Trait *tr;
@@ -882,7 +904,8 @@
  *     D<picled-decl>
  *     G<pickled-decl><pickled-initializer>
  */
-int loaduse(char *path, FILE *f, Stab *st, Vis vis)
+int
+loaduse(char *path, FILE *f, Stab *st, Vis vis)
 {
 	intptr_t tid;
 	size_t i;
@@ -946,7 +969,8 @@
 					/* break out of both loop and switch */
 					goto foundlib;
 			lappend(&file->file.libdeps, &file->file.nlibdeps, lib);
-foundlib:
+foundlib
+:
 			break;
 		case 'X':
 			lib = rdstr(f);
@@ -955,7 +979,8 @@
 					/* break out of both loop and switch */
 					goto foundextlib;
 			lappend(&file->file.extlibs, &file->file.nextlibs, lib);
-foundextlib:
+foundextlib
+:
 			break;
 		case 'F': lappend(&file->file.files, &file->file.nfiles, rdstr(f)); break;
 		case 'G':
@@ -1029,7 +1054,8 @@
 	return 1;
 }
 
-int hassuffix(char *str, char *suff)
+int
+hassuffix(char *str, char *suff)
 {
 	size_t nstr, nsuff;
 
@@ -1040,7 +1066,8 @@
 	return !strcmp(str + nstr - nsuff, suff);
 }
 
-void readuse(Node *use, Stab *st, Vis vis)
+void
+readuse(Node *use, Stab *st, Vis vis)
 {
 	size_t i;
 	FILE *fd;
@@ -1102,7 +1129,8 @@
  * G<pickled-decl><pickled-initializer>
  * Z
  */
-void writeuse(FILE *f, Node *file)
+void
+writeuse(FILE *f, Node *file)
 {
 	Stab *st;
 	void **k;
--- a/util/alloc.c
+++ b/util/alloc.c
@@ -15,7 +15,8 @@
 
 /* Some systems don't have strndup. */
 /* malloc wrappers */
-void *zalloc(size_t sz)
+void *
+zalloc(size_t sz)
 {
 	void *mem;
 
@@ -25,7 +26,8 @@
 	return mem;
 }
 
-void *xalloc(size_t sz)
+void *
+xalloc(size_t sz)
 {
 	void *mem;
 
@@ -35,7 +37,8 @@
 	return mem;
 }
 
-void *zrealloc(void *mem, size_t oldsz, size_t sz)
+void *
+zrealloc(void *mem, size_t oldsz, size_t sz)
 {
 	char *p;
 
@@ -45,7 +48,8 @@
 	return p;
 }
 
-void *xrealloc(void *mem, size_t sz)
+void *
+xrealloc(void *mem, size_t sz)
 {
 	mem = realloc(mem, sz);
 	if (!mem && sz)
@@ -54,7 +58,8 @@
 }
 
 /* lists */
-void lappend(void *l, size_t *len, void *n)
+void
+lappend(void *l, size_t *len, void *n)
 {
 	void ***pl;
 
@@ -64,7 +69,8 @@
 	(*len)++;
 }
 
-void *lpop(void *l, size_t *len)
+void *
+lpop(void *l, size_t *len)
 {
 	void ***pl;
 	void *v;
@@ -76,7 +82,8 @@
 	return v;
 }
 
-void linsert(void *p, size_t *len, size_t idx, void *v)
+void
+linsert(void *p, size_t *len, size_t idx, void *v)
 {
 	void ***pl, **l;
 
@@ -89,7 +96,8 @@
 	(*len)++;
 }
 
-void ldel(void *p, size_t *len, size_t idx)
+void
+ldel(void *p, size_t *len, size_t idx)
 {
 	void ***pl, **l;
 
@@ -102,7 +110,8 @@
 	*pl = xrealloc(l, *len * sizeof(void *));
 }
 
-void lcat(void *dst, size_t *ndst, void *src, size_t nsrc)
+void
+lcat(void *dst, size_t *ndst, void *src, size_t nsrc)
 {
 	size_t i;
 	void ***d, **s;
@@ -113,7 +122,8 @@
 		lappend(d, ndst, s[i]);
 }
 
-void lfree(void *l, size_t *len)
+void
+lfree(void *l, size_t *len)
 {
 	void ***pl;
 
@@ -124,7 +134,8 @@
 	*len = 0;
 }
 
-void *memdup(void *mem, size_t len)
+void *
+memdup(void *mem, size_t len)
 {
 	void *ret;
 
--- a/util/bitset.c
+++ b/util/bitset.c
@@ -17,7 +17,8 @@
  * over both without keeping track of the
  * minimum size.
  */
-static void eqsz(Bitset *a, Bitset *b)
+static void
+eqsz(Bitset *a, Bitset *b)
 {
 	size_t sz;
 	size_t i;
@@ -48,7 +49,8 @@
 }
 
 /* Creates a new all-zero bit set */
-Bitset *mkbs()
+Bitset *
+mkbs()
 {
 	Bitset *bs;
 
@@ -59,7 +61,8 @@
 }
 
 /* Frees a bitset. Safe to call on NULL. */
-void bsfree(Bitset *bs)
+void
+bsfree(Bitset *bs)
 {
 	if (!bs)
 		return;
@@ -68,7 +71,8 @@
 }
 
 /* Duplicates a bitset. NULL is duplicated to NULL. */
-Bitset *bsdup(Bitset *a)
+Bitset *
+bsdup(Bitset *a)
 {
 	Bitset *bs;
 
@@ -82,7 +86,8 @@
 }
 
 /* Zeroes all values in a bit set */
-Bitset *bsclear(Bitset *bs)
+Bitset *
+bsclear(Bitset *bs)
 {
 	size_t i;
 
@@ -94,7 +99,8 @@
 }
 
 /* Counts the number of values held in a bit set */
-size_t bscount(Bitset *bs)
+size_t
+bscount(Bitset *bs)
 {
 	size_t i, j, n;
 
@@ -106,7 +112,8 @@
 	return n;
 }
 
-inline static int firstbit(size_t b)
+inline
+static int firstbit(size_t b)
 {
 	int n;
 	static const char bits[] = {
@@ -134,7 +141,7 @@
 	return n;
 }
 
-/* A slightly tricky function to iterate over the contents
+/* A slightly tricky function to iterate over the content
  * of a bitset. It returns true immediately if 'elt' is in
  * the bitset, otherwise it seeks forward to the next value
  * held in the bitset and stores it in elt. If there are no
@@ -151,7 +158,8 @@
  * to prevent the function from returning the same value
  * repeatedly.
  */
-int bsiter(Bitset *bs, size_t *elt)
+int
+bsiter(Bitset *bs, size_t *elt)
 {
 	size_t b, t, i;
 
@@ -175,9 +183,11 @@
 /* Returns the largest value that the bitset can possibly
  * hold. It's conservative, but scanning the entire bitset
  * is a bit slow. This is mostly an aid to iterate over it. */
-size_t bsmax(Bitset *bs) { return bs->nchunks * Sizetbits; }
+size_t
+bsmax(Bitset *bs) { return bs->nchunks * Sizetbits; }
 
-void bsput(Bitset *bs, size_t elt)
+void
+bsput(Bitset *bs, size_t elt)
 {
 	size_t sz;
 	if (elt >= bs->nchunks * Sizetbits) {
@@ -188,13 +198,15 @@
 	bs->chunks[elt / Sizetbits] |= 1ULL << (elt % Sizetbits);
 }
 
-void bsdel(Bitset *bs, size_t elt)
+void
+bsdel(Bitset *bs, size_t elt)
 {
 	if (elt < bs->nchunks * Sizetbits)
 		bs->chunks[elt / Sizetbits] &= ~(1ULL << (elt % Sizetbits));
 }
 
-void bsunion(Bitset *a, Bitset *b)
+void
+bsunion(Bitset *a, Bitset *b)
 {
 	size_t i;
 
@@ -203,7 +215,8 @@
 		a->chunks[i] |= b->chunks[i];
 }
 
-void bsintersect(Bitset *a, Bitset *b)
+void
+bsintersect(Bitset *a, Bitset *b)
 {
 	size_t i;
 
@@ -212,7 +225,8 @@
 		a->chunks[i] &= b->chunks[i];
 }
 
-void bsdiff(Bitset *a, Bitset *b)
+void
+bsdiff(Bitset *a, Bitset *b)
 {
 	size_t i;
 
@@ -221,7 +235,8 @@
 		a->chunks[i] &= ~b->chunks[i];
 }
 
-int bseq(Bitset *a, Bitset *b)
+int
+bseq(Bitset *a, Bitset *b)
 {
 	size_t i;
 
@@ -235,7 +250,8 @@
 	return 1;
 }
 
-int bsissubset(Bitset *set, Bitset *sub)
+int
+bsissubset(Bitset *set, Bitset *sub)
 {
 	size_t i;
 
@@ -246,7 +262,8 @@
 	return 1;
 }
 
-int bsisempty(Bitset *set)
+int
+bsisempty(Bitset *set)
 {
 	size_t i;
 
--- a/util/htab.c
+++ b/util/htab.c
@@ -11,12 +11,13 @@
 #define Initsz 16
 #define Seed 2928213749
 
-ulong murmurhash2(void *key, size_t len);
+static ulong murmurhash2(void *key, size_t len);
 
 /* Creates a new empty hash table, using 'hash' as the
  * hash funciton, and 'cmp' to verify that there are no
  * hash collisions. */
-Htab *mkht(ulong (*hash)(void *key), int (*cmp)(void *k1, void *k2))
+Htab *
+mkht(ulong (*hash)(void *key), int (*cmp)(void *k1, void *k2))
 {
 	Htab *ht;
 
@@ -36,7 +37,8 @@
 
 /* Frees a hash table. Passing this function
  * NULL is a no-op. */
-void htfree(Htab *ht)
+void
+htfree(Htab *ht)
 {
 	if (!ht)
 		return;
@@ -49,7 +51,8 @@
 
 /* Offsets the hash so that '0' can be
  * used as a 'no valid value */
-static ulong hash(Htab *ht, void *k)
+static ulong
+hash(Htab *ht, void *k)
 {
 	ulong h;
 	h = ht->hash(k);
@@ -62,7 +65,8 @@
 /* Resizes the hash table by copying all
  * the old keys into the right slots in a
  * new table. */
-static void grow(Htab *ht, int sz)
+static void
+grow(Htab *ht, int sz)
 {
 	void **oldk;
 	void **oldv;
@@ -96,9 +100,10 @@
 }
 
 /* Inserts 'k' into the hash table, possibly
- * killing any previous key that compares
+ * killing any previous key that compare
  * as equal. */
-int htput(Htab *ht, void *k, void *v)
+int
+htput(Htab *ht, void *k, void *v)
 {
 	int i;
 	ulong h;
@@ -120,7 +125,8 @@
 		i = (h + di) & (ht->sz - 1);
 	}
 	ht->nelt++;
-conflicted:
+conflicted
+:
 	if (ht->dead[i])
 		ht->ndead--;
 	ht->hashes[i] = h;
@@ -137,7 +143,8 @@
 
 /* Finds the index that we would insert
  * the key into */
-static ssize_t htidx(Htab *ht, void *k)
+static ssize_t
+htidx(Htab *ht, void *k)
 {
 	ssize_t i;
 	ulong h;
@@ -147,7 +154,8 @@
 	h = hash(ht, k);
 	i = h & (ht->sz - 1);
 	while (ht->hashes[i] && !ht->dead[i] && ht->hashes[i] != h) {
-searchmore:
+searchmore
+:
 		di++;
 		i = (h + di) & (ht->sz - 1);
 	}
@@ -161,9 +169,10 @@
 /* Looks up a key, returning NULL if
  * the value is not present. Note,
  * if NULL is a valid value, you need
- * to check with hthas() to see if it's
+ * to check with hthas() to see if it'
  * not there */
-void *htget(Htab *ht, void *k)
+void *
+htget(Htab *ht, void *k)
 {
 	ssize_t i;
 
@@ -174,7 +183,8 @@
 		return ht->vals[i];
 }
 
-void htdel(Htab *ht, void *k)
+void
+htdel(Htab *ht, void *k)
 {
 	ssize_t i;
 
@@ -189,7 +199,8 @@
 }
 
 /* Tests for 'k's presence in 'ht' */
-int hthas(Htab *ht, void *k) { return htidx(ht, k) >= 0; }
+int
+hthas(Htab *ht, void *k) { return htidx(ht, k) >= 0; }
 
 /* Returns a list of all keys in the hash
  * table, storing the size of the returned
@@ -196,7 +207,8 @@
  * array in 'nkeys'. NB: the value returned
  * is allocated on the heap, and it is the
  * job of the caller to free it */
-void **htkeys(Htab *ht, size_t *nkeys)
+void **
+htkeys(Htab *ht, size_t *nkeys)
 {
 	void **k;
 	size_t i, j;
@@ -210,7 +222,8 @@
 	return k;
 }
 
-ulong strhash(void *_s)
+ulong
+strhash(void *_s)
 {
 	char *s;
 
@@ -220,7 +233,8 @@
 	return murmurhash2(_s, strlen(_s));
 }
 
-int streq(void *a, void *b)
+int
+streq(void *a, void *b)
 {
 	if (a == b)
 		return 1;
@@ -229,7 +243,8 @@
 	return !strcmp(a, b);
 }
 
-ulong strlithash(void *_s)
+ulong
+strlithash(void *_s)
 {
 	Str *s;
 
@@ -239,7 +254,8 @@
 	return murmurhash2(s->buf, s->len);
 }
 
-int strliteq(void *_a, void *_b)
+int
+strliteq(void *_a, void *_b)
 {
 	Str *a, *b;
 
@@ -254,27 +270,32 @@
 	return !memcmp(a->buf, b->buf, a->len);
 }
 
-ulong ptrhash(void *key)
-{ 
+ulong
+ptrhash(void *key)
+{
 	return inthash((uintptr_t)key);
 }
 
-ulong inthash(uint64_t key)
+ulong
+inthash(uint64_t key)
 {
 	return murmurhash2(&key, sizeof key);
 }
 
-int inteq(uint64_t a, uint64_t b)
+int
+inteq(uint64_t a, uint64_t b)
 {
 	return a == b;
 }
 
-int ptreq(void *a, void *b)
+int
+ptreq(void *a, void *b)
 {
 	return a == b;
 }
 
-ulong murmurhash2 (void *ptr, size_t len)
+static ulong
+murmurhash2 (void *ptr, size_t len)
 {
 	uint32_t m = 0x5bd1e995;
 	uint32_t r = 24;
--- a/util/pack.c
+++ b/util/pack.c
@@ -14,7 +14,8 @@
 #include "util.h"
 
 /* endian packing */
-void be64(vlong v, byte buf[8])
+void
+be64(vlong v, byte buf[8])
 {
 	buf[0] = (v >> 56) & 0xff;
 	buf[1] = (v >> 48) & 0xff;
@@ -26,7 +27,8 @@
 	buf[7] = (v >> 0) & 0xff;
 }
 
-vlong host64(byte buf[8])
+vlong
+host64(byte buf[8])
 {
 	vlong v = 0;
 
@@ -41,7 +43,8 @@
 	return v;
 }
 
-void be32(long v, byte buf[4])
+void
+be32(long v, byte buf[4])
 {
 	buf[0] = (v >> 24) & 0xff;
 	buf[1] = (v >> 16) & 0xff;
@@ -49,7 +52,8 @@
 	buf[3] = (v >> 0) & 0xff;
 }
 
-long host32(byte buf[4])
+long
+host32(byte buf[4])
 {
 	int32_t v = 0;
 	v |= ((long)buf[0] << 24);
@@ -59,7 +63,8 @@
 	return v;
 }
 
-void wrbuf(FILE *fd, void *p, size_t sz)
+void
+wrbuf(FILE *fd, void *p, size_t sz)
 {
 	size_t n;
 	char *buf;
@@ -75,7 +80,8 @@
 	}
 }
 
-void rdbuf(FILE *fd, void *buf, size_t sz)
+void
+rdbuf(FILE *fd, void *buf, size_t sz)
 {
 	size_t n;
 
@@ -89,13 +95,15 @@
 	}
 }
 
-void wrbyte(FILE *fd, char val)
+void
+wrbyte(FILE *fd, char val)
 {
 	if (fputc(val, fd) == EOF)
 		die("Unexpected EOF");
 }
 
-char rdbyte(FILE *fd)
+char
+rdbyte(FILE *fd)
 {
 	int c;
 	c = fgetc(fd);
@@ -104,7 +112,8 @@
 	return c;
 }
 
-void wrint(FILE *fd, long val)
+void
+wrint(FILE *fd, long val)
 {
 	byte buf[4];
 	be32(val, buf);
@@ -111,7 +120,8 @@
 	wrbuf(fd, buf, 4);
 }
 
-long rdint(FILE *fd)
+long
+rdint(FILE *fd)
 {
 	byte buf[4];
 	rdbuf(fd, buf, 4);
@@ -118,7 +128,8 @@
 	return host32(buf);
 }
 
-void wrstr(FILE *fd, char *val)
+void
+wrstr(FILE *fd, char *val)
 {
 	size_t len;
 
@@ -131,7 +142,8 @@
 	}
 }
 
-char *rdstr(FILE *fd)
+char *
+rdstr(FILE *fd)
 {
 	ssize_t len;
 	char *s;
@@ -147,13 +159,15 @@
 	}
 }
 
-void wrlenstr(FILE *fd, Str str)
+void
+wrlenstr(FILE *fd, Str str)
 {
 	wrint(fd, str.len);
 	wrbuf(fd, str.buf, str.len);
 }
 
-void rdlenstr(FILE *fd, Str *str)
+void
+rdlenstr(FILE *fd, Str *str)
 {
 	str->len = rdint(fd);
 	str->buf = xalloc(str->len + 1);
@@ -161,7 +175,8 @@
 	str->buf[str->len] = '\0';
 }
 
-void wrflt(FILE *fd, double val)
+void
+wrflt(FILE *fd, double val)
 {
 	byte buf[8];
 	/* Assumption: We have 'val' in 64 bit IEEE format */
@@ -175,7 +190,8 @@
 	wrbuf(fd, buf, 8);
 }
 
-double rdflt(FILE *fd)
+double
+rdflt(FILE *fd)
 {
 	byte buf[8];
 	union {
@@ -188,7 +204,8 @@
 	return u.fval;
 }
 
-size_t bprintf(char *buf, size_t sz, char *fmt, ...)
+size_t
+bprintf(char *buf, size_t sz, char *fmt, ...)
 {
 	va_list ap;
 	size_t n;
@@ -202,12 +219,14 @@
 	return n;
 }
 
-void wrbool(FILE *fd, int val)
-{ 
+void
+wrbool(FILE *fd, int val)
+{
 	wrbyte(fd, val);
 }
 
-int rdbool(FILE *fd) 
+int
+rdbool(FILE *fd)
 {
-	return rdbyte(fd); 
+	return rdbyte(fd);
 }
--- a/util/util.c
+++ b/util/util.c
@@ -14,7 +14,8 @@
 #include "util.h"
 
 /* Some systems don't have strndup. */
-char *strdupn(char *s, size_t len)
+char *
+strdupn(char *s, size_t len)
 {
 	char *ret;
 
@@ -24,7 +25,8 @@
 	return ret;
 }
 
-char *xstrdup(char *s)
+char *
+xstrdup(char *s)
 {
 	char *p;
 
@@ -34,7 +36,8 @@
 	return p;
 }
 
-char *strjoin(char *u, char *v)
+char *
+strjoin(char *u, char *v)
 {
 	size_t n;
 	char *s;
@@ -45,7 +48,8 @@
 	return s;
 }
 
-char *swapsuffix(char *buf, size_t sz, char *s, char *suf, char *swap)
+char *
+swapsuffix(char *buf, size_t sz, char *s, char *suf, char *swap)
 {
 	size_t slen, suflen, swaplen;
 
@@ -70,7 +74,8 @@
 	return buf;
 }
 
-size_t max(size_t a, size_t b)
+size_t
+max(size_t a, size_t b)
 {
 	if (a > b)
 		return a;
@@ -78,7 +83,8 @@
 		return b;
 }
 
-size_t min(size_t a, size_t b)
+size_t
+min(size_t a, size_t b)
 {
 	if (a < b)
 		return a;
@@ -86,7 +92,8 @@
 		return b;
 }
 
-size_t align(size_t sz, size_t a)
+size_t
+align(size_t sz, size_t a)
 {
 	/* align to 0 just returns sz */
 	if (a == 0)
@@ -94,7 +101,8 @@
 	return (sz + a - 1) & ~(a - 1);
 }
 
-void indentf(int depth, char *fmt, ...)
+void
+indentf(int depth, char *fmt, ...)
 {
 	va_list ap;
 	va_start(ap, fmt);
@@ -102,7 +110,8 @@
 	va_end(ap);
 }
 
-void findentf(FILE *fd, int depth, char *fmt, ...)
+void
+findentf(FILE *fd, int depth, char *fmt, ...)
 {
 	va_list ap;
 	va_start(ap, fmt);
@@ -110,7 +119,8 @@
 	va_end(ap);
 }
 
-void vfindentf(FILE *fd, int depth, char *fmt, va_list ap)
+void
+vfindentf(FILE *fd, int depth, char *fmt, va_list ap)
 {
 	ssize_t i;
 
@@ -119,7 +129,8 @@
 	vfprintf(fd, fmt, ap);
 }
 
-static int optinfo(Optctx *ctx, char arg, int *take, int *mand)
+static int
+optinfo(Optctx *ctx, char arg, int *take, int *mand)
 {
 	char *s;
 
@@ -144,7 +155,8 @@
 	return 0;
 }
 
-static int findnextopt(Optctx *ctx)
+static int
+findnextopt(Optctx *ctx)
 {
 	size_t i;
 
@@ -156,13 +168,15 @@
 	}
 	ctx->finished = 1;
 	return 0;
-foundopt:
+foundopt
+:
 	ctx->argidx = i;
 	ctx->curarg = ctx->optargs[i] + 1; /* skip initial '-' */
 	return 1;
 }
 
-void optinit(Optctx *ctx, char *optstr, char **optargs, size_t noptargs)
+void
+optinit(Optctx *ctx, char *optstr, char **optargs, size_t noptargs)
 {
 	ctx->args = NULL;
 	ctx->nargs = 0;
@@ -177,7 +191,8 @@
 	findnextopt(ctx);
 }
 
-int optnext(Optctx *ctx)
+int
+optnext(Optctx *ctx)
 {
 	int take, mand;
 	int c;
@@ -208,4 +223,5 @@
 	return c;
 }
 
-int optdone(Optctx *ctx) { return *ctx->curarg == '\0' && ctx->finished; }
+int
+optdone(Optctx *ctx) { return *ctx->curarg == '\0' && ctx->finished; }