History

20100715-1712

forsyth committed 16 years ago

Commit 626a97a1 parent d416ec916 files · +135 −38Browse files

Unified · Split

16 files
  1. CHANGES +6 −0
  2. appl/wm/toolbar.b +26 −24
  3. dis/wm/toolbar.dis +0 −0
  4. emu/port/devsnarf.c +2 −1
  5. include/version.h +1 −1
  6. man/1/toolbar +30 −0
  7. utils/8a/a.y +7 −0
  8. utils/8c/list.c +3 −3
  9. utils/8c/peep.c +6 −2
  10. utils/8c/reg.c +2 −0
  11. utils/8l/l.h +1 −0
  12. utils/8l/span.c +2 −0
  13. utils/NOTICE +3 −2
  14. utils/cc/macbody +40 −6
  15. utils/kc/cgen.c +2 −0
  16. utils/kl/asm.c +5 −0
CHANGES+6−0
@@ -1,3 +1,9 @@
120100715
2 appl/wm/toolbar.b changed not to create new /chan/snarf if one exists, unless -p (private) option given [toolbar(1)]
3 utils/cc/macbody - add overlooked change to implement __VA_ARGS__
4 other minor updates to the compilers to resync
520100714
6 correctly initialise types in utils/cc/sub.c
120100504720100504
2 change lib9/strtoull.c for MS8 change lib9/strtoull.c for MS
320100503920100503
appl/wm/toolbar.b+26−24
@@ -82,12 +82,16 @@ init(ctxt: ref Draw->Context, argv: list of string) · 81 unmodified lines
82 sys->bind("#s", "/chan", sys->MBEFORE);82 sys->bind("#s", "/chan", sys->MBEFORE);
83 83
84 arg->init(argv);84 arg->init(argv);
85 arg->setusage("toolbar [-s]");85 arg->setusage("toolbar [-s] [-p]");
86 startmenu := 1;86 startmenu := 1;
87# ownsnarf := (sys->open("/chan/snarf", Sys->ORDWR) == nil);
88 ownsnarf := sys->stat("/chan/snarf").t0 < 0;
87 while((c := arg->opt()) != 0){89 while((c := arg->opt()) != 0){
88 case c {90 case c {
89 's' =>91 's' =>
90 startmenu = 0;92 startmenu = 0;
93 'p' =>
94 ownsnarf = 1;
91 * =>95 * =>
92 arg->usage();96 arg->usage();
93 }97 }
@@ -110,9 +114,13 @@ init(ctxt: ref Draw->Context, argv: list of string) · 16 unmodified lines
110 shctxt := Context.new(ctxt);114 shctxt := Context.new(ctxt);
111 shctxt.addmodule("wm", myselfbuiltin);115 shctxt.addmodule("wm", myselfbuiltin);
112 116
113 snarfIO := sys->file2chan("/chan", "snarf");117 snarfIO: ref Sys->FileIO;
114 if(snarfIO == nil)118 if(ownsnarf){
115 fatal(sys->sprint("cannot make /chan/snarf: %r"));119 snarfIO = sys->file2chan("/chan", "snarf");
120 if(snarfIO == nil)
121 fatal(sys->sprint("cannot make /chan/snarf: %r"));
122 }else
123 snarfIO = ref Sys->FileIO(chan of (int, int, int, Sys->Rread), chan of (int, array of byte, int, Sys->Rwrite));
116 sync := chan of string;124 sync := chan of string;
117 spawn consoleproc(ctxt, sync);125 spawn consoleproc(ctxt, sync);
118 if ((err := <-sync) != nil)126 if ((err := <-sync) != nil)
@@ -125,8 +133,8 @@ init(ctxt: ref Draw->Context, argv: list of string) · 6 unmodified lines
125 snarf: array of byte;133 snarf: array of byte;
126# write("/prog/"+string sys->pctl(0, nil)+"/ctl", "restricted"); # for testing134# write("/prog/"+string sys->pctl(0, nil)+"/ctl", "restricted"); # for testing
127 for(;;) alt{135 for(;;) alt{
128 s := <-tbtop.ctxt.kbd =>136 k := <-tbtop.ctxt.kbd =>
129 tk->keyboard(tbtop, c);137 tk->keyboard(tbtop, k);
130 m := <-tbtop.ctxt.ptr =>138 m := <-tbtop.ctxt.ptr =>
131 tk->pointer(tbtop, *m);139 tk->pointer(tbtop, *m);
132 s := <-tbtop.ctxt.ctl or140 s := <-tbtop.ctxt.ctl or
@@ -137,11 +145,13 @@ init(ctxt: ref Draw->Context, argv: list of string) · 4 unmodified lines
137 if (donesetup){145 if (donesetup){
138 {146 {
139 shctxt.run(ref Listnode(nil, s) :: nil, 0);147 shctxt.run(ref Listnode(nil, s) :: nil, 0);
140 } exception e {"fail:*" =>;}148 } exception {
149 "fail:*" => ;
150 }
141 }151 }
142 detask := <-task =>152 detask := <-task =>
143 deiconify(detask);153 deiconify(detask);
144 (off, data, fid, wc) := <-snarfIO.write =>154 (off, data, nil, wc) := <-snarfIO.write =>
145 if(wc == nil)155 if(wc == nil)
146 break;156 break;
147 if (off == 0) # write at zero truncates157 if (off == 0) # write at zero truncates
@@ -519,23 +529,15 @@ consoleproc(ctxt: ref Draw->Context, sync: chan of string) · 371 unmodified lines
519 tk->keyboard(top, c);529 tk->keyboard(top, c);
520 p := <-top.ctxt.ptr =>530 p := <-top.ctxt.ptr =>
521 tk->pointer(top, *p);531 tk->pointer(top, *p);
522 (off, nbytes, fid, rc) := <-iostdout.read =>532 (nil, nil, nil, rc) := <-iostdout.read =>
523 if(rc == nil)533 if(rc != nil)
524 break;534 rc <-= (nil, "inappropriate use of file");
525 alt{535 (nil, nil, nil, rc) := <-iostderr.read =>
526 rc <-= (nil, "inappropriate use of file") =>;536 if(rc != nil)
527 * =>;537 rc <-= (nil, "inappropriate use of file");
528 }538 (nil, data, nil, wc) := <-iostdout.write =>
529 (off, nbytes, fid, rc) := <-iostderr.read =>
530 if(rc == nil)
531 break;
532 alt{
533 rc <-= (nil, "inappropriate use of file") =>;
534 * =>;
535 }
536 (off, data, fid, wc) := <-iostdout.write =>
537 conout(top, data, wc);539 conout(top, data, wc);
538 (off, data, fid, wc) := <-iostderr.write =>540 (nil, data, nil, wc) := <-iostderr.write =>
539 conout(top, data, wc);541 conout(top, data, wc);
540 if(wc != nil)542 if(wc != nil)
541 tkclient->wmctl(top, "untask");543 tkclient->wmctl(top, "untask");
dis/wm/toolbar.dis+0−0

Binary file not shown.

emu/port/devsnarf.c+2−1
@@ -63,7 +63,8 @@ snarfclose(Chan* c) · 62 unmodified lines
63 /* this must be the last reference: no need to lock */63 /* this must be the last reference: no need to lock */
64 if(c->mode == ORDWR || c->mode == OWRITE){64 if(c->mode == ORDWR || c->mode == OWRITE){
65 if(!waserror()){65 if(!waserror()){
66 clipwrite(c->aux);66 if(c->aux != nil)
67 clipwrite(c->aux);
67 poperror();68 poperror();
68 }69 }
69 }70 }
include/version.h+1−1
@@ -1 +1 @@
1#define VERSION "Fourth Edition (20100505)"1#define VERSION "Fourth Edition (20100715)"
man/1/toolbar+30−0
@@ -5,6 +5,8 @@ toolbar \- window manager toolbar · 4 unmodified lines
5.B wm/toolbar5.B wm/toolbar
6[6[
7.B -s7.B -s
8] [
9.B -p
8]10]
9.SH DESCRIPTION11.SH DESCRIPTION
10.I Toolbar12.I Toolbar
@@ -55,6 +57,34 @@ The standard · 44 unmodified lines
55script executes the script57script executes the script
56.BI /usr/ username /lib/wmsetup ,58.BI /usr/ username /lib/wmsetup ,
57enabling each user to have their own window manager configuration.59enabling each user to have their own window manager configuration.
60.PP
61Normally
62.I toolbar
63packs a menu button referring to the start menu at the left hand side of the tool bar.
64The
65.B -s
66option suppresses that.
67.PP
68.I Toolbar
69serves the shared
70.I "snarf buffer"
71used by cut and paste in
72.IR wm (1)
73applications,
74except in hosted Inferno where the host's standard clipboard system is used instead,
75via
76.IR snarf (3).
77If
78.I toolbar
79cannot find
80.B /chan/snarf
81or the
82.B -p
83option is given,
84.I toolbar
85will create its own snarf buffer, private to the set of
86applications running under the current instance of
87.IR wm (1).
58.SH FILES88.SH FILES
59.TP89.TP
60.B /lib/wmsetup90.B /lib/wmsetup
utils/8a/a.y+7−0
@@ -236,6 +236,7 @@ rom: · 235 unmodified lines
236 }236 }
237| reg237| reg
238| omem238| omem
239| imm
239 240
240rim:241rim:
241 rem242 rem
@@ -386,6 +387,12 @@ omem: · 144 unmodified lines
386 $$ = nullgen;387 $$ = nullgen;
387 $$.type = D_INDIR+D_SP;388 $$.type = D_INDIR+D_SP;
388 }389 }
390| con '(' LSREG ')'
391 {
392 $$ = nullgen;
393 $$.type = D_INDIR+$3;
394 $$.offset = $1;
395 }
389| '(' LLREG '*' con ')'396| '(' LLREG '*' con ')'
390 {397 {
391 $$ = nullgen;398 $$ = nullgen;
utils/8c/list.c+3−3
@@ -70,7 +70,7 @@ Aconv(Fmt *fp) · 69 unmodified lines
70int70int
71Dconv(Fmt *fp)71Dconv(Fmt *fp)
72{72{
73 char str[40], s[20];73 char str[STRINGSZ], s[STRINGSZ];
74 Adr *a;74 Adr *a;
75 int i;75 int i;
76 76
@@ -224,7 +224,7 @@ char* regstr[] = · 147 unmodified lines
224int224int
225Rconv(Fmt *fp)225Rconv(Fmt *fp)
226{226{
227 char str[20];227 char str[STRINGSZ];
228 int r;228 int r;
229 229
230 r = va_arg(fp->args, int);230 r = va_arg(fp->args, int);
@@ -240,7 +240,7 @@ int · 9 unmodified lines
240Sconv(Fmt *fp)240Sconv(Fmt *fp)
241{241{
242 int i, c;242 int i, c;
243 char str[30], *p, *a;243 char str[STRINGSZ], *p, *a;
244 244
245 a = va_arg(fp->args, char*);245 a = va_arg(fp->args, char*);
246 p = str;246 p = str;
utils/8c/peep.c+6−2
@@ -639,10 +639,14 @@ copyu(Prog *p, Adr *v, Adr *s) · 638 unmodified lines
639 return 2;639 return 2;
640 goto caseread;640 goto caseread;
641 641
642 case AMOVSL:
643 case AREP:642 case AREP:
644 case AREPN:643 case AREPN:
645 if(v->type == D_CX || v->type == D_DI || v->type == D_SI)644 if(v->type == D_CX)
645 return 2;
646 goto caseread;
647
648 case AMOVSL:
649 if(v->type == D_DI || v->type == D_SI)
646 return 2;650 return 2;
647 goto caseread;651 goto caseread;
648 652
utils/8c/reg.c+2−0
@@ -224,7 +224,9 @@ regopt(Prog *p) · 223 unmodified lines
224 */224 */
225 case AFMOVDP:225 case AFMOVDP:
226 case AFMOVFP:226 case AFMOVFP:
227 case AFMOVLP:
227 case AFMOVVP:228 case AFMOVVP:
229 case AFMOVWP:
228 case ACALL:230 case ACALL:
229 for(z=0; z<BITS; z++)231 for(z=0; z<BITS; z++)
230 addrs.b[z] |= bit.b[z];232 addrs.b[z] |= bit.b[z];
utils/8l/l.h+1−0
@@ -346,3 +346,4 @@ void zerosig(char*); · 345 unmodified lines
346#pragma varargck type "P" Prog*346#pragma varargck type "P" Prog*
347#pragma varargck type "R" int347#pragma varargck type "R" int
348#pragma varargck type "A" int348#pragma varargck type "A" int
349#pragma varargck argpos diag 1
utils/8l/span.c+2−0
@@ -334,6 +334,8 @@ oclass(Adr *a) · 333 unmodified lines
334 return Yax;334 return Yax;
335 335
336 case D_CL:336 case D_CL:
337 return Ycl;
338
337 case D_DL:339 case D_DL:
338 case D_BL:340 case D_BL:
339 case D_AH:341 case D_AH:
utils/NOTICE+3−2
@@ -9,10 +9,11 @@ file such as NOTICE, LICENCE or COPYING. · 8 unmodified lines
9 Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved.9 Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved.
10 Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)10 Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
11 Portions Copyright © 1997-1999 Vita Nuova Limited11 Portions Copyright © 1997-1999 Vita Nuova Limited
12 Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)12 Portions Copyright © 2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com)
13 Portions Copyright © 2004,2006 Bruce Ellis13 Portions Copyright © 2004,2006 Bruce Ellis
14 Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net)14 Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net)
15 Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others15 Revisions Copyright © 2000-2008 Lucent Technologies Inc. and others
16 Portions Copyright © 2009 The Go Authors. All rights reserved.
16 17
17Permission is hereby granted, free of charge, to any person obtaining a copy18Permission is hereby granted, free of charge, to any person obtaining a copy
18of this software and associated documentation files (the "Software"), to deal19of this software and associated documentation files (the "Software"), to deal
utils/cc/macbody+40−6
@@ -1,3 +1,4 @@
1#define VARMAC 0x80
1 2
2long3long
3getnsn(void)4getnsn(void)
@@ -43,6 +44,27 @@ getsym(void) · 39 unmodified lines
43 return lookup();44 return lookup();
44}45}
45 46
47Sym*
48getsymdots(int *dots)
49{
50 int c;
51 Sym *s;
52
53 s = getsym();
54 if(s != S)
55 return s;
56
57 c = getnsc();
58 if(c != '.'){
59 unget(c);
60 return S;
61 }
62 if(getc() != '.' || getc() != '.')
63 yyerror("bad dots in macro");
64 *dots = 1;
65 return slookup("__VA_ARGS__");
66}
67
46int68int
47getcom(void)69getcom(void)
48{70{
@@ -172,7 +194,7 @@ macdef(void) · 123 unmodified lines
172{194{
173 Sym *s, *a;195 Sym *s, *a;
174 char *args[NARG], *np, *base;196 char *args[NARG], *np, *base;
175 int n, i, c, len;197 int n, i, c, len, dots;
176 int ischr;198 int ischr;
177 199
178 s = getsym();200 s = getsym();
@@ -182,13 +204,14 @@ macdef(void) · 3 unmodified lines
182 yyerror("macro redefined: %s", s->name);204 yyerror("macro redefined: %s", s->name);
183 c = getc();205 c = getc();
184 n = -1;206 n = -1;
207 dots = 0;
185 if(c == '(') {208 if(c == '(') {
186 n++;209 n++;
187 c = getnsc();210 c = getnsc();
188 if(c != ')') {211 if(c != ')') {
189 unget(c);212 unget(c);
190 for(;;) {213 for(;;) {
191 a = getsym();214 a = getsymdots(&dots);
192 if(a == S)215 if(a == S)
193 goto bad;216 goto bad;
194 if(n >= NARG) {217 if(n >= NARG) {
@@ -199,7 +222,7 @@ macdef(void) · 4 unmodified lines
199 c = getnsc();222 c = getnsc();
200 if(c == ')')223 if(c == ')')
201 break;224 break;
202 if(c != ',')225 if(c != ',' || dots)
203 goto bad;226 goto bad;
204 }227 }
205 }228 }
@@ -325,6 +348,8 @@ macdef(void) · 119 unmodified lines
325 } while(len & 3);348 } while(len & 3);
326 349
327 *base = n+1;350 *base = n+1;
351 if(dots)
352 *base |= VARMAC;
328 s->macro = base;353 s->macro = base;
329 if(debug['m'])354 if(debug['m'])
330 print("#define %s %s\n", s->name, s->macro+1);355 print("#define %s %s\n", s->name, s->macro+1);
@@ -343,16 +368,19 @@ macexpand(Sym *s, char *b) · 12 unmodified lines
343{368{
344 char buf[2000];369 char buf[2000];
345 int n, l, c, nargs;370 int n, l, c, nargs;
346 char *arg[NARG], *cp, *ob, *ecp;371 char *arg[NARG], *cp, *ob, *ecp, dots;
347 372
348 ob = b;373 ob = b;
349 nargs = *s->macro - 1;374 if(*s->macro == 0) {
350 if(nargs < 0) {
351 strcpy(b, s->macro+1);375 strcpy(b, s->macro+1);
352 if(debug['m'])376 if(debug['m'])
353 print("#expand %s %s\n", s->name, ob);377 print("#expand %s %s\n", s->name, ob);
354 return;378 return;
355 }379 }
380
381 nargs = (char)(*s->macro & ~VARMAC) - 1;
382 dots = *s->macro & VARMAC;
383
356 c = getnsc();384 c = getnsc();
357 if(c != '(')385 if(c != '(')
358 goto bad;386 goto bad;
@@ -425,6 +453,10 @@ macexpand(Sym *s, char *b) · 66 unmodified lines
425 }453 }
426 if(l == 0) {454 if(l == 0) {
427 if(c == ',') {455 if(c == ',') {
456 if(n == nargs && dots) {
457 *cp++ = ',';
458 continue;
459 }
428 *cp++ = 0;460 *cp++ = 0;
429 arg[n++] = cp;461 arg[n++] = cp;
430 if(n > nargs)462 if(n > nargs)
@@ -452,6 +484,8 @@ macexpand(Sym *s, char *b) · 21 unmodified lines
452 cp = s->macro+1;484 cp = s->macro+1;
453 for(;;) {485 for(;;) {
454 c = *cp++;486 c = *cp++;
487 if(c == '\n')
488 c = ' ';
455 if(c != '#') {489 if(c != '#') {
456 *b++ = c;490 *b++ = c;
457 if(c == 0)491 if(c == 0)
utils/kc/cgen.c+2−0
@@ -493,6 +493,8 @@ cgen(Node *n, Node *nn) · 492 unmodified lines
493 } else493 } else
494 gopcode(OADD, nodconst(v), Z, &nod);494 gopcode(OADD, nodconst(v), Z, &nod);
495 gopcode(OAS, &nod, Z, &nod2);495 gopcode(OAS, &nod, Z, &nod2);
496 if(nn && l->op == ONAME) /* in x=++i, emit USED(i) */
497 gins(ANOP, l, Z);
496 498
497 regfree(&nod);499 regfree(&nod);
498 if(l->addable < INDEXED)500 if(l->addable < INDEXED)
utils/kl/asm.c+5−0
@@ -1001,6 +1001,11 @@ asmout(Prog *p, Optab *o, int aflag) · 1000 unmodified lines
1001 }1001 }
1002 }1002 }
1003 break;1003 break;
1004
1005 case 57: /* op r1,r2 with reserved rs1 */
1006 r = 0;
1007 o1 = OP_RRR(opcode(p->as), p->from.reg, r, p->to.reg);
1008 break;
1004 }1009 }
1005 if(aflag)1010 if(aflag)
1006 return o1;1011 return o1;