forgot to include the important bits from the last patch Reference: /n/atom/patch/applied/acidfmtsize2 Date: Thu Feb 20 02:55:49 CET 2014 Signed-off-by: quanstro@quanstro.net --- /sys/src/cmd/acid/builtin.c Thu Feb 20 02:55:26 2014 +++ /sys/src/cmd/acid/builtin.c Thu Feb 20 02:55:28 2014 @@ -694,7 +694,6 @@ static char ftab[] = "0123456789,+- #"; static char itab[] = "lh"; static char *wtab[] = {[1] "hh", [2] "h", [4] "", [8] "ll", }; -extern int fsize[]; static char* itoafmt(char *s, int slen, char *fmt, Node *n) @@ -740,7 +739,7 @@ } if(runestrchr(vtab, r)){ f = 2; - i += sprint(buf+i, "%s%s%C", wtab[fsize[n->fmt]], u, r); + i += sprint(buf+i, "%s%s%C", wtab[fmtcharsize(n->fmt)], u, r); break; } snprint(ebuf, sizeof ebuf, "unexpected fmt character %C", r); @@ -758,10 +757,9 @@ buf[i] = 0; -// print("fsize[n->fmt] = <%c> %d\n", n->fmt, fsize[n->fmt]); - switch(fsize[n->fmt]){ + switch(fmtcharsize(n->fmt)){ default: - error("acid: internal error: type %d has size %d", n->type, fsize[n->type]); + error("acid: internal error: type %d has size %d", n->type, fmtcharsize(n->fmt)); case 1: snprint(s, slen, buf, (uchar)n->ival); break; --- /sys/src/cmd/acid/expr.c Thu Feb 20 02:55:31 2014 +++ /sys/src/cmd/acid/expr.c Thu Feb 20 02:55:32 2014 @@ -166,7 +166,7 @@ res->ival = ival; res->op = OCONST; - res->fmt = 'X'; + res->fmt = 'W'; res->type = TINT; /* Try and set comt */