changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: format pointer subtraction results with %zd instead of %ld (for long -> intptr on amd64)

changeset 5048: e16a172bcae6
parent 5047: f9e97784c6ea
child 5049: fb1f6926ba18
author: cinap_lenrek@felloff.net
date: Thu, 07 Jan 2016 04:44:13 +0100
files: sys/src/9/ip/esp.c sys/src/9/pc/archmp.c sys/src/9/pc/etherrt2860.c sys/src/9/port/devaoe.c sys/src/9/port/devtls.c sys/src/9/port/proc.c sys/src/cmd/9nfs/9p.c sys/src/cmd/9nfs/nfs.c sys/src/cmd/9nfs/nfsmount.c sys/src/cmd/9nfs/string.c sys/src/cmd/aux/astarld.c sys/src/cmd/cfs/inode.c sys/src/cmd/cifs/netbios.c sys/src/cmd/cwfs/juke.c sys/src/cmd/ip/httpd/sendfd.c sys/src/cmd/ip/ppp/mppc.c sys/src/cmd/ip/ppp/ppp.c sys/src/cmd/ip/snoopy/hdlc.c sys/src/cmd/ip/snoopy/ttls.c sys/src/cmd/jpg/ico.c sys/src/cmd/ndb/convM2DNS.c sys/src/cmd/nusb/disk/disk.c sys/src/cmd/plot/plot.c sys/src/cmd/ssh/msg.c sys/src/cmd/tcs/tcs.c sys/src/cmd/telco/telco.c sys/src/cmd/upas/bayes/dfa.c sys/src/cmd/upas/bayes/msgtok.c sys/src/cmd/upas/fs/mbox.c sys/src/cmd/venti/srv/buildindex.c sys/src/cmd/venti/srv/fixarenas.c sys/src/cmd/venti/srv/unwhack.c sys/src/cmd/webfs/fs.c sys/src/libaml/aml.c sys/src/libflate/deflate.c
description: format pointer subtraction results with %zd instead of %ld (for long -> intptr on amd64)
     1.1--- a/sys/src/9/ip/esp.c
     1.2+++ b/sys/src/9/ip/esp.c
     1.3@@ -511,7 +511,7 @@ print("esp: bad auth %I -> %I!%ld\n", ve
     1.4 	payload = BLEN(bp) - vers.hdrlen - ecb->ahlen;
     1.5 	if(payload <= 0 || payload % 4 != 0 || payload % ecb->espblklen != 0) {
     1.6 		qunlock(c);
     1.7-		netlog(f, Logesp, "esp: bad length %I -> %I!%lud payload=%d BLEN=%lud\n",
     1.8+		netlog(f, Logesp, "esp: bad length %I -> %I!%lud payload=%d BLEN=%zd\n",
     1.9 			vers.raddr, vers.laddr, vers.spi, payload, BLEN(bp));
    1.10 		freeb(bp);
    1.11 		return;
     2.1--- a/sys/src/9/pc/archmp.c
     2.2+++ b/sys/src/9/pc/archmp.c
     2.3@@ -310,7 +310,7 @@ pcmpinit(void)
     2.4 	 */
     2.5 	while(p < e) switch(*p){
     2.6 	default:
     2.7-		print("pcmpinit: unknown PCMP type 0x%uX (e-p 0x%luX)\n",
     2.8+		print("pcmpinit: unknown PCMP type 0x%uX (e-p 0x%zuX)\n",
     2.9 			*p, e-p);
    2.10 		while(p < e){
    2.11 			print("%uX ", *p);
     3.1--- a/sys/src/9/pc/etherrt2860.c
     3.2+++ b/sys/src/9/pc/etherrt2860.c
     3.3@@ -2658,7 +2658,7 @@ transmit(Wifi *wifi, Wnode *wn, Block *b
     3.4 	p = pool->p + pool->i * TxwiDmaSz;
     3.5 	w = (Wifipkt*)(p + Txwisize);
     3.6 	if(ctlr->wifi->debug){
     3.7-		print("transmit: %E->%E,%E nodeid=%x txq[%d]=%d size=%ld\n", w->a2, w->a1, w->a3, nodeid, qid, ctlr->tx[qid].i, BLEN(outb));
     3.8+		print("transmit: %E->%E,%E nodeid=%x txq[%d]=%d size=%zd\n", w->a2, w->a1, w->a3, nodeid, qid, ctlr->tx[qid].i, BLEN(outb));
     3.9 	}
    3.10 
    3.11 	tx->i = (tx->i + 1) % Ntx;
     4.1--- a/sys/src/9/port/devaoe.c
     4.2+++ b/sys/src/9/port/devaoe.c
     4.3@@ -2141,7 +2141,7 @@ atarsp(Block *b)
     4.4 		case Crd:
     4.5 		case Crdext:
     4.6 			if(BLEN(b) - (Aoehsz + Aoeatasz) != n){
     4.7-				eventlog("%æ: misread blen %ld expect %d\n",
     4.8+				eventlog("%æ: misread blen %zd expect %d\n",
     4.9 					d, BLEN(b), n);
    4.10 				goto bail;
    4.11 			}
    4.12@@ -2159,7 +2159,7 @@ atarsp(Block *b)
    4.13 			break;
    4.14 		case Cid:
    4.15 			if(BLEN(b) - (Aoehsz + Aoeatasz) < 512){
    4.16-				eventlog("%æ: runt identify blen %ld expect %d\n",
    4.17+				eventlog("%æ: runt identify blen %zd expect %d\n",
    4.18 					d, BLEN(b), 512 + Aoehsz + Aoeatasz);
    4.19 				goto bail;
    4.20 			}
     5.1--- a/sys/src/9/port/devtls.c
     5.2+++ b/sys/src/9/port/devtls.c
     5.3@@ -1115,7 +1115,7 @@ tlsbread(Chan *c, long n, ulong offset)
     5.4 
     5.5 		/* return at most what was asked for */
     5.6 		b = qgrab(&tr->processed, n);
     5.7-if(tr->debug) pprint("consumed processed %ld\n", BLEN(b));
     5.8+if(tr->debug) pprint("consumed processed %zd\n", BLEN(b));
     5.9 if(tr->debug) pdump(BLEN(b), b->rp, "consumed:");
    5.10 		qunlock(&tr->in.io);
    5.11 		poperror();
    5.12@@ -1272,7 +1272,7 @@ tlsrecwrite(TlsRec *tr, int type, Block 
    5.13 		nexterror();
    5.14 	}
    5.15 	qlock(&out->io);
    5.16-if(tr->debug)pprint("send %ld\n", BLEN(b));
    5.17+if(tr->debug)pprint("send %zd\n", BLEN(b));
    5.18 if(tr->debug)pdump(BLEN(b), b->rp, "sent:");
    5.19 
    5.20 
     6.1--- a/sys/src/9/port/proc.c
     6.2+++ b/sys/src/9/port/proc.c
     6.3@@ -1362,7 +1362,7 @@ scheddump(void)
     6.4 	for(rq = &runq[Nrq-1]; rq >= runq; rq--){
     6.5 		if(rq->head == nil)
     6.6 			continue;
     6.7-		print("rq%ld:", rq-runq);
     6.8+		print("rq%zd:", rq-runq);
     6.9 		for(p = rq->head; p != nil; p = p->rnext)
    6.10 			print(" %lud(%lud)", p->pid, m->ticks - p->readytime);
    6.11 		print("\n");
     7.1--- a/sys/src/cmd/9nfs/9p.c
     7.2+++ b/sys/src/cmd/9nfs/9p.c
     7.3@@ -130,7 +130,7 @@ newfid(Session *s)
     7.4 		*(f->owner) = 0;
     7.5 		f->owner = 0;
     7.6 	}
     7.7-	chat("%ld...", f - s->fids);
     7.8+	chat("%zd...", f - s->fids);
     7.9 	f->tstale = nfstime + staletime;
    7.10 	return f;
    7.11 }
    7.12@@ -153,7 +153,7 @@ setfid(Session *s, Fid *f)
    7.13 void
    7.14 putfid(Session *s, Fid *f)
    7.15 {
    7.16-	chat("putfid %ld...", f-s->fids);
    7.17+	chat("putfid %zd...", f-s->fids);
    7.18 	if(s == 0 || f == 0){
    7.19 		clog("putfid(0x%p, 0x%p) %s", s, f, (s ? s->service : "?"));
    7.20 		return;
     8.1--- a/sys/src/cmd/9nfs/nfs.c
     8.2+++ b/sys/src/cmd/9nfs/nfs.c
     8.3@@ -330,7 +330,7 @@ xfwalkcr(int type, Xfid *xf, String *ele
     8.4 		newxf->urfid = nfid;
     8.5 		nfid->owner = &newxf->urfid;
     8.6 	}else if(newxf->urfid){
     8.7-		chat("old xfid %ld...", newxf->urfid-s->fids);
     8.8+		chat("old xfid %zd...", newxf->urfid-s->fids);
     8.9 		clunkfid(s, nfid);
    8.10 	}else{
    8.11 		newxf->urfid = nfid;
     9.1--- a/sys/src/cmd/9nfs/nfsmount.c
     9.2+++ b/sys/src/cmd/9nfs/nfsmount.c
     9.3@@ -159,7 +159,7 @@ srvinit(int fd, char *file, char *addr)
     9.4 	xp->name = "/";
     9.5 	xf = xfid("none", xp, 1);
     9.6 	xf->urfid = f;
     9.7-	clog("service=%s uid=%s fid=%ld\n",
     9.8+	clog("service=%s uid=%s fid=%zd\n",
     9.9 		s->service, xf->uid, xf->urfid - s->fids);
    9.10 	if(tail)
    9.11 		tail->next = s;
    10.1--- a/sys/src/cmd/9nfs/string.c
    10.2+++ b/sys/src/cmd/9nfs/string.c
    10.3@@ -57,7 +57,7 @@ strprint(int fd)
    10.4 
    10.5 	for(bin = stab; bin < stab+STRHASH; bin++)
    10.6 		for(x=*bin; x; x=x->next)
    10.7-			fprint(fd, "%ld %s\n", bin-stab, x->str);
    10.8+			fprint(fd, "%zd %s\n", bin-stab, x->str);
    10.9 }
   10.10 
   10.11 static long
    11.1--- a/sys/src/cmd/aux/astarld.c
    11.2+++ b/sys/src/cmd/aux/astarld.c
    11.3@@ -255,7 +255,7 @@ rdcpline(Biobuf *b, Cpline *cpl)
    11.4 
    11.5 	cpl->dlen = cpl->bytes[0];
    11.6 	if(cpl->dlen + 5 != up - cpl->bytes){
    11.7-		fprint(2, "%d %ld\n", cpl->dlen + 5, up - cpl->bytes);
    11.8+		fprint(2, "%d %zd\n", cpl->dlen + 5, up - cpl->bytes);
    11.9 		return "bad data length";
   11.10 	}
   11.11 
    12.1--- a/sys/src/cmd/cfs/inode.c
    12.2+++ b/sys/src/cmd/cfs/inode.c
    12.3@@ -225,7 +225,7 @@ iget(Icache *ic, Qid qid)
    12.4 	/*
    12.5 	 *  init inode and write to disk
    12.6 	 */
    12.7-	DPRINT(2, "new file %llud.%ld ino %ld\n",
    12.8+	DPRINT(2, "new file %llud.%ld ino %zd\n",
    12.9 		qid.path, qid.vers, m - ic->map);
   12.10 	b = ialloc(ic, m - ic->map);
   12.11 	b->inode.inuse = m->inuse = 1;
    13.1--- a/sys/src/cmd/cifs/netbios.c
    13.2+++ b/sys/src/cmd/cifs/netbios.c
    13.3@@ -465,7 +465,7 @@ Raw:
    13.4 	fprint(2, "\n");
    13.5 	for(; p < end; p++){
    13.6 		if((p - (uchar *)buf) % 16 == 0)
    13.7-			fprint(2, "\n%06lx\t", p - (uchar *)buf);
    13.8+			fprint(2, "\n%06zx\t", p - (uchar *)buf);
    13.9 		if(isprint((char)*p))
   13.10 			fprint(2, "%c  ", (char )*p);
   13.11 		else
    14.1--- a/sys/src/cmd/cwfs/juke.c
    14.2+++ b/sys/src/cmd/cwfs/juke.c
    14.3@@ -212,7 +212,7 @@ wormunit(Device *d)			/* d is l0 or r2 (
    14.4 			delay(100);
    14.5 		}
    14.6 		if(chatty)
    14.7-			fprint(2, "\tload   r%ld drive %Z\n", v-w->side, w->drive[drive]);
    14.8+			fprint(2, "\tload   r%zd drive %Z\n", v-w->side, w->drive[drive]);
    14.9 		if(mmove(w, w->mt0, v->elem, w->dt0+drive, v->rot)) {
   14.10 			qunlock(w);
   14.11 			goto sbad;
   14.12@@ -398,7 +398,7 @@ loop:
   14.13 				goto loop;
   14.14 			}
   14.15 			if(chatty)
   14.16-				fprint(2, "\tunload r%ld drive %Z\n",
   14.17+				fprint(2, "\tunload r%zd drive %Z\n",
   14.18 					v-w->side, w->drive[drive]);
   14.19 			if(mmove(w, w->mt0, w->dt0+drive, v->elem, v->rot)) {
   14.20 				qunlock(v);
   14.21@@ -1319,7 +1319,7 @@ wormprobe(void)
   14.22 			if(v->status == Sstart && t > v->time) {
   14.23 				drive = v->drive;
   14.24 				if(chatty)
   14.25-					fprint(2, "\ttime   r%ld drive %Z\n",
   14.26+					fprint(2, "\ttime   r%zd drive %Z\n",
   14.27 						v-w->side, w->drive[drive]);
   14.28 				mmove(w, w->mt0, w->dt0+drive, v->elem, v->rot);
   14.29 				v->status = Sunload;
    15.1--- a/sys/src/cmd/ip/httpd/sendfd.c
    15.2+++ b/sys/src/cmd/ip/httpd/sendfd.c
    15.3@@ -324,7 +324,7 @@ notaccept(HConnect *c, HContent *type, H
    15.4 	hprint(hout, "Server: Plan9\r\n");
    15.5 	hprint(hout, "Date: %D\r\n", time(nil));
    15.6 	hprint(hout, "Content-Type: text/html\r\n");
    15.7-	hprint(hout, "Content-Length: %lud\r\n", s - c->xferbuf);
    15.8+	hprint(hout, "Content-Length: %zud\r\n", s - c->xferbuf);
    15.9 	if(c->head.closeit)
   15.10 		hprint(hout, "Connection: close\r\n");
   15.11 	else if(!http11(c))
    16.1--- a/sys/src/cmd/ip/ppp/mppc.c
    16.2+++ b/sys/src/cmd/ip/ppp/mppc.c
    16.3@@ -851,7 +851,7 @@ netlog("***** unknown protocol\n");
    16.4 			return;
    16.5 		}
    16.6 		p += 2;
    16.7-netlog("off = %ld ", p-s->his);
    16.8+netlog("off = %zd ", p-s->his);
    16.9 		iph = (Iphdr*)p;
   16.10 		len = nhgets(iph->length);
   16.11 		ipcheck(p, len);
    17.1--- a/sys/src/cmd/ip/ppp/ppp.c
    17.2+++ b/sys/src/cmd/ip/ppp/ppp.c
    17.3@@ -473,7 +473,7 @@ getframe(PPP *ppp, int *protop)
    17.4 			if(ppp->ctcp)
    17.5 				compress_error(ppp->ctcp);
    17.6 			ppp->in.discards++;
    17.7-			netlog("ppp: discard len %ld/%ld cksum %ux (%ux %ux %ux %ux)\n",
    17.8+			netlog("ppp: discard len %zd/%zd cksum %ux (%ux %ux %ux %ux)\n",
    17.9 				BLEN(b), BLEN(buf), fcs, b->rptr[0],
   17.10 				b->rptr[1], b->rptr[2], b->rptr[3]);
   17.11 		}
   17.12@@ -506,7 +506,7 @@ putframe(PPP *ppp, int proto, Block *b)
   17.13 		b->rptr += 4;
   17.14 	}
   17.15 
   17.16-	netlog("ppp: putframe 0x%ux %ld\n", proto, b->wptr-b->rptr);
   17.17+	netlog("ppp: putframe 0x%ux %zd\n", proto, BLEN(b));
   17.18 
   17.19 	/* add in the protocol and address, we'd better have left room */
   17.20 	from = b->rptr;
   17.21@@ -2272,7 +2272,7 @@ getpap(PPP *ppp, Block *b)
   17.22 	m = (Lcpmsg*)b->rptr;
   17.23 	len = 4;
   17.24 	if(BLEN(b) < 4 || BLEN(b) < (len = nhgets(m->len))){
   17.25-		syslog(0, LOG, "short pap message (%ld < %d)", BLEN(b), len);
   17.26+		syslog(0, LOG, "short pap message (%zd < %d)", BLEN(b), len);
   17.27 		freeb(b);
   17.28 		return;
   17.29 	}
    18.1--- a/sys/src/cmd/ip/snoopy/hdlc.c
    18.2+++ b/sys/src/cmd/ip/snoopy/hdlc.c
    18.3@@ -155,7 +155,7 @@ p_framer(int fd, uchar *pkt, int pktlen)
    18.4 
    18.5 		/* accept if this is a good packet */
    18.6 		if(fcs != PPP_goodfcs)
    18.7-			print("bad frame %ld %2.2ux %2.2ux!\n", to-pkt, pkt[0], pkt[1]);
    18.8+			print("bad frame %zd %2.2ux %2.2ux!\n", to-pkt, pkt[0], pkt[1]);
    18.9 		else
   18.10 			return to-pkt;
   18.11 	}
    19.1--- a/sys/src/cmd/ip/snoopy/ttls.c
    19.2+++ b/sys/src/cmd/ip/snoopy/ttls.c
    19.3@@ -76,7 +76,7 @@ p_seprint(Msg *m)
    19.4 		m->p = seprint(m->p, m->e, " totallen=%1d", NetL(h->ln));
    19.5 
    19.6 	/* these are not in the header, just print them for our convenience */
    19.7-	m->p = seprint(m->p, m->e, " dataln=%1ld", m->pe - m->ps);
    19.8+	m->p = seprint(m->p, m->e, " dataln=%1zd", m->pe - m->ps);
    19.9 	if ((h->flags & (FlagL|FlagS|FlagM)) == 0 && m->ps == m->pe)
   19.10 		m->p = seprint(m->p, m->e, " ack");
   19.11 
    20.1--- a/sys/src/cmd/jpg/ico.c
    20.2+++ b/sys/src/cmd/jpg/ico.c
    20.3@@ -304,7 +304,7 @@ Bgeticon(Biobuf *b, Icon *icon)
    20.4 		xor += 4*ncolor;
    20.5 	end = xor + icon->h*4*((icon->bits*icon->w+31)/32);
    20.6 	if(end < buf || end > buf+icon->len){
    20.7-		werrstr("bad icon length %lux != %lux", end - buf, icon->len);
    20.8+		werrstr("bad icon length %zux != %lux", end - buf, icon->len);
    20.9 		return -1;
   20.10 	}
   20.11 
    21.1--- a/sys/src/cmd/ndb/convM2DNS.c
    21.2+++ b/sys/src/cmd/ndb/convM2DNS.c
    21.3@@ -486,7 +486,7 @@ retry:
    21.4 		if (type == Tcname && sp->p - data == 2 && len == 0)
    21.5 			return rp;
    21.6 		if (len > sp->p - data){
    21.7-			dnslog("bad %s RR len (%d bytes nominal, %lud actual): %R",
    21.8+			dnslog("bad %s RR len (%d bytes nominal, %zud actual): %R",
    21.9 				rrname(type, ptype, sizeof ptype), len,
   21.10 				sp->p - data, rp);
   21.11 			rrfree(rp);
    22.1--- a/sys/src/cmd/nusb/disk/disk.c
    22.2+++ b/sys/src/cmd/nusb/disk/disk.c
    22.3@@ -156,7 +156,7 @@ ctlstring(Umsc *lun)
    22.4 
    22.5 	fmtstrinit(&fmt);
    22.6 	fmtprint(&fmt, "dev %s\n", dev->dir);
    22.7-	fmtprint(&fmt, "lun %ld\n", lun - &ums->lun[0]);
    22.8+	fmtprint(&fmt, "lun %zd\n", lun - &ums->lun[0]);
    22.9 	if(lun->flags & Finqok)
   22.10 		fmtprint(&fmt, "inquiry %s\n", lun->inq);
   22.11 	if(lun->blocks > 0)
    23.1--- a/sys/src/cmd/plot/plot.c
    23.2+++ b/sys/src/cmd/plot/plot.c
    23.3@@ -564,7 +564,7 @@ process(Biobuf *fd){
    23.4 		case TEXT:	strarg();   text(argstr); pplots=0; break;
    23.5 		case VEC:	numargs(2); vec(x[0], x[1]); break;
    23.6 		default:
    23.7-			sysfatal("%s:%d: plot: missing case %ld\n", fsp->name, fsp->lineno, pplots-plots);
    23.8+			sysfatal("%s:%d: plot: missing case %zd\n", fsp->name, fsp->lineno, pplots-plots);
    23.9 		}
   23.10 	}
   23.11 	return 1;
    24.1--- a/sys/src/cmd/ssh/msg.c
    24.2+++ b/sys/src/cmd/ssh/msg.c
    24.3@@ -102,7 +102,7 @@ allocmsg(Conn *c, int type, int len)
    24.4 void
    24.5 unrecvmsg(Conn *c, Msg *m)
    24.6 {
    24.7-	debug(DBG_PROTO, "unreceived %s len %ld\n", msgnames[m->type], m->ep - m->rp);
    24.8+	debug(DBG_PROTO, "unreceived %s len %zd\n", msgnames[m->type], m->ep - m->rp);
    24.9 	free(c->unget);
   24.10 	c->unget = m;
   24.11 }
   24.12@@ -171,7 +171,7 @@ recvmsg(Conn *c, int type)
   24.13 	Msg *m;
   24.14 
   24.15 	while((m = recvmsg0(c)) != nil){
   24.16-		debug(DBG_PROTO, "received %s len %ld\n", msgnames[m->type], m->ep - m->rp);
   24.17+		debug(DBG_PROTO, "received %s len %zd\n", msgnames[m->type], m->ep - m->rp);
   24.18 		if(m->type != SSH_MSG_DEBUG && m->type != SSH_MSG_IGNORE)
   24.19 			break;
   24.20 		if(m->type == SSH_MSG_DEBUG)
    25.1--- a/sys/src/cmd/tcs/tcs.c
    25.2+++ b/sys/src/cmd/tcs/tcs.c
    25.3@@ -378,7 +378,7 @@ intable(int fd, long *table, struct conv
    25.4 			c = table[*p];
    25.5 			if(c < 0){
    25.6 				if(squawk)
    25.7-					EPR "%s: bad char 0x%x near byte %ld in %s\n", argv0, *p, ninput+(p-e), file);
    25.8+					EPR "%s: bad char 0x%x near byte %zd in %s\n", argv0, *p, ninput+(p-e), file);
    25.9 				nerrors++;
   25.10 				if(clean)
   25.11 					continue;
    26.1--- a/sys/src/cmd/telco/telco.c
    26.2+++ b/sys/src/cmd/telco/telco.c
    26.3@@ -1418,7 +1418,7 @@ receiver(Dev *d)
    26.4 		close(fd);
    26.5 
    26.6 		/* open connection through the file system interface */
    26.7-		sprint(file, "/net/telco/%ld/data", d - dev);
    26.8+		sprint(file, "/net/telco/%zd/data", d - dev);
    26.9 		fd = open(file, ORDWR);
   26.10 		if(fd < 0){
   26.11 			syslog(0, LOGFILE, "can't open %s: %r", file);
    27.1--- a/sys/src/cmd/upas/bayes/dfa.c
    27.2+++ b/sys/src/cmd/upas/bayes/dfa.c
    27.3@@ -688,13 +688,13 @@ Bprintdfa(Biobuf *b, Dreprog *p)
    27.4 	nc = 0;
    27.5 	for(i=0; i<p->ninst; i++)
    27.6 		nc += p->inst[i].nc;
    27.7-	Bprint(b, "%d %d %ld %ld %ld %ld\n", p->ninst, nc,
    27.8+	Bprint(b, "%d %d %zd %zd %zd %zd\n", p->ninst, nc,
    27.9 		p->start[0]-p->inst, p->start[1]-p->inst,
   27.10 		p->start[2]-p->inst, p->start[3]-p->inst);
   27.11 	for(i=0; i<p->ninst; i++){
   27.12 		Bprint(b, "%d %d %d", p->inst[i].isfinal, p->inst[i].isloop, p->inst[i].nc);
   27.13 		for(j=0; j<p->inst[i].nc; j++)
   27.14-			Bprint(b, " %d %ld", p->inst[i].c[j].start, p->inst[i].c[j].next-p->inst);
   27.15+			Bprint(b, " %d %zd", p->inst[i].c[j].start, p->inst[i].c[j].next-p->inst);
   27.16 		Bprint(b, "\n");
   27.17 	}
   27.18 }
    28.1--- a/sys/src/cmd/upas/bayes/msgtok.c
    28.2+++ b/sys/src/cmd/upas/bayes/msgtok.c
    28.3@@ -117,7 +117,7 @@ main(int argc, char **argv)
    28.4 			n = m[2];
    28.5 		if(n <= 0){
    28.6 fprint(2, "«%s» %.2ux", p, p[0]);
    28.7-			sysfatal("no regexps matched at %ld", off + (p-msg));
    28.8+			sysfatal("no regexps matched at %zd", off + (p-msg));
    28.9 		}
   28.10 
   28.11 		if(m[0] >= m[1] && m[0] >= m[2]){
    29.1--- a/sys/src/cmd/upas/fs/mbox.c
    29.2+++ b/sys/src/cmd/upas/fs/mbox.c
    29.3@@ -1382,7 +1382,7 @@ mailplumb(Mailbox *mb, Message *m, int d
    29.4 	else
    29.5 		date = "";
    29.6 
    29.7-	sprint(lenstr, "%ld", m->end-m->start);
    29.8+	sprint(lenstr, "%zd", m->end-m->start);
    29.9 
   29.10 	if(biffing && !delete)
   29.11 		print("[ %s / %s / %s ]\n", from, subject, lenstr);
    30.1--- a/sys/src/cmd/venti/srv/buildindex.c
    30.2+++ b/sys/src/cmd/venti/srv/buildindex.c
    30.3@@ -736,7 +736,7 @@ sortminibuffer(ISect *is, Minibuf *mb, u
    30.4 		zerorange(part, bucket2offset(is, lastb+1), bucket2offset(is, is->stop - is->start));
    30.5 
    30.6 	if(n != mb->nwentry)
    30.7-		fprint(2, "sortminibuffer bug: n=%ud nwentry=%ud have=%ld\n", n, mb->nwentry, (ep-buf)/IEntrySize);
    30.8+		fprint(2, "sortminibuffer bug: n=%ud nwentry=%ud have=%zd\n", n, mb->nwentry, (ep-buf)/IEntrySize);
    30.9 
   30.10 	free(buckdata);
   30.11 }
    31.1--- a/sys/src/cmd/venti/srv/fixarenas.c
    31.2+++ b/sys/src/cmd/venti/srv/fixarenas.c
    31.3@@ -1628,7 +1628,7 @@ Again:
    31.4 	}
    31.5 	if(ci >= eci || cit < ecit){
    31.6 		print("ran out of space editing existing directory; rewriting\n");
    31.7-		print("# eci %ld ci %ld ecit %ld cit %ld\n", eci-bci, ci-bci, ecit-bcit, cit-bcit);
    31.8+		print("# eci %zd ci %zd ecit %zd cit %zd\n", eci-bci, ci-bci, ecit-bcit, cit-bcit);
    31.9 		assert(smart);	/* can't happen second time thru */
   31.10 		smart = 0;
   31.11 		goto Again;
    32.1--- a/sys/src/cmd/venti/srv/unwhack.c
    32.2+++ b/sys/src/cmd/venti/srv/unwhack.c
    32.3@@ -156,7 +156,8 @@ unwhack(Unwhack *uw, uchar *dst, int nds
    32.4 		off++;
    32.5 
    32.6 		if(off > d - dst){
    32.7-			snprint(uw->err, WhackErrLen, "offset out of range: off=%d d=%ld len=%d nbits=%d", off, d - dst, len, uwnbits);
    32.8+			snprint(uw->err, WhackErrLen, "offset out of range: off=%d d=%zd len=%d nbits=%d",
    32.9+				off, d - dst, len, uwnbits);
   32.10 			return -1;
   32.11 		}
   32.12 		if(d + len > dmax){
    33.1--- a/sys/src/cmd/webfs/fs.c
    33.2+++ b/sys/src/cmd/webfs/fs.c
    33.3@@ -84,7 +84,7 @@ static char *agent;
    33.4 static Client client[64];
    33.5 static int nclient;
    33.6 
    33.7-#define	CLIENTID(c)	(((Client*)(c)) - client)
    33.8+#define	CLIENTID(c)	((int)(((Client*)(c)) - client))
    33.9 
   33.10 Client*
   33.11 newclient(void)
   33.12@@ -222,7 +222,7 @@ fsmkdir(Dir *d, int level, void *aux)
   33.13 		d->length = strlen(((Key*)aux)->val);
   33.14 		break;
   33.15 	case Qclient:
   33.16-		snprint(buf, sizeof(buf), "%ld", CLIENTID(aux));
   33.17+		snprint(buf, sizeof(buf), "%d", CLIENTID(aux));
   33.18 		d->name = estrdup(buf);
   33.19 		break;
   33.20 	case Qctl:
   33.21@@ -530,7 +530,7 @@ fsread(Req *r)
   33.22 		respond(r, nil);
   33.23 		return;
   33.24 	case Qctl:
   33.25-		snprint(buf, sizeof(buf), "%ld\n", CLIENTID(f->client));
   33.26+		snprint(buf, sizeof(buf), "%d\n", CLIENTID(f->client));
   33.27 		goto String;
   33.28 	case Qheader:
   33.29 		snprint(buf, sizeof(buf), "%s", f->key->val);
    34.1--- a/sys/src/libaml/aml.c
    34.2+++ b/sys/src/libaml/aml.c
    34.3@@ -833,9 +833,9 @@ Vfmt(Fmt *f)
    34.4 		r = p;
    34.5 		e = r->ref;
    34.6 		if(c == 'A')
    34.7-			return fmtprint(f, "Arg%ld=%V", r->ptr - e->arg, *r->ptr);
    34.8+			return fmtprint(f, "Arg%zd=%V", r->ptr - e->arg, *r->ptr);
    34.9 		if(c == 'L')
   34.10-			return fmtprint(f, "Local%ld=%V", r->ptr - e->loc, *r->ptr);
   34.11+			return fmtprint(f, "Local%zd=%V", r->ptr - e->loc, *r->ptr);
   34.12 	case 'n':
   34.13 		return fmtprint(f, "%s", (char*)p);
   34.14 	case 's':
   34.15@@ -901,7 +901,7 @@ dumpregs(void)
   34.16 	print("\n*** dumpregs: PC=%p FP=%p\n", PC, FP);
   34.17 	e = nil;
   34.18 	for(f = FP; f >= FB; f--){
   34.19-		print("%.8p.%.2lx: %-8s %N\t", f->start, f-FB, f->phase, f->dot);
   34.20+		print("%.8p.%.2zx: %-8s %N\t", f->start, f-FB, f->phase, f->dot);
   34.21 		if(f->op)
   34.22 			print("%s", f->op->name);
   34.23 		print("(");
   34.24@@ -950,7 +950,7 @@ xec(uchar *pc, uchar *end, Name *dot, En
   34.25 		if((++loop & 127) == 0)
   34.26 			gc();
   34.27 		if(amldebug)
   34.28-			print("\n%.8p.%.2lx %-8s\t%N\t", PC, FP - FB, FP->phase, FP->dot);
   34.29+			print("\n%.8p.%.2zx %-8s\t%N\t", PC, FP - FB, FP->phase, FP->dot);
   34.30 		r = nil;
   34.31 		c = *FP->phase++;
   34.32 		switch(c){
    35.1--- a/sys/src/libflate/deflate.c
    35.2+++ b/sys/src/libflate/deflate.c
    35.3@@ -478,7 +478,7 @@ deflateb(LZstate *lz, LZblock *lzb, void
    35.4 	lzput(lz, lz->eof && !lz->avail, 1);
    35.5 
    35.6 	if(lz->debug){
    35.7-		fprint(2, "block: bytes=%lud entries=%ld extra bits=%d\n\tuncompressed=%lud fixed=%lud dynamic=%lud huffman=%lud\n",
    35.8+		fprint(2, "block: bytes=%lud entries=%zd extra bits=%d\n\tuncompressed=%lud fixed=%lud dynamic=%lud huffman=%lud\n",
    35.9 			nunc, lzb->eparse - lzb->parse, lzb->excost, (nunc + 4) * 8, nfix, ndyn, nhuff);
   35.10 		fprint(2, "\tnlit=%lud matches=%lud eof=%d\n", nlits, nmatches, lz->eof && !lz->avail);
   35.11 	}