summaryrefslogtreecommitdiff
path: root/utils/vc
diff options
context:
space:
mode:
authorforsyth <forsyth@lavoro.terzarima.net>2013-06-03 21:01:14 +0000
committerforsyth <forsyth@lavoro.terzarima.net>2013-06-03 21:01:14 +0000
commit45a20ab721a513710138340faff3d59a31c3e01e (patch)
treeeea29d2684c51cc73725b8992a2125bede48e118 /utils/vc
parentcd8e99851af33e52bcdf8faf34f9d4e62fa0cbaf (diff)
sync compilers with Plan 9
remove 1[acl] 2[acl]
Diffstat (limited to 'utils/vc')
-rw-r--r--utils/vc/gc.h9
-rw-r--r--utils/vc/list.c2
-rw-r--r--utils/vc/peep.c2
-rw-r--r--utils/vc/reg.c2
-rw-r--r--utils/vc/swt.c33
5 files changed, 15 insertions, 33 deletions
diff --git a/utils/vc/gc.h b/utils/vc/gc.h
index 29fc0bc5..ad34f1d2 100644
--- a/utils/vc/gc.h
+++ b/utils/vc/gc.h
@@ -55,7 +55,7 @@ struct Prog
struct Case
{
Case* link;
- long val;
+ vlong val;
long label;
char def;
char isv;
@@ -64,7 +64,7 @@ struct Case
struct C1
{
- long val;
+ vlong val;
long label;
};
@@ -256,7 +256,7 @@ void gpseudo(int, Sym*, Node*);
/*
* swt.c
*/
-int swcmp(const void*, const void*);
+int swcmp(void*, void*);
void doswit(Node*);
void swit1(C1*, int, long, Node*);
void swit2(C1*, int, long, Node*, Node*);
@@ -267,7 +267,6 @@ long outstring(char*, long);
int mulcon(Node*, Node*);
Multab* mulcon0(long);
void nullwarn(Node*, Node*);
-void sextern(Sym*, Node*, long, long);
void gextern(Sym*, Node*, long, long);
void outcode(void);
void ieeedtod(Ieee*, double);
@@ -287,7 +286,7 @@ int Bconv(Fmt*);
* reg.c
*/
Reg* rega(void);
-int rcmp(const void*, const void*);
+int rcmp(void*, void*);
void regopt(Prog*);
void addmove(Reg*, int, int, int);
Bits mkvar(Adr*, int);
diff --git a/utils/vc/list.c b/utils/vc/list.c
index f89b17ca..b96130f4 100644
--- a/utils/vc/list.c
+++ b/utils/vc/list.c
@@ -70,7 +70,7 @@ Aconv(Fmt *fp)
int a;
a = va_arg(fp->args, int);
- s = "???";
+ s = "?";
if(a >= AXXX && a < ALAST)
s = anames[a];
return fmtstrcpy(fp, s);
diff --git a/utils/vc/peep.c b/utils/vc/peep.c
index 5f635571..849d3c15 100644
--- a/utils/vc/peep.c
+++ b/utils/vc/peep.c
@@ -403,6 +403,7 @@ copy1(Adr *v1, Adr *v2, Reg *r, int f)
* 4 if set and used
* 0 otherwise (not touched)
*/
+int
copyu(Prog *p, Adr *v, Adr *s)
{
@@ -569,7 +570,6 @@ copyu(Prog *p, Adr *v, Adr *s)
return 3;
return 0;
}
- /* not reached */
}
int
diff --git a/utils/vc/reg.c b/utils/vc/reg.c
index bde52df0..f9d2a72c 100644
--- a/utils/vc/reg.c
+++ b/utils/vc/reg.c
@@ -18,7 +18,7 @@ rega(void)
}
int
-rcmp(const void *a1, const void *a2)
+rcmp(void *a1, void *a2)
{
Rgn *p1, *p2;
int c1, c2;
diff --git a/utils/vc/swt.c b/utils/vc/swt.c
index cdc58e1b..65f90301 100644
--- a/utils/vc/swt.c
+++ b/utils/vc/swt.c
@@ -19,8 +19,8 @@ swit2(C1 *q, int nc, long def, Node *n, Node *tn)
if(nc < 5) {
for(i=0; i<nc; i++) {
- if(debug['W'])
- print("case = %.8lux\n", q->val);
+ if(debug['K'])
+ print("case = %.8llux\n", q->val);
gmove(nodconst(q->val), tn);
gopcode(OEQ, n, tn, Z);
patch(p, q->label);
@@ -32,8 +32,8 @@ swit2(C1 *q, int nc, long def, Node *n, Node *tn)
}
i = nc / 2;
r = q+i;
- if(debug['W'])
- print("case > %.8lux\n", r->val);
+ if(debug['K'])
+ print("case > %.8llux\n", r->val);
gmove(nodconst(r->val), tn);
gopcode(OLT, tn, n, Z);
sp = p;
@@ -41,8 +41,8 @@ swit2(C1 *q, int nc, long def, Node *n, Node *tn)
patch(p, r->label);
swit2(q, i, def, n, tn);
- if(debug['W'])
- print("case < %.8lux\n", r->val);
+ if(debug['K'])
+ print("case < %.8llux\n", r->val);
patch(sp, pc);
swit2(r+1, nc-i-1, def, n, tn);
}
@@ -234,23 +234,6 @@ loop:
}
void
-sextern(Sym *s, Node *a, long o, long w)
-{
- long e, lw;
-
- for(e=0; e<w; e+=NSNAME) {
- lw = NSNAME;
- if(w-e < lw)
- lw = w-e;
- gpseudo(ADATA, s, nodconst(0));
- p->from.offset += o+e;
- p->reg = lw;
- p->to.type = D_SCONST;
- memmove(p->to.sval, a->cstring+e, lw);
- }
-}
-
-void
gextern(Sym *s, Node *a, long o, long w)
{
@@ -596,8 +579,8 @@ align(long i, Type *t, int op)
long
maxround(long max, long v)
{
- v += SZ_LONG-1;
+ v = round(v, SZ_LONG);
if(v > max)
- max = round(v, SZ_LONG);
+ return v;
return max;
}