--- /rc/bin/doctype Thu Apr 28 23:39:58 2011 +++ /rc/bin/doctype Wed May 29 19:39:28 2013 @@ -51,8 +51,8 @@ END { x = "" if (refer) { - if (e) x = "refer/refer -e " files " | " - else x = "refer/refer " files "| " + if (e) x = "refer -e " files " | " + else x = "refer " files "| " files = "" } else if (prefer) { x = "cat " files "| '$prefer'| "; files = "" } --- /rc/bin/fshalt Tue Oct 9 00:50:03 2012 +++ /rc/bin/fshalt Sat May 25 03:57:16 2013 @@ -32,7 +32,8 @@ } fn isbootable { - test -e $1 && ~ `{file $1} *' plan 9 boot image' + # on mips (for example), kernels are now a.out format + test -e $1 && ~ `{file $1} *' plan 9 boot image' *' plan 9 executable'* } fn usekernel { kerncopy=kern @@ -42,7 +43,7 @@ # make a copy of the right kernel if (~ $reboot yes) { kern=`{echo $terminal | - sed 's;^([^ ]+) .*/([^/]+)$;/n/boot/'$cputype'/9\2;'} + sed 's;^([^ ]+) .*/([^/ ]+).*$;/n/boot/'$cputype'/9\2;'} if (isbootable $kern) usekernel $kern if not { --- /sys/doc/compiler.ms Sat Jan 5 00:15:30 2013 +++ /sys/doc/compiler.ms Fri May 24 23:21:38 2013 @@ -22,11 +22,12 @@ Introduction .LP There are many compilers in the series. -Five of the compilers (Intel 386, AMD64, PowerPC, PowerPC 64-bit, ARM) +Six of the compilers +(Intel 386, AMD64, PowerPC, PowerPC 64-bit, ARM, MIPS R3000) are considered active and are used to compile current versions of Plan 9. -Two of the compilers (MIPS 3000, SPARC) -are maintained but are for older machines +One of the compilers (SPARC) +is maintained but is for older machines for which we have no current ports of Plan 9; we are unlikely to port to any SPARC machines. The DEC Alpha and Motorola 68020 compilers have been retired. @@ -53,7 +54,7 @@ program to produce the executable binary. The loader combines the roles of second half of the assembler, global optimizer, and loader. -The names of the compliers, loaders, and assemblers +The names of the compilers, loaders, and assemblers are as follows: .DS .ta 1.5i --- /sys/doc/compiler.ps Sat Jan 5 00:15:30 2013 +++ /sys/doc/compiler.ps Fri May 24 23:21:38 2013 @@ -3707,109 +3707,101 @@ (Introduction) 873 2890 w 10 /LucidaSansUnicode00 f (There) 720 3046 w -(are) 1038 3046 w -(many) 1230 3046 w -(compilers) 1532 3046 w -(in) 2046 3046 w -(the) 2177 3046 w -(series.) 2372 3046 w -(Five) 2760 3046 w -(of) 2991 3046 w -(the) 3129 3046 w -(compilers) 3324 3046 w -(\(Intel) 3838 3046 w -(386,) 4124 3046 w -(AMD64,) 4385 3046 w +(are) 1041 3046 w +(many) 1236 3046 w +(compilers) 1541 3046 w +(in) 2058 3046 w +(the) 2192 3046 w +(series.) 2390 3046 w +(Six) 2781 3046 w +(of) 2968 3046 w +(the) 3110 3046 w +(compilers) 3309 3046 w +(\(Intel) 3827 3046 w +(386,) 4117 3046 w +(AMD64,) 4382 3046 w (Pow\255) 4814 3046 w (erPC,) 720 3166 w -(PowerPC) 1013 3166 w -(64-bit,) 1467 3166 w -(ARM\)) 1852 3166 w -(are) 2143 3166 w -(considered) 2335 3166 w -(active) 2908 3166 w -(and) 3228 3166 w -(are) 3448 3166 w -(used) 3640 3166 w -(to) 3911 3166 w -(compile) 4048 3166 w -(current) 4469 3166 w -(ver\255) 4858 3166 w -(sions) 720 3286 w -(of) 1019 3286 w -(Plan) 1162 3286 w -(9.) 1408 3286 w -(Two) 1580 3286 w -(of) 1826 3286 w -(the) 1969 3286 w -(compilers) 2169 3286 w -(\(MIPS) 2688 3286 w -(3000,) 2991 3286 w -(SPARC\)) 3321 3286 w -(are) 3710 3286 w -(maintained) 3908 3286 w -(but) 4495 3286 w -(are) 4703 3286 w -(for) 4901 3286 w -(older) 720 3406 w -(machines) 1009 3406 w -(for) 1507 3406 w -(which) 1685 3406 w -(we) 2005 3406 w -(have) 2177 3406 w -(no) 2441 3406 w -(current) 2603 3406 w -(ports) 2991 3406 w -(of) 3282 3406 w -(Plan) 3418 3406 w -(9;) 3657 3406 w -(we) 3790 3406 w -(are) 3961 3406 w -(unlikely) 4151 3406 w -(to) 4566 3406 w -(port) 4702 3406 w -(to) 4942 3406 w -(any) 720 3526 w -(SPARC) 926 3526 w -(machines.) 1273 3526 w -(The) 1833 3526 w -(DEC) 2051 3526 w -(Alpha) 2286 3526 w -(and) 2601 3526 w -(Motorola) 2818 3526 w -(68020) 3286 3526 w -(compilers) 3638 3526 w -(have) 4149 3526 w -(been) 4411 3526 w -(retired.) 4685 3526 w -(Several) 720 3646 w -(others) 1100 3646 w -(\(Motorola) 1445 3646 w -(68000,) 1946 3646 w -(Intel) 2330 3646 w -(960,) 2580 3646 w -(AMD) 2838 3646 w -(29000\)) 3104 3646 w -(have) 3488 3646 w -(had) 3749 3646 w -(only) 3965 3646 w -(limited) 4205 3646 w -(use,) 4577 3646 w -(such) 4814 3646 w -(as) 720 3766 w -(to) 862 3766 w -(program) 996 3766 w -(peripherals) 1448 3766 w -(or) 2031 3766 w -(experimental) 2170 3766 w -(devices.) 2845 3766 w -(Any) 3304 3766 w -(of) 3524 3766 w -(the) 3659 3766 w -(disused) 3851 3766 w -(compilers) 4263 3766 w -(could) 4774 3766 w -(be restored if needed.) 720 3886 w +(PowerPC) 1010 3166 w +(64-bit,) 1461 3166 w +(ARM,) 1843 3166 w +(MIPS) 2130 3166 w +(R3000\)) 2391 3166 w +(are) 2776 3166 w +(considered) 2965 3166 w +(active) 3535 3166 w +(and) 3852 3166 w +(are) 4068 3166 w +(used) 4256 3166 w +(to) 4524 3166 w +(compile) 4658 3166 w +(current) 720 3286 w +(versions) 1109 3286 w +(of) 1551 3286 w +(Plan) 1688 3286 w +(9.) 1928 3286 w +(One) 2094 3286 w +(of) 2329 3286 w +(the) 2466 3286 w +(compilers) 2660 3286 w +(\(SPARC\)) 3173 3286 w +(is) 3588 3286 w +(maintained) 3708 3286 w +(but) 4289 3286 w +(is) 4491 3286 w +(for) 4611 3286 w +(older) 4790 3286 w +(machines) 720 3406 w +(for) 1223 3406 w +(which) 1406 3406 w +(we) 1731 3406 w +(have) 1907 3406 w +(no) 2175 3406 w +(current) 2341 3406 w +(ports) 2734 3406 w +(of) 3030 3406 w +(Plan) 3171 3406 w +(9;) 3415 3406 w +(we) 3553 3406 w +(are) 3729 3406 w +(unlikely) 3924 3406 w +(to) 4344 3406 w +(port) 4485 3406 w +(to) 4730 3406 w +(any) 4871 3406 w +(SPARC machines.) 720 3526 w +(The DEC Alpha and Motorola 68020 compilers have been) 1617 3526 w +(retired.) 4425 3526 w +(Sev\255) 4845 3526 w +(eral) 720 3646 w +(others) 939 3646 w +(\(Motorola) 1285 3646 w +(68000,) 1787 3646 w +(Intel) 2172 3646 w +(960,) 2423 3646 w +(AMD) 2682 3646 w +(29000\)) 2950 3646 w +(have) 3336 3646 w +(had) 3599 3646 w +(only) 3817 3646 w +(limited) 4059 3646 w +(use,) 4433 3646 w +(such) 4671 3646 w +(as) 4934 3646 w +(to) 720 3766 w +(program) 853 3766 w +(peripherals) 1304 3766 w +(or) 1885 3766 w +(experimental) 2022 3766 w +(devices.) 2696 3766 w +(Any) 3154 3766 w +(of) 3373 3766 w +(the) 3507 3766 w +(disused) 3698 3766 w +(compilers) 4109 3766 w +(could) 4619 3766 w +(be) 4921 3766 w +(restored if needed.) 720 3886 w 10 /LucidaSans-Demi f (2.) 720 4126 w (Structure) 873 4126 w @@ -3899,7 +3891,7 @@ (global) 4466 5038 w (opti\255) 4817 5038 w (mizer, and loader.) 720 5158 w -(The names of the compliers, loaders, and assemblers are as follows:) 1673 5158 w +(The names of the compilers, loaders, and assemblers are as follows:) 1673 5158 w (SPARC) 1080 5338 w 10 /LucidaTypewriter f (kc) 2160 5338 w --- /sys/include/ape/stdio.h Fri Jan 22 18:38:55 2010 +++ /sys/include/ape/stdio.h Wed May 29 04:38:29 2013 @@ -88,14 +88,14 @@ extern int printf(const char *, ...); extern int scanf(const char *, ...); extern int sprintf(char *, const char *, ...); -#ifdef _C99_SNPRINTF_EXTENSION /* user knows about c99 out-of-bounds returns */ + +/* + * NB: C99 now *requires *snprintf to return the number of characters + * that would have been written, had there been room. + */ extern int snprintf(char *, size_t, const char *, ...); extern int vsnprintf(char *, size_t, const char *, va_list); -#else -/* draw errors on any attempt to use *snprintf value so old code gets changed */ -extern void snprintf(char *, size_t, const char *, ...); -extern void vsnprintf(char *, size_t, const char *, va_list); -#endif + extern int sscanf(const char *, const char *, ...); extern int vfprintf(FILE *, const char *, va_list); extern int vprintf(const char *, va_list); --- /sys/src/9/bcm/usbdwc.c Tue Jan 29 23:07:08 2013 +++ /sys/src/9/bcm/usbdwc.c Wed May 29 19:50:31 2013 @@ -138,9 +138,12 @@ hcc |= Lspddev; /* fall through */ case Fullspeed: - hc->hcsplt = Spltena | POS_ALL | ep->dev->hub<dev->port; - break; + if(ep->dev->hub > 1){ + hc->hcsplt = Spltena | POS_ALL | ep->dev->hub<dev->port; + break; + } + /* fall through */ default: hc->hcsplt = 0; break; @@ -181,6 +184,8 @@ Hostchan *hc; hc = a; + if(hc->hcint == (Chhltd|Ack)) + return 0; return (hc->hcint & hc->hcintmsk) != 0; } @@ -390,7 +395,7 @@ if((i & Xfercomp) == 0 && i != (Chhltd|Ack) && i != Chhltd){ if(i & Stall) error(Estalled); - if(i & Nyet) + if(i & (Nyet|Frmovrun)) continue; if(i & Nak){ if(ep->ttype == Tintr) @@ -399,6 +404,7 @@ tsleep(&up->sleep, return0, 0, 1); continue; } + logdump(ep); print("usbotg: ep%d.%d error intr %8.8ux\n", ep->dev->nb, ep->nb, i); if(i & ~(Chhltd|Ack)) @@ -447,6 +453,24 @@ } static long +multitrans(Ep *ep, Hostchan *hc, int rw, void *a, long n) +{ + long sofar, m; + + sofar = 0; + do{ + m = n - sofar; + if(m > ep->maxpkt) + m = ep->maxpkt; + m = chanio(ep, hc, rw == Read? Epin : Epout, ep->toggle[rw], + (char*)a + sofar, m); + ep->toggle[rw] = hc->hctsiz & Pid; + sofar += m; + }while(sofar < n && m == ep->maxpkt); + return sofar; +} + +static long eptrans(Ep *ep, int rw, void *a, long n) { Hostchan *hc; @@ -467,21 +491,9 @@ nexterror(); } chansetup(hc, ep); - if(rw == Read && ep->ttype == Tbulk){ - long sofar, m; - - sofar = 0; - do{ - m = n - sofar; - if(m > ep->maxpkt) - m = ep->maxpkt; - m = chanio(ep, hc, Epin, ep->toggle[rw], - (char*)a + sofar, m); - ep->toggle[rw] = hc->hctsiz & Pid; - sofar += m; - }while(sofar < n && m == ep->maxpkt); - n = sofar; - }else{ + if(rw == Read && ep->ttype == Tbulk) + n = multitrans(ep, hc, rw, a, n); + else{ n = chanio(ep, hc, rw == Read? Epin : Epout, ep->toggle[rw], a, n); ep->toggle[rw] = hc->hctsiz & Pid; @@ -532,7 +544,11 @@ chansetup(hc, ep); chanio(ep, hc, Epout, SETUP, req, Rsetuplen); if(req[Rtype] & Rd2h){ - b->wp += chanio(ep, hc, Epin, DATA1, data, datalen); + if(ep->dev->hub <= 1){ + ep->toggle[Read] = DATA1; + b->wp += multitrans(ep, hc, Read, data, datalen); + }else + b->wp += chanio(ep, hc, Epin, DATA1, data, datalen); chanio(ep, hc, Epout, DATA1, nil, 0); n = Rsetuplen; }else{ --- /sys/src/9/pc/fns.h Fri Aug 24 01:13:04 2012 +++ /sys/src/9/pc/fns.h Tue May 28 22:52:16 2013 @@ -31,6 +31,7 @@ void fpenv(FPsave*); void fpinit(void); void fpoff(void); +void fpon(void); void (*fprestore)(FPsave*); void (*fpsave)(FPsave*); void fpsserestore(FPsave*); --- /sys/src/9/pc/l.s Fri Feb 1 21:43:57 2013 +++ /sys/src/9/pc/l.s Tue May 28 22:52:06 2013 @@ -773,7 +773,11 @@ MOVL CR0, AX ;\ ANDL $~0xC, AX /* EM=0, TS=0 */ ;\ MOVL AX, CR0 - + +TEXT fpon(SB), $0 /* enable */ + FPON + RET + TEXT fpoff(SB), $0 /* disable */ FPOFF(l1) RET @@ -809,7 +813,7 @@ TEXT fpenv(SB), $0 /* save state without waiting */ MOVL p+0(FP), AX - FSTENV 0(AX) + FSTENV 0(AX) /* also masks FP exceptions */ RET TEXT fpclear(SB), $0 /* clear pending exceptions */ --- /sys/src/9/pc/main.c Wed Aug 15 20:33:47 2012 +++ /sys/src/9/pc/main.c Tue May 28 22:53:37 2013 @@ -580,7 +580,9 @@ /* * save floating point state to check out error */ - fpenv(&up->fpsave); + fpenv(&up->fpsave); /* result ignored, but masks fp exceptions */ + fpsave(&up->fpsave); /* also turns fpu off */ + fpon(); mathnote(); if((ur->pc & 0xf0000000) == KZERO){ --- /sys/src/ape/config Thu Feb 28 19:46:36 2002 +++ /sys/src/ape/config Wed May 29 19:39:45 2013 @@ -5,7 +5,7 @@ APELIB=/rc/bin/ape # where helper programs go CC=pcc # compiler (must be ansi) LD=pcc # loader -CFLAGS= # global defaults +CFLAGS=-FTVw # global defaults FAMILY=plan9 AR=ar # manipulating libraries RANLIB=echo # for updating libraries --- /sys/src/ape/lib/9/mkfile Wed Jan 30 21:54:00 2013 +++ /sys/src/ape/lib/9/mkfile Wed May 29 02:18:14 2013 @@ -24,7 +24,7 @@ speed_t -cfgetospeed(const struct termios *p) +cfgetospeed(const struct termios *) { return B0; } int -cfsetospeed(struct termios *p, speed_t s) +cfsetospeed(struct termios *, speed_t) { return 0; } speed_t -cfgetispeed(const struct termios *p) +cfgetispeed(const struct termios *) { return B0; } int -cfsetispeed(struct termios *p, speed_t s) +cfsetispeed(struct termios *, speed_t) { return 0; } --- /sys/src/ape/lib/ap/plan9/ctime.c Mon Jun 2 00:05:41 2008 +++ /sys/src/ape/lib/ap/plan9/ctime.c Wed May 29 04:21:18 2013 @@ -148,7 +148,7 @@ struct tm *ct; time_t t, tim; long *p; - int i, dlflag; + int dlflag; tim = *timp; if(timezone.stname[0] == 0) --- /sys/src/ape/lib/ap/plan9/dup.c Thu Feb 28 19:46:24 2002 +++ /sys/src/ape/lib/ap/plan9/dup.c Wed May 29 04:21:18 2013 @@ -11,8 +11,6 @@ int dup2(int oldd, int newd) { - int n; - if(newd < 0 || newd >= OPEN_MAX){ errno = EBADF; return -1; --- /sys/src/ape/lib/ap/plan9/execle.c Thu Feb 28 19:46:24 2002 +++ /sys/src/ape/lib/ap/plan9/execle.c Wed May 29 04:21:10 2013 @@ -1,7 +1,7 @@ #include int -execle(const char *name, const char *arg0, const char *aore, ...) +execle(const char *name, const char *arg0, const char *, ...) { char *p; --- /sys/src/ape/lib/ap/plan9/execve.c Thu Feb 28 19:46:24 2002 +++ /sys/src/ape/lib/ap/plan9/execve.c Wed May 29 04:21:10 2013 @@ -60,7 +60,7 @@ f = _CREATE("#e/_sighdlr", OWRITE, 0666); if(f >= 0){ ss = buf; - for(i = 0, n=0; i <=MAXSIG && ss < &buf[sizeof(buf)]-5; i++) { + for(i = 0; i <=MAXSIG && ss < &buf[sizeof(buf)]-5; i++) { if(_sighdlr[i] == SIG_IGN) { ss = _ultoa(ss, i); *ss++ = ' '; @@ -71,7 +71,7 @@ } if(envp){ strcpy(nam, "#e/"); - for(e = envp; (ss = *e); e++) { + for(e = (char **)envp; (ss = *e); e++) { se = strchr(ss, '='); if(!se || ss==se) continue; /* what is name? value? */ --- /sys/src/ape/lib/ap/plan9/fsync.c Thu Feb 28 19:46:25 2002 +++ /sys/src/ape/lib/ap/plan9/fsync.c Wed May 29 04:21:10 2013 @@ -3,7 +3,7 @@ #include int -fsync(int fd) +fsync(int) { errno = EINVAL; return -1; --- /sys/src/ape/lib/ap/plan9/getgrnam.c Thu Feb 28 19:46:24 2002 +++ /sys/src/ape/lib/ap/plan9/getgrnam.c Wed May 29 04:21:03 2013 @@ -13,7 +13,7 @@ char *nam, *mem; num = 0; - nam = name; + nam = (char *)name; mem = 0; if(_getpw(&num, &nam, &mem)){ holdgroup.gr_name = nam; --- /sys/src/ape/lib/ap/plan9/getgroups.c Thu Feb 28 19:46:25 2002 +++ /sys/src/ape/lib/ap/plan9/getgroups.c Wed May 29 04:21:03 2013 @@ -3,7 +3,7 @@ #include int -getgroups(int gidsize, gid_t grouplist[]) +getgroups(int, gid_t []) { errno = EINVAL; return -1; --- /sys/src/ape/lib/ap/plan9/getpwnam.c Thu Feb 28 19:46:24 2002 +++ /sys/src/ape/lib/ap/plan9/getpwnam.c Wed May 29 04:21:03 2013 @@ -14,7 +14,7 @@ char *nam, *mem; num = 0; - nam = name; + nam = (char *)name; mem = 0; if(_getpw(&num, &nam, &mem)){ holdpw.pw_name = nam; --- /sys/src/ape/lib/ap/plan9/isatty.c Thu Feb 28 19:46:24 2002 +++ /sys/src/ape/lib/ap/plan9/isatty.c Wed May 29 04:39:10 2013 @@ -8,7 +8,6 @@ int _isatty(int fd) { - int t; char buf[64]; if(_FD2PATH(fd, buf, sizeof buf) < 0) @@ -20,7 +19,7 @@ /* The FD_ISTTY flag is set via _isatty in _fdsetup or open */ int -isatty(fd) +isatty(int fd) { if(_fdinfo[fd].flags&FD_ISTTY) return 1; --- /sys/src/ape/lib/ap/plan9/link.c Thu Feb 28 19:46:24 2002 +++ /sys/src/ape/lib/ap/plan9/link.c Wed May 29 04:21:03 2013 @@ -5,7 +5,7 @@ * BUG: LINK_MAX==1 isn't really allowed */ int -link(const char *name1, const char *name2) +link(const char *, const char *) { errno = EMLINK; return -1; --- /sys/src/ape/lib/ap/plan9/mkfile Fri Apr 29 21:40:45 2011 +++ /sys/src/ape/lib/ap/plan9/mkfile Wed May 29 04:20:29 2013 @@ -105,6 +105,6 @@ =OPEN_MAX || !((f = &_fdinfo[d])->flags&FD_ISOPEN)){ + if(d<0 || d>=OPEN_MAX || !(_fdinfo[d].flags&FD_ISOPEN)){ errno = EBADF; return -1; } --- /sys/src/ape/lib/ap/plan9/rename.c Sun Mar 2 23:10:06 2003 +++ /sys/src/ape/lib/ap/plan9/rename.c Wed May 29 04:20:46 2013 @@ -10,10 +10,9 @@ int rename(const char *from, const char *to) { - int n, i; + int n; char *f, *t; Dir *d, nd; - long mode; if(access(to, 0) >= 0){ if(_REMOVE(to) < 0){ @@ -32,12 +31,11 @@ } f = strrchr(from, '/'); t = strrchr(to, '/'); - f = f? f+1 : from; - t = t? t+1 : to; + f = f? f+1 : (char *)from; + t = t? t+1 : (char *)to; n = 0; if(f-from==t-to && strncmp(from, to, f-from)==0){ /* from and to are in same directory (we miss some cases) */ - i = strlen(t); _nulldir(&nd); nd.name = t; if(_dirwstat(from, &nd) < 0){ @@ -49,6 +47,7 @@ int ffd, tfd; char buf[8192]; + tfd = -1; if((ffd = _OPEN(from, 0)) < 0 || (tfd = _CREATE(to, 1, d->mode)) < 0){ _CLOSE(ffd); --- /sys/src/ape/lib/ap/plan9/setgid.c Thu Feb 28 19:46:25 2002 +++ /sys/src/ape/lib/ap/plan9/setgid.c Wed May 29 04:20:44 2013 @@ -7,7 +7,7 @@ */ int -setgid(gid_t gid) +setgid(gid_t) { errno = EPERM; return -1; --- /sys/src/ape/lib/ap/plan9/setuid.c Thu Feb 28 19:46:25 2002 +++ /sys/src/ape/lib/ap/plan9/setuid.c Wed May 29 04:20:44 2013 @@ -7,7 +7,7 @@ */ int -setuid(uid_t uid) +setuid(uid_t) { errno = EPERM; return -1; --- /sys/src/ape/lib/ap/plan9/signal.c Sat Mar 10 22:55:19 2012 +++ /sys/src/ape/lib/ap/plan9/signal.c Wed May 29 05:15:25 2013 @@ -37,8 +37,10 @@ void (*_sighdlr[MAXSIG+1])(int, char*, Ureg*); /* 0 initialized: SIG_DFL */ +/* must match signal.h: extern void (*signal(int, void (*)()))(); */ +//void (*signal(int sig, void (*func)(int, char*, Ureg*)))(int, char*, Ureg*) void -(*signal(int sig, void (*func)(int, char*, Ureg*)))(int, char*, Ureg*) +(*signal(int sig, void (*func)()))() { void(*oldf)(int, char*, Ureg*); @@ -88,7 +90,7 @@ /* this is registered in _envsetup */ int -_notehandler(Ureg *u, char *msg) +_notehandler(void *u, char *msg) { int i; void(*f)(int, char*, Ureg*); @@ -106,7 +108,7 @@ /* notetramp is machine-dependent; doesn't return to here */ } _NOTED(0); /* NCONT */ - return; + return 0; } } _doatexits(); --- /sys/src/ape/lib/ap/plan9/sigsuspend.c Thu Feb 28 19:46:25 2002 +++ /sys/src/ape/lib/ap/plan9/sigsuspend.c Wed May 29 04:20:36 2013 @@ -6,7 +6,7 @@ */ int -sigsuspend(sigset_t *set) +sigsuspend(sigset_t *) { errno = EINVAL; return -1; --- /sys/src/ape/lib/ap/plan9/tcgetattr.c Sat Mar 10 22:55:26 2012 +++ /sys/src/ape/lib/ap/plan9/tcgetattr.c Wed May 29 04:20:33 2013 @@ -87,7 +87,7 @@ /* BUG: ignores optional actions */ int -tcsetattr(int fd, int optactions, const struct termios *t) +tcsetattr(int fd, int, const struct termios *t) { int n, i; char buf[100]; --- /sys/src/ape/lib/ap/plan9/umask.c Thu Feb 28 19:46:25 2002 +++ /sys/src/ape/lib/ap/plan9/umask.c Wed May 29 04:20:29 2013 @@ -7,7 +7,7 @@ */ mode_t -umask(mode_t numask) +umask(mode_t) { return 0; } --- /sys/src/ape/lib/ap/plan9/unlink.c Mon Nov 25 16:18:48 2002 +++ /sys/src/ape/lib/ap/plan9/unlink.c Wed May 29 04:20:29 2013 @@ -67,6 +67,7 @@ free(db2); } } + n = 0; if(fd == -1) if((n=_REMOVE(path)) < 0) _syserrno(); --- /sys/src/ape/lib/ap/posix/getpwent.c Thu Feb 28 19:46:21 2002 +++ /sys/src/ape/lib/ap/posix/getpwent.c Wed May 29 04:24:47 2013 @@ -49,7 +49,7 @@ passwd.pw_dir = p; p = pwskip(p); passwd.pw_shell = p; - p = pwskip(p); + pwskip(p); return(&passwd); } --- /sys/src/ape/lib/ap/posix/mkfifo.c Thu Feb 28 19:46:21 2002 +++ /sys/src/ape/lib/ap/posix/mkfifo.c Wed May 29 04:24:47 2013 @@ -3,10 +3,8 @@ #include int -mkfifo(char *path, mode_t mode) +mkfifo(char *, mode_t) { -#pragma ref path -#pragma ref mode errno = 0; return -1; } --- /sys/src/ape/lib/ap/posix/mkfile Thu Feb 28 19:46:21 2002 +++ /sys/src/ape/lib/ap/posix/mkfile Wed May 29 04:24:47 2013 @@ -13,4 +13,4 @@ long -pathconf(const char *path, int name) +pathconf(const char *, int name) { -#pragma ref path - switch(name) { case _PC_LINK_MAX: @@ -46,10 +44,8 @@ } long -fpathconf(int fd, int name) +fpathconf(int, int name) { -#pragma ref fd - return pathconf(0, name); } --- /sys/src/ape/lib/ap/posix/tzset.c Thu Feb 28 19:46:21 2002 +++ /sys/src/ape/lib/ap/posix/tzset.c Wed May 29 04:24:48 2013 @@ -138,4 +138,5 @@ * we could go on... * but why bother? */ + USED(env); } --- /sys/src/ape/lib/ap/power/mkfile Sun Feb 8 21:33:37 2009 +++ /sys/src/ape/lib/ap/power/mkfile Wed May 29 03:53:17 2013 @@ -19,5 +19,5 @@ ctl); @@ -113,9 +116,7 @@ } int -listen(fd, backlog) - int fd; - int backlog; +listen(int fd, int) { Rock *r; int n, cfd; @@ -137,7 +138,7 @@ return -1; } lip = (struct sockaddr_in*)&r->addr; - if(lip->sin_port >= 0) { + if(1 || lip->sin_port >= 0) { /* sin_port is unsigned */ if(write(cfd, "bind 0", 6) < 0) { errno = EGREG; close(cfd); --- /sys/src/ape/lib/bsd/lstat.c Thu Feb 28 19:46:35 2002 +++ /sys/src/ape/lib/bsd/lstat.c Wed May 29 02:17:59 2013 @@ -9,14 +9,14 @@ } int -symlink(char *name1, char *name2) +symlink(char *, char *) { errno = EPERM; return -1; } int -readlink(char *name, char *buf, int size) +readlink(char *, char *, int ) { errno = EIO; return -1; --- /sys/src/ape/lib/bsd/mkfile Mon Jun 18 21:18:27 2012 +++ /sys/src/ape/lib/bsd/mkfile Wed May 29 02:17:59 2013 @@ -51,4 +51,4 @@ int -socketpair(int domain, int type, int protocol, int *sv) +socketpair(int domain, int , int , int *sv) { switch(domain){ case PF_UNIX: --- /sys/src/ape/lib/bsd/writev.c Thu Feb 28 19:46:35 2002 +++ /sys/src/ape/lib/bsd/writev.c Wed May 29 02:18:00 2013 @@ -15,7 +15,7 @@ char *t, *e, *f; char buf[10*1024]; - written = n = 0; + written = 0; t = buf; e = buf+sizeof(buf); for(;ent ; v++, ent--){ --- /sys/src/ape/lib/draw/mkfile Thu Apr 27 02:29:42 2006 +++ /sys/src/ape/lib/draw/mkfile Wed May 29 02:19:08 2013 @@ -69,7 +69,7 @@ 0) *p++ = se[--i]; } - *p++ = '\0'; + *p = '\0'; } static char* @@ -266,12 +266,6 @@ found: errno = oerr; - - /* - * sign - */ - d = 0; - i = 0; /* * round & adjust 'f' digits --- /sys/src/ape/lib/fmt/fmtdef.h Thu Apr 27 02:29:42 2006 +++ /sys/src/ape/lib/fmt/fmtdef.h Wed May 29 03:24:51 2013 @@ -25,7 +25,7 @@ #define vlong _fmtvlong #define uvlong _fmtuvlong -#define USED(x) if(x);else +// #define USED(x) if(x);else typedef unsigned char uchar; typedef unsigned short ushort; --- /sys/src/ape/lib/fmt/fmtprint.c Tue Jul 10 23:41:57 2012 +++ /sys/src/ape/lib/fmt/fmtprint.c Wed May 29 03:24:10 2013 @@ -28,9 +28,9 @@ va_list va; int n; - va_start(f->args, fmt); + va_start(va, fmt); n = fmtvprint(f, fmt, va); - va_end(f->args); + va_end(va); return n; } --- /sys/src/ape/lib/fmt/mkfile Tue Dec 2 02:04:29 2003 +++ /sys/src/ape/lib/fmt/mkfile Wed May 29 03:24:16 2013 @@ -56,4 +56,4 @@ $CC -o test test.$O $LIB -L$PLAN9/lib -lutf -CFLAGS=-c -D_POSIX_SOURCE -D_PLAN9_SOURCE -D_BSD_EXTENSION +CFLAGS=$CFLAGS -c -D_POSIX_SOURCE -D_PLAN9_SOURCE -D_BSD_EXTENSION --- /sys/src/ape/lib/fmt/nan64.c Tue Dec 2 02:04:29 2003 +++ /sys/src/ape/lib/fmt/nan64.c Wed May 29 03:24:10 2013 @@ -7,22 +7,12 @@ #include "nan.h" -#ifdef __APPLE__ -#define _NEEDLL -#endif - typedef unsigned long long uvlong; typedef unsigned long ulong; -#ifdef _NEEDLL static uvlong uvnan = 0x7FF0000000000001LL; static uvlong uvinf = 0x7FF0000000000000LL; static uvlong uvneginf = 0xFFF0000000000000LL; -#else -static uvlong uvnan = 0x7FF0000000000001; -static uvlong uvinf = 0x7FF0000000000000; -static uvlong uvneginf = 0xFFF0000000000000; -#endif double __NaN(void) --- /sys/src/ape/lib/l/main.c Thu Feb 28 19:46:34 2002 +++ /sys/src/ape/lib/l/main.c Wed May 29 03:25:44 2013 @@ -6,7 +6,7 @@ void main(int argc, char *argv[]) { - USED(argc); + USED(argc, argv); yylex(); exit(0); } --- /sys/src/ape/lib/l/mkfile Thu Feb 28 19:46:34 2002 +++ /sys/src/ape/lib/l/mkfile Wed May 29 03:25:44 2013 @@ -10,4 +10,4 @@ = 0) return 0; @@ -25,7 +25,7 @@ return 0; } -tty_echoon(int fd) +tty_echoon(int) { if(ctlfd >= 0){ write(ctlfd, "rawoff", 6); --- /sys/src/cmd/cc/lex.c Tue Apr 30 22:05:24 2013 +++ /sys/src/cmd/cc/lex.c Thu May 23 21:00:05 2013 @@ -407,7 +407,7 @@ #define EOF (-1) #define IGN (-2) -#define ESC (1<<20) +#define ESC (Runemask+1) /* Rune flag: a literal byte */ #define GETC() ((--fi.c < 0)? filbuf(): (*fi.p++ & 0xff)) enum --- /sys/src/cmd/unix/drawterm/kern/win32.c Mon May 22 01:33:29 2006 +++ /sys/src/cmd/unix/drawterm/kern/win32.c Wed May 29 00:39:58 2013 @@ -448,7 +448,7 @@ long showfilewrite(char *a, int n) { - Rune *action, *arg, *cmd; + Rune *action, *arg, *cmd, *p; static Rune Lopen[] = { 'o', 'p', 'e', 'n', 0 }; cmd = runesmprint("%.*s", n, a); --- /sys/src/cmd/yacc.c Wed Oct 10 00:46:42 2012 +++ /sys/src/cmd/yacc.c Thu May 23 00:11:01 2013 @@ -141,7 +141,7 @@ char* infile; /* input file name */ int numbval; /* value of an input number */ -char tokname[NAMESIZE+4]; /* input token name, slop for runes and 0 */ +char tokname[NAMESIZE+UTFmax+1]; /* input token name, slop for runes and 0 */ /* structure declarations */ --- /sys/src/libc/mips/c_fcr0.s Mon Apr 8 20:17:30 2013 +++ /sys/src/libc/mips/c_fcr0.s Sun May 26 06:06:01 2013 @@ -1,3 +1,5 @@ + NOSCHED TEXT C_fcr0(SB), $0 MOVW FCR0, R1 RET + NOP --- /sys/src/libstdio/dtoa.c Fri Apr 12 22:15:33 2013 +++ /sys/src/libstdio/dtoa.c Fri May 31 23:45:07 2013 @@ -511,9 +511,11 @@ static double ulp(double x) { - register ulong L; + ulong L; + Ulongs uls; - L = (double2ulongs(x).hi & Exp_mask) - (P - 1) * Exp_msk1; + uls = double2ulongs(x); + L = (uls.hi & Exp_mask) - (P - 1) * Exp_msk1; return ulongs2double((Ulongs){L, 0}); } @@ -563,7 +565,7 @@ de = (int)(uls.hi >> Exp_shift); z |= Exp_msk11; if (y = uls.lo) { /* assignment = */ - if (k = lo0bits(&y)) { + if (k = lo0bits(&y)) { /* assignment = */ x[0] = y | z << 32 - k; z >>= k; } else @@ -902,7 +904,7 @@ ulsd2 = ulsd; ulsd2.hi &= Frac_mask1; - ulsd2.lo |= Exp_11; + ulsd2.hi |= Exp_11; d2 = ulongs2double(ulsd2); /* log(x) ~=~ log(1.5) + (x-1.5)/1.5 @@ -1050,6 +1052,7 @@ eps *= tens[ilim-1]; for (i = 1; ; i++, d *= 10.) { L = d; + // assert(L < 10); d -= L; *s++ = '0' + (int)L; if (i == ilim) {