forsyth: fix keywords and update pickle calling Reference: /n/atom/patch/applied/ccpickleupd Date: Sun Aug 16 00:22:47 CES 2015 Signed-off-by: quanstro@quanstro.net --- /sys/src/cmd/cc/pickle.c Sun Aug 16 00:22:38 2015 +++ /sys/src/cmd/cc/pickle.c Sun Aug 16 00:22:40 2015 @@ -2,12 +2,12 @@ static char *kwd[] = { - "$adt", "$aggr", "$append", "$complex", "$defn", + "$adt", "$aggr", "$append", "$builtin", "$complex", "$defn", "$delete", "$do", "$else", "$eval", "$head", "$if", "$local", "$loop", "$return", "$tail", "$then", "$union", "$whatis", "$while", }; -static char picklestr[] = "\tpickle(s, un, "; +static char picklestr[] = "\tbp = pickle(bp, ep, un, "; static char* pmap(char *s) @@ -153,10 +153,10 @@ if(s1 == S) break; if(s == S) { - Bprint(&outbuf, "\tpickle_%s(s, un, (%s*)((char*)addr+%ld+_i*%ld));\n", + Bprint(&outbuf, "\tbp = pickle_%s(bp, ep, un, (%s*)((char*)addr+%ld+_i*%ld));\n", pmap(s1->name), pmap(s1->name), t->offset+off, t->width); } else { - Bprint(&outbuf, "\tpickle_%s(s, un, &addr->%s);\n", + Bprint(&outbuf, "\tbp = pickle_%s(bp, ep, un, &addr->%s);\n", pmap(s1->name), pmap(s->name)); } break; @@ -195,10 +195,10 @@ goto asmstr; an = pmap(s->name); - Bprint(&outbuf, "void\npickle_%s(void *s, int un, %s *addr)\n{\n\tint _i = 0;\n\n\tUSED(_i);\n", an, an); + Bprint(&outbuf, "uchar*\npickle_%s(uchar *bp, uchar *ep, int un, %s *addr)\n{\n\tint _i = 0;\n\n\tUSED(_i);\n", an, an); for(l = t->link; l != T; l = l->down) picklemember(l, 0); - Bprint(&outbuf, "}\n\n"); + Bprint(&outbuf, "\treturn bp;\n}\n\n"); break; asmstr: if(s == S)