summaryrefslogtreecommitdiff
path: root/parse/use.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-12-25 20:24:57 -0800
committerOri Bernstein <ori@eigenstate.org>2015-12-25 20:24:57 -0800
commit505618290f159d5453d2e86abdb8f4297e846f74 (patch)
tree32b2cf67f4d0f62da66ba1956ab0fd9caef86706 /parse/use.c
parent14fd8b9e92ffe32275aba6f30dd8edf4531c6a19 (diff)
downloadmc-505618290f159d5453d2e86abdb8f4297e846f74.tar.gz
Fix unused variable warning.
Diffstat (limited to 'parse/use.c')
-rw-r--r--parse/use.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/parse/use.c b/parse/use.c
index 7390b21..24e8da7 100644
--- a/parse/use.c
+++ b/parse/use.c
@@ -815,13 +815,14 @@ static void fixtraitmappings(Stab *st)
static void protomap(Trait *tr, Type *ty, Node *dcl)
{
size_t i, len;
- char *protoname, *dclname;
+ char *protoname, *dclname, *p;
dclname = declname(dcl);
for (i = 0; i < tr->nfuncs; i++) {
protoname = declname(tr->funcs[i]);
len = strlen(protoname);
- if (strstr(dclname, protoname))
+ p = strstr(dclname, protoname);
+ if (p && p[len] == '$')
htput(tr->funcs[i]->decl.impls, ty, dcl);
}
}