diff options
| author | Charles.Forsyth <devnull@localhost> | 2006-12-23 00:30:12 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2006-12-23 00:30:12 +0000 |
| commit | 6e425a9de8c003b5a733621a6b6730ec3cc902b8 (patch) | |
| tree | 314123bcab78ff295f38f85f31dc141e5fe22d15 /limbo | |
| parent | 74a4d8c26dd3c1e9febcb717cfd6cb6512991a7a (diff) | |
20061220
Diffstat (limited to 'limbo')
| -rw-r--r-- | limbo/com.c | 2 | ||||
| -rw-r--r-- | limbo/decls.c | 2 | ||||
| -rw-r--r-- | limbo/ecom.c | 4 | ||||
| -rw-r--r-- | limbo/lex.c | 1 | ||||
| -rw-r--r-- | limbo/limbo.y | 1 | ||||
| -rw-r--r-- | limbo/optim.c | 2 | ||||
| -rw-r--r-- | limbo/sbl.c | 1 | ||||
| -rw-r--r-- | limbo/typecheck.c | 8 | ||||
| -rw-r--r-- | limbo/types.c | 12 |
9 files changed, 18 insertions, 15 deletions
diff --git a/limbo/com.c b/limbo/com.c index d10f3775..1bc070a4 100644 --- a/limbo/com.c +++ b/limbo/com.c @@ -1211,7 +1211,7 @@ rewritecomm(Node *n, Node *comm, Node *tmp, Node *slot) } } if(n->right == comm && n->op == Oas && comm->op == Orcv - && sumark(n->left)->addable < Rcant) + && sumark(n->left)->addable < Rcant && (n->left->op != Oname || n->left->decl != nildecl)) adr = n->left; if(adr != nil){ p = genrawop(&comm->left->src, ILEA, adr, nil, slot); diff --git a/limbo/decls.c b/limbo/decls.c index 4edab461..222a1301 100644 --- a/limbo/decls.c +++ b/limbo/decls.c @@ -933,7 +933,7 @@ declconv(Fmt *f) d = va_arg(f->args, Decl*); if(d->sym == nil) - s = "<???>"; + s = "<nil>"; else s = d->sym->name; seprint(buf, buf+sizeof(buf), "%s %s", storename[d->store], s); diff --git a/limbo/ecom.c b/limbo/ecom.c index e19b51c0..2dfa2f68 100644 --- a/limbo/ecom.c +++ b/limbo/ecom.c @@ -657,7 +657,7 @@ sumark(Node *n) if(n->flags & FNPTR){ if(n->flags == FNPTR2) n->addable = Roff; - else if(n->flags == FNPTR2|FNPTRN) + else if(n->flags == (FNPTR2|FNPTRN)) n->addable = Rnoff; } else @@ -1793,7 +1793,7 @@ arraycom(Node *a, Node *elems) { Node tindex, fake, tmp, ri, *e, *n, *q, *body, *wild; Inst *top, *out; - Case *c; + /* Case *c; */ if(debug['A']) print("arraycom: %n %n\n", a, elems); diff --git a/limbo/lex.c b/limbo/lex.c index bbd6cb69..749f2a7a 100644 --- a/limbo/lex.c +++ b/limbo/lex.c @@ -61,6 +61,7 @@ static Keywd keywords[] = "continue", Lcont, "cyclic", Lcyclic, "do", Ldo, + "dynamic", Ldynamic, "else", Lelse, "exception", Lexcept, "exit", Lexit, diff --git a/limbo/limbo.y b/limbo/limbo.y index 7098cd5d..8ccea1ef 100644 --- a/limbo/limbo.y +++ b/limbo/limbo.y @@ -68,6 +68,7 @@ Ldo Lwhile Lfor Lbreak Lalt Lcase Lpick Lcont Lreturn Lexit Lspawn Lraise Lfix + Ldynamic %% prog : Limplement ids ';' { diff --git a/limbo/optim.c b/limbo/optim.c index a3ccdec3..c74f1432 100644 --- a/limbo/optim.c +++ b/limbo/optim.c @@ -699,7 +699,7 @@ static char* decname(Decl *d) { if(d->sym == nil) - return "<??>"; + return "<nil>"; return d->sym->name; } diff --git a/limbo/sbl.c b/limbo/sbl.c index fff80392..0a0bf52c 100644 --- a/limbo/sbl.c +++ b/limbo/sbl.c @@ -163,6 +163,7 @@ sblinst(Inst *inst, long ninst) sblblocks = allocmem(nblocks * sizeof *sblblocks); for(i = 0; i < nblocks; i++) sblblocks[i] = -1; + src = nosrc; for(in = inst; in != nil; in = in->next){ if(in->op == INOOP) continue; diff --git a/limbo/typecheck.c b/limbo/typecheck.c index 827aa1e1..0fcfbf4b 100644 --- a/limbo/typecheck.c +++ b/limbo/typecheck.c @@ -2406,7 +2406,7 @@ argcompat(Node *n, Decl *f, Node *a) /* * fn is Odot(adt, methid) * pass adt implicitly if needed - * if not, any side effect of adt will be ingored + * if not, any side effect of adt will be ignored */ Node* passimplicit(Node *fn, Node *args) @@ -2415,12 +2415,12 @@ passimplicit(Node *fn, Node *args) Type *t; t = fn->ty; + n = fn->left; if(t->ids == nil || !t->ids->implicit){ - if(hasside(fn->left, 1)) - nwarn(fn, "result of expression %V ignored", fn->left); + if(!isfnrefty(t) && hasside(n, 1)) + nwarn(fn, "result of expression %V ignored", n); return args; } - n = fn->left; if(n->op == Oname && n->decl->store == Dtype){ nerror(n, "%V is a type and cannot be a self argument", n); n = mkn(Onothing, nil, nil); diff --git a/limbo/types.c b/limbo/types.c index 449b53d7..04115207 100644 --- a/limbo/types.c +++ b/limbo/types.c @@ -4403,10 +4403,10 @@ ispow2(double x) } static int -round(double x, int n, int *m) +fround(double x, int n, int *m) { if(n != 31) - fatal("not 31 in round"); + fatal("not 31 in fround"); return nf(x, m); } @@ -4418,7 +4418,7 @@ fixmul2(double sx, double sy, double sr, int *rp, int *ra) alpha = (sx*sy)/sr; n = 31; - k = round(1/alpha, n, &a); + k = fround(1/alpha, n, &a); *rp = 1-k; *ra = 0; return IMULX; @@ -4432,7 +4432,7 @@ fixdiv2(double sx, double sy, double sr, int *rp, int *ra) beta = sx/(sy*sr); n = 31; - k = round(beta, n, &b); + k = fround(beta, n, &b); *rp = k-1; *ra = 0; return IDIVX; @@ -4449,7 +4449,7 @@ fixmul(double sx, double sy, double sr, int *rp, int *ra) if(ispow2(alpha)) return fixmul2(sx, sy, sr, rp, ra); n = 31; - k = round(1/alpha, n, &a); + k = fround(1/alpha, n, &a); m = n-k; if(m < -n-1) return IMOVW; /* result is zero whatever the values */ @@ -4480,7 +4480,7 @@ fixdiv(double sx, double sy, double sr, int *rp, int *ra) if(ispow2(beta)) return fixdiv2(sx, sy, sr, rp, ra); n = 31; - k = round(beta, n, &b); + k = fround(beta, n, &b); m = k-n; if(m <= -2*n) return IMOVW; /* result is zero whatever the values */ |
