summaryrefslogtreecommitdiff
path: root/parse/type.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2017-06-28 03:24:57 -0700
committerOri Bernstein <ori@markovcorp.com>2017-06-28 10:59:54 -0700
commit567766b0cb773c76a9ec0d16246bd27b4a46b851 (patch)
tree47da5cff2284f691083c6b8445ded0047a174e85 /parse/type.c
parent6f5af8562ed5547ddaeb15ba7ed4a334318ca53f (diff)
downloadmc-567766b0cb773c76a9ec0d16246bd27b4a46b851.tar.gz
Remove unused memb from Trait and rename funcs -> proto
These are prototype declarations that must be implemented by the impl (not necessarily functions), so proto seems like a better name.
Diffstat (limited to 'parse/type.c')
-rw-r--r--parse/type.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/parse/type.c b/parse/type.c
index 581b2b4..1d0db27 100644
--- a/parse/type.c
+++ b/parse/type.c
@@ -141,8 +141,7 @@ Type *mktylike(Srcloc loc, Ty like)
/* steals memb, funcs */
Trait *mktrait(Srcloc loc, Node *name, Type *param,
Type **aux, size_t naux,
- Node **memb, size_t nmemb,
- Node **funcs, size_t nfuncs,
+ Node **proto, size_t nproto,
int isproto)
{
Trait *t;
@@ -155,12 +154,10 @@ Trait *mktrait(Srcloc loc, Node *name, Type *param,
t->vis = Visintern;
t->name = name;
t->param = param;
- t->memb = memb;
- t->nmemb = nmemb;
+ t->proto = proto;
+ t->nproto = nproto;
t->aux = aux;
t->naux = naux;
- t->funcs = funcs;
- t->nfuncs = nfuncs;
t->isproto = isproto;
traittab = xrealloc(traittab, ntraittab * sizeof(Trait *));
@@ -924,7 +921,7 @@ void iterableinit(Stab *st, Trait *tr)
func->decl.isglobl = 1;
func->decl.isextern = 1;
- lappend(&tr->funcs, &tr->nfuncs, func);
+ lappend(&tr->proto, &tr->nproto, func);
putdcl(st, func);
/* __iterfin__ : (it : @a#, outval : @b# -> void) */
@@ -944,7 +941,7 @@ void iterableinit(Stab *st, Trait *tr)
func->decl.isglobl = 1;
func->decl.isextern = 1;
- lappend(&tr->funcs, &tr->nfuncs, func);
+ lappend(&tr->proto, &tr->nproto, func);
putdcl(st, func);
}
@@ -962,7 +959,6 @@ void tyinit(Stab *st)
mkname(Zloc, n), NULL, \
NULL, 0, \
NULL, 0, \
- NULL, 0, \
0); \
puttrait(st, tr->name, tr);
#include "trait.def"