summaryrefslogtreecommitdiff
path: root/parse
diff options
context:
space:
mode:
Diffstat (limited to 'parse')
-rw-r--r--parse/export.c2
-rw-r--r--parse/infer.c12
-rw-r--r--parse/parse.h12
-rw-r--r--parse/specialize.c6
-rw-r--r--parse/stab.c10
-rw-r--r--parse/use.c6
6 files changed, 24 insertions, 24 deletions
diff --git a/parse/export.c b/parse/export.c
index 6d50c45..68733fa 100644
--- a/parse/export.c
+++ b/parse/export.c
@@ -210,7 +210,7 @@ tagnode(Stab *st, Node *n, int ingeneric, int hidelocal)
}
void
-tagexports(Node *file, int hidelocal)
+tagexports(int hidelocal)
{
size_t i, j, n;
Trait *tr;
diff --git a/parse/infer.c b/parse/infer.c
index 3d84dd1..2563a92 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -572,7 +572,7 @@ tylookup(Type *t)
if (!tytab[t->tid] && t->type == Tyunres) {
ns = curstab();
if (t->name->name.ns)
- ns = getns(file, t->name->name.ns);
+ ns = getns(t->name->name.ns);
if (!ns)
fatal(t->name, "no namespace \"%s\"", t->name->name.ns);
lu = gettype(ns, t->name);
@@ -741,7 +741,7 @@ uconresolve(Node *n)
args = n->expr.args;
ns = curstab();
if (args[0]->name.ns)
- ns = getns(file, args[0]->name.ns);
+ ns = getns(args[0]->name.ns);
if (!ns)
fatal(n, "no namespace %s\n", args[0]->name.ns);
uc = getucon(ns, args[0]);
@@ -1397,7 +1397,7 @@ checkns(Node *n, Node **ret)
if (args[0]->type != Nexpr || exprop(args[0]) != Ovar)
return n;
name = args[0]->expr.args[0];
- stab = getns(file, namestr(name));
+ stab = getns(namestr(name));
if (!stab)
return n;
@@ -1565,7 +1565,7 @@ inferpat(Node **np, Node *val, Node ***bind, size_t *nbind)
case Ovar:
ns = curstab();
if (args[0]->name.ns)
- ns = getns(file, args[0]->name.ns);
+ ns = getns(args[0]->name.ns);
s = getdcl(ns, args[0]);
if (s && !s->decl.ishidden) {
if (s->decl.isgeneric)
@@ -1815,7 +1815,7 @@ inferexpr(Node **np, Type *ret, int *sawret)
return;
ns = curstab();
if (args[0]->name.ns)
- ns = getns(file, args[0]->name.ns);
+ ns = getns(args[0]->name.ns);
s = getdcl(ns, args[0]);
if (!s)
fatal(n, "undeclared var %s", ctxstr(args[0]));
@@ -2797,7 +2797,7 @@ findtrait(Node *impl)
n = impl->impl.traitname;
ns = file->file.globls;
if (n->name.ns)
- ns = getns(file, n->name.ns);
+ ns = getns(n->name.ns);
if (ns)
tr = gettrait(ns, n);
if (!tr)
diff --git a/parse/parse.h b/parse/parse.h
index 07c0e03..0bae957 100644
--- a/parse/parse.h
+++ b/parse/parse.h
@@ -404,7 +404,7 @@ void lfatalv(Srcloc l, char *fmt, va_list ap) FATAL;
/* stab creation */
Stab *mkstab(int isfunc);
-void putns(Node *file, Stab *scope);
+void putns(Stab *scope);
void puttype(Stab *st, Node *n, Type *ty);
void puttrait(Stab *st, Node *n, Trait *trait);
void putimpl(Stab *st, Node *impl);
@@ -414,7 +414,7 @@ void forcedcl(Stab *st, Node *dcl);
void putucon(Stab *st, Ucon *uc);
void putlbl(Stab *st, char *name, Node *lbl);
-Stab *getns(Node *file, char *n);
+Stab *getns(char *n);
Node *getdcl(Stab *st, Node *n);
Node *getclosed(Stab *st, Node *n);
Node **getclosure(Stab *st, size_t *n);
@@ -521,7 +521,7 @@ char *declname(Node *n);
Type *decltype(Node * n);
Type *exprtype(Node *n);
Type *nodetype(Node *n);
-void addstmt(Node *file, Node *stmt);
+void addstmt(Node *stmt);
void setns(Node *n, char *ns);
void updatens(Stab *st, char *ns);
ulong varhash(void *dcl);
@@ -536,15 +536,15 @@ Type *substget(Tysubst *subst, Type *from);
Node *specializedcl(Node *n, Type *param, Type *to, Node **name);
Type *tyspecialize(Type *t, Tysubst *tymap, Htab *delayed, Htab *tybase);
Node *genericname(Node *n, Type *param, Type *t);
-void geninit(Node *file);
+void geninit(void);
/* usefiles */
int loaduse(char *path, FILE *f, Stab *into, Vis vis);
void readuse(Node *use, Stab *into, Vis vis);
void writeuse(FILE *fd, Node *file);
-void tagexports(Node *file, int hidelocal);
+void tagexports(int hidelocal);
void tagreflect(Type *t);
-void addextlibs(Node *file, char **libs, size_t nlibs);
+void addextlibs(char **libs, size_t nlibs);
/* expression folding */
Node *fold(Node *n, int foldvar);
diff --git a/parse/specialize.c b/parse/specialize.c
index c5d4a59..74af0e9 100644
--- a/parse/specialize.c
+++ b/parse/specialize.c
@@ -233,7 +233,7 @@ fixup(Node *n)
if (n->expr.op == Ovar) {
ns = curstab();
if (n->expr.args[0]->name.ns)
- ns = getns(file, n->expr.args[0]->name.ns);
+ ns = getns(n->expr.args[0]->name.ns);
if (!ns)
fatal(n, "No namespace %s\n", n->expr.args[0]->name.ns);
d = getdcl(ns, n->expr.args[0]);
@@ -513,7 +513,7 @@ specializedcl(Node *gnode, Type *param, Type *to, Node **name)
n = genericname(gnode, param, to);
*name = n;
if (n->name.ns)
- st = getns(file, n->name.ns);
+ st = getns(n->name.ns);
else
st = file->file.globls;
if (!st)
@@ -603,7 +603,7 @@ callinit(Node *block, Node *init, Type *tyvoid, Type *tyvoidfn)
}
void
-geninit(Node *file)
+geninit(void)
{
Node *name, *decl, *func, *block, *init;
Type *tyvoid, *tyvoidfn;
diff --git a/parse/stab.c b/parse/stab.c
index 49fc776..1d89238 100644
--- a/parse/stab.c
+++ b/parse/stab.c
@@ -171,7 +171,7 @@ findstab(Stab *st, Node *n)
Stab *ns;
if (n->name.ns) {
- ns = getns(file, n->name.ns);
+ ns = getns(n->name.ns);
if (!ns) {
ns = mkstab(0);
updatens(ns, n->name.ns);
@@ -319,7 +319,7 @@ gettrait(Stab *st, Node *n)
Traitdefn *c;
if (n->name.ns)
- st = getns(file, n->name.ns);
+ st = getns(n->name.ns);
do {
if ((c = htget(st->tr, n)))
return c->trait;
@@ -329,7 +329,7 @@ gettrait(Stab *st, Node *n)
}
Stab *
-getns(Node *file, char *name) {
+getns(char *name) {
return htget(file->file.ns, name);
}
@@ -606,11 +606,11 @@ getimpl(Stab *st, Node *n)
}
void
-putns(Node *file, Stab *scope)
+putns(Stab *scope)
{
Stab *s;
- s = getns(file, scope->name);
+ s = getns(scope->name);
if (s)
lfatal(Zloc, "Namespace %s already defined", scope->name);
htput(file->file.ns, scope->name, scope);
diff --git a/parse/use.c b/parse/use.c
index 28c48f6..9de82a4 100644
--- a/parse/use.c
+++ b/parse/use.c
@@ -52,7 +52,7 @@ 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)
+addextlibs(char **libs, size_t nlibs)
{
size_t i, j;
@@ -751,11 +751,11 @@ findstab(Stab *st, char *pkg)
return NULL;
}
- s = getns(file, pkg);
+ s = getns(pkg);
if (!s) {
s = mkstab(0);
s->name = strdup(pkg);
- putns(file, s);
+ putns(s);
}
return s;
}