diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-01-07 04:44:13 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-01-07 04:44:13 +0100 |
commit | 772afbe98c7e74be35e7e5318967ce594e4d93e8 (patch) | |
tree | 006ef64214c4ab980ff3125ea812f42235706b5b | |
parent | 9c99d0c8d3236b87bd292ac29d4d1b2d5f550bd5 (diff) |
format pointer subtraction results with %zd instead of %ld (for long -> intptr on amd64)
35 files changed, 50 insertions, 49 deletions
diff --git a/sys/src/9/ip/esp.c b/sys/src/9/ip/esp.c index 19a6554f3..9023e08a5 100644 --- a/sys/src/9/ip/esp.c +++ b/sys/src/9/ip/esp.c @@ -511,7 +511,7 @@ print("esp: bad auth %I -> %I!%ld\n", vers.raddr, vers.laddr, vers.spi); payload = BLEN(bp) - vers.hdrlen - ecb->ahlen; if(payload <= 0 || payload % 4 != 0 || payload % ecb->espblklen != 0) { qunlock(c); - netlog(f, Logesp, "esp: bad length %I -> %I!%lud payload=%d BLEN=%lud\n", + netlog(f, Logesp, "esp: bad length %I -> %I!%lud payload=%d BLEN=%zd\n", vers.raddr, vers.laddr, vers.spi, payload, BLEN(bp)); freeb(bp); return; diff --git a/sys/src/9/pc/archmp.c b/sys/src/9/pc/archmp.c index 6e7aa3de9..18e19e120 100644 --- a/sys/src/9/pc/archmp.c +++ b/sys/src/9/pc/archmp.c @@ -310,7 +310,7 @@ pcmpinit(void) */ while(p < e) switch(*p){ default: - print("pcmpinit: unknown PCMP type 0x%uX (e-p 0x%luX)\n", + print("pcmpinit: unknown PCMP type 0x%uX (e-p 0x%zuX)\n", *p, e-p); while(p < e){ print("%uX ", *p); diff --git a/sys/src/9/pc/etherrt2860.c b/sys/src/9/pc/etherrt2860.c index 6544a80a7..7d71d612f 100644 --- a/sys/src/9/pc/etherrt2860.c +++ b/sys/src/9/pc/etherrt2860.c @@ -2658,7 +2658,7 @@ transmit(Wifi *wifi, Wnode *wn, Block *b) p = pool->p + pool->i * TxwiDmaSz; w = (Wifipkt*)(p + Txwisize); if(ctlr->wifi->debug){ - 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)); + 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)); } tx->i = (tx->i + 1) % Ntx; diff --git a/sys/src/9/port/devaoe.c b/sys/src/9/port/devaoe.c index 68d66c25d..5c01c922d 100644 --- a/sys/src/9/port/devaoe.c +++ b/sys/src/9/port/devaoe.c @@ -2141,7 +2141,7 @@ atarsp(Block *b) case Crd: case Crdext: if(BLEN(b) - (Aoehsz + Aoeatasz) != n){ - eventlog("%æ: misread blen %ld expect %d\n", + eventlog("%æ: misread blen %zd expect %d\n", d, BLEN(b), n); goto bail; } @@ -2159,7 +2159,7 @@ atarsp(Block *b) break; case Cid: if(BLEN(b) - (Aoehsz + Aoeatasz) < 512){ - eventlog("%æ: runt identify blen %ld expect %d\n", + eventlog("%æ: runt identify blen %zd expect %d\n", d, BLEN(b), 512 + Aoehsz + Aoeatasz); goto bail; } diff --git a/sys/src/9/port/devtls.c b/sys/src/9/port/devtls.c index 7511a7654..2b5cc9304 100644 --- a/sys/src/9/port/devtls.c +++ b/sys/src/9/port/devtls.c @@ -1115,7 +1115,7 @@ tlsbread(Chan *c, long n, ulong offset) /* return at most what was asked for */ b = qgrab(&tr->processed, n); -if(tr->debug) pprint("consumed processed %ld\n", BLEN(b)); +if(tr->debug) pprint("consumed processed %zd\n", BLEN(b)); if(tr->debug) pdump(BLEN(b), b->rp, "consumed:"); qunlock(&tr->in.io); poperror(); @@ -1272,7 +1272,7 @@ tlsrecwrite(TlsRec *tr, int type, Block *b) nexterror(); } qlock(&out->io); -if(tr->debug)pprint("send %ld\n", BLEN(b)); +if(tr->debug)pprint("send %zd\n", BLEN(b)); if(tr->debug)pdump(BLEN(b), b->rp, "sent:"); diff --git a/sys/src/9/port/proc.c b/sys/src/9/port/proc.c index eadca93ec..412a8eef9 100644 --- a/sys/src/9/port/proc.c +++ b/sys/src/9/port/proc.c @@ -1362,7 +1362,7 @@ scheddump(void) for(rq = &runq[Nrq-1]; rq >= runq; rq--){ if(rq->head == nil) continue; - print("rq%ld:", rq-runq); + print("rq%zd:", rq-runq); for(p = rq->head; p != nil; p = p->rnext) print(" %lud(%lud)", p->pid, m->ticks - p->readytime); print("\n"); diff --git a/sys/src/cmd/9nfs/9p.c b/sys/src/cmd/9nfs/9p.c index 55575c384..74919f2e8 100644 --- a/sys/src/cmd/9nfs/9p.c +++ b/sys/src/cmd/9nfs/9p.c @@ -130,7 +130,7 @@ newfid(Session *s) *(f->owner) = 0; f->owner = 0; } - chat("%ld...", f - s->fids); + chat("%zd...", f - s->fids); f->tstale = nfstime + staletime; return f; } @@ -153,7 +153,7 @@ setfid(Session *s, Fid *f) void putfid(Session *s, Fid *f) { - chat("putfid %ld...", f-s->fids); + chat("putfid %zd...", f-s->fids); if(s == 0 || f == 0){ clog("putfid(0x%p, 0x%p) %s", s, f, (s ? s->service : "?")); return; diff --git a/sys/src/cmd/9nfs/nfs.c b/sys/src/cmd/9nfs/nfs.c index c01536742..a11a6e3cb 100644 --- a/sys/src/cmd/9nfs/nfs.c +++ b/sys/src/cmd/9nfs/nfs.c @@ -330,7 +330,7 @@ xfwalkcr(int type, Xfid *xf, String *elem, long perm) newxf->urfid = nfid; nfid->owner = &newxf->urfid; }else if(newxf->urfid){ - chat("old xfid %ld...", newxf->urfid-s->fids); + chat("old xfid %zd...", newxf->urfid-s->fids); clunkfid(s, nfid); }else{ newxf->urfid = nfid; diff --git a/sys/src/cmd/9nfs/nfsmount.c b/sys/src/cmd/9nfs/nfsmount.c index 583669273..6f0e67b39 100644 --- a/sys/src/cmd/9nfs/nfsmount.c +++ b/sys/src/cmd/9nfs/nfsmount.c @@ -159,7 +159,7 @@ srvinit(int fd, char *file, char *addr) xp->name = "/"; xf = xfid("none", xp, 1); xf->urfid = f; - clog("service=%s uid=%s fid=%ld\n", + clog("service=%s uid=%s fid=%zd\n", s->service, xf->uid, xf->urfid - s->fids); if(tail) tail->next = s; diff --git a/sys/src/cmd/9nfs/string.c b/sys/src/cmd/9nfs/string.c index e71bb2e20..156d4310a 100644 --- a/sys/src/cmd/9nfs/string.c +++ b/sys/src/cmd/9nfs/string.c @@ -57,7 +57,7 @@ strprint(int fd) for(bin = stab; bin < stab+STRHASH; bin++) for(x=*bin; x; x=x->next) - fprint(fd, "%ld %s\n", bin-stab, x->str); + fprint(fd, "%zd %s\n", bin-stab, x->str); } static long diff --git a/sys/src/cmd/aux/astarld.c b/sys/src/cmd/aux/astarld.c index b1b45ad67..c6f477303 100644 --- a/sys/src/cmd/aux/astarld.c +++ b/sys/src/cmd/aux/astarld.c @@ -255,7 +255,7 @@ rdcpline(Biobuf *b, Cpline *cpl) cpl->dlen = cpl->bytes[0]; if(cpl->dlen + 5 != up - cpl->bytes){ - fprint(2, "%d %ld\n", cpl->dlen + 5, up - cpl->bytes); + fprint(2, "%d %zd\n", cpl->dlen + 5, up - cpl->bytes); return "bad data length"; } diff --git a/sys/src/cmd/cfs/inode.c b/sys/src/cmd/cfs/inode.c index 8b72a2742..cb551160f 100644 --- a/sys/src/cmd/cfs/inode.c +++ b/sys/src/cmd/cfs/inode.c @@ -225,7 +225,7 @@ iget(Icache *ic, Qid qid) /* * init inode and write to disk */ - DPRINT(2, "new file %llud.%ld ino %ld\n", + DPRINT(2, "new file %llud.%ld ino %zd\n", qid.path, qid.vers, m - ic->map); b = ialloc(ic, m - ic->map); b->inode.inuse = m->inuse = 1; diff --git a/sys/src/cmd/cifs/netbios.c b/sys/src/cmd/cifs/netbios.c index 708dd41a1..99dd3e32c 100644 --- a/sys/src/cmd/cifs/netbios.c +++ b/sys/src/cmd/cifs/netbios.c @@ -465,7 +465,7 @@ Raw: fprint(2, "\n"); for(; p < end; p++){ if((p - (uchar *)buf) % 16 == 0) - fprint(2, "\n%06lx\t", p - (uchar *)buf); + fprint(2, "\n%06zx\t", p - (uchar *)buf); if(isprint((char)*p)) fprint(2, "%c ", (char )*p); else diff --git a/sys/src/cmd/cwfs/juke.c b/sys/src/cmd/cwfs/juke.c index 5deabd8a2..834a83891 100644 --- a/sys/src/cmd/cwfs/juke.c +++ b/sys/src/cmd/cwfs/juke.c @@ -212,7 +212,7 @@ wormunit(Device *d) /* d is l0 or r2 (e.g.) */ delay(100); } if(chatty) - fprint(2, "\tload r%ld drive %Z\n", v-w->side, w->drive[drive]); + fprint(2, "\tload r%zd drive %Z\n", v-w->side, w->drive[drive]); if(mmove(w, w->mt0, v->elem, w->dt0+drive, v->rot)) { qunlock(w); goto sbad; @@ -398,7 +398,7 @@ loop: goto loop; } if(chatty) - fprint(2, "\tunload r%ld drive %Z\n", + fprint(2, "\tunload r%zd drive %Z\n", v-w->side, w->drive[drive]); if(mmove(w, w->mt0, w->dt0+drive, v->elem, v->rot)) { qunlock(v); @@ -1319,7 +1319,7 @@ wormprobe(void) if(v->status == Sstart && t > v->time) { drive = v->drive; if(chatty) - fprint(2, "\ttime r%ld drive %Z\n", + fprint(2, "\ttime r%zd drive %Z\n", v-w->side, w->drive[drive]); mmove(w, w->mt0, w->dt0+drive, v->elem, v->rot); v->status = Sunload; diff --git a/sys/src/cmd/ip/httpd/sendfd.c b/sys/src/cmd/ip/httpd/sendfd.c index b3ef1c13b..f0ddc4c39 100644 --- a/sys/src/cmd/ip/httpd/sendfd.c +++ b/sys/src/cmd/ip/httpd/sendfd.c @@ -324,7 +324,7 @@ notaccept(HConnect *c, HContent *type, HContent *enc, char *which) hprint(hout, "Server: Plan9\r\n"); hprint(hout, "Date: %D\r\n", time(nil)); hprint(hout, "Content-Type: text/html\r\n"); - hprint(hout, "Content-Length: %lud\r\n", s - c->xferbuf); + hprint(hout, "Content-Length: %zud\r\n", s - c->xferbuf); if(c->head.closeit) hprint(hout, "Connection: close\r\n"); else if(!http11(c)) diff --git a/sys/src/cmd/ip/ppp/mppc.c b/sys/src/cmd/ip/ppp/mppc.c index aaf6fc7f3..52560f996 100644 --- a/sys/src/cmd/ip/ppp/mppc.c +++ b/sys/src/cmd/ip/ppp/mppc.c @@ -851,7 +851,7 @@ netlog("***** unknown protocol\n"); return; } p += 2; -netlog("off = %ld ", p-s->his); +netlog("off = %zd ", p-s->his); iph = (Iphdr*)p; len = nhgets(iph->length); ipcheck(p, len); diff --git a/sys/src/cmd/ip/ppp/ppp.c b/sys/src/cmd/ip/ppp/ppp.c index 125893990..4f9ce3cf8 100644 --- a/sys/src/cmd/ip/ppp/ppp.c +++ b/sys/src/cmd/ip/ppp/ppp.c @@ -473,7 +473,7 @@ getframe(PPP *ppp, int *protop) if(ppp->ctcp) compress_error(ppp->ctcp); ppp->in.discards++; - netlog("ppp: discard len %ld/%ld cksum %ux (%ux %ux %ux %ux)\n", + netlog("ppp: discard len %zd/%zd cksum %ux (%ux %ux %ux %ux)\n", BLEN(b), BLEN(buf), fcs, b->rptr[0], b->rptr[1], b->rptr[2], b->rptr[3]); } @@ -506,7 +506,7 @@ putframe(PPP *ppp, int proto, Block *b) b->rptr += 4; } - netlog("ppp: putframe 0x%ux %ld\n", proto, b->wptr-b->rptr); + netlog("ppp: putframe 0x%ux %zd\n", proto, BLEN(b)); /* add in the protocol and address, we'd better have left room */ from = b->rptr; @@ -2272,7 +2272,7 @@ getpap(PPP *ppp, Block *b) m = (Lcpmsg*)b->rptr; len = 4; if(BLEN(b) < 4 || BLEN(b) < (len = nhgets(m->len))){ - syslog(0, LOG, "short pap message (%ld < %d)", BLEN(b), len); + syslog(0, LOG, "short pap message (%zd < %d)", BLEN(b), len); freeb(b); return; } diff --git a/sys/src/cmd/ip/snoopy/hdlc.c b/sys/src/cmd/ip/snoopy/hdlc.c index fdf2aaac8..1b691d96d 100644 --- a/sys/src/cmd/ip/snoopy/hdlc.c +++ b/sys/src/cmd/ip/snoopy/hdlc.c @@ -155,7 +155,7 @@ p_framer(int fd, uchar *pkt, int pktlen) /* accept if this is a good packet */ if(fcs != PPP_goodfcs) - print("bad frame %ld %2.2ux %2.2ux!\n", to-pkt, pkt[0], pkt[1]); + print("bad frame %zd %2.2ux %2.2ux!\n", to-pkt, pkt[0], pkt[1]); else return to-pkt; } diff --git a/sys/src/cmd/ip/snoopy/ttls.c b/sys/src/cmd/ip/snoopy/ttls.c index d5ee1eb72..3441fca7b 100644 --- a/sys/src/cmd/ip/snoopy/ttls.c +++ b/sys/src/cmd/ip/snoopy/ttls.c @@ -76,7 +76,7 @@ p_seprint(Msg *m) m->p = seprint(m->p, m->e, " totallen=%1d", NetL(h->ln)); /* these are not in the header, just print them for our convenience */ - m->p = seprint(m->p, m->e, " dataln=%1ld", m->pe - m->ps); + m->p = seprint(m->p, m->e, " dataln=%1zd", m->pe - m->ps); if ((h->flags & (FlagL|FlagS|FlagM)) == 0 && m->ps == m->pe) m->p = seprint(m->p, m->e, " ack"); diff --git a/sys/src/cmd/jpg/ico.c b/sys/src/cmd/jpg/ico.c index 0f2411961..ea7ba9a7e 100644 --- a/sys/src/cmd/jpg/ico.c +++ b/sys/src/cmd/jpg/ico.c @@ -304,7 +304,7 @@ Bgeticon(Biobuf *b, Icon *icon) xor += 4*ncolor; end = xor + icon->h*4*((icon->bits*icon->w+31)/32); if(end < buf || end > buf+icon->len){ - werrstr("bad icon length %lux != %lux", end - buf, icon->len); + werrstr("bad icon length %zux != %lux", end - buf, icon->len); return -1; } diff --git a/sys/src/cmd/ndb/convM2DNS.c b/sys/src/cmd/ndb/convM2DNS.c index d920462ce..8d35bbddb 100644 --- a/sys/src/cmd/ndb/convM2DNS.c +++ b/sys/src/cmd/ndb/convM2DNS.c @@ -486,7 +486,7 @@ retry: if (type == Tcname && sp->p - data == 2 && len == 0) return rp; if (len > sp->p - data){ - dnslog("bad %s RR len (%d bytes nominal, %lud actual): %R", + dnslog("bad %s RR len (%d bytes nominal, %zud actual): %R", rrname(type, ptype, sizeof ptype), len, sp->p - data, rp); rrfree(rp); diff --git a/sys/src/cmd/nusb/disk/disk.c b/sys/src/cmd/nusb/disk/disk.c index 94306d117..dd7085a66 100644 --- a/sys/src/cmd/nusb/disk/disk.c +++ b/sys/src/cmd/nusb/disk/disk.c @@ -156,7 +156,7 @@ ctlstring(Umsc *lun) fmtstrinit(&fmt); fmtprint(&fmt, "dev %s\n", dev->dir); - fmtprint(&fmt, "lun %ld\n", lun - &ums->lun[0]); + fmtprint(&fmt, "lun %zd\n", lun - &ums->lun[0]); if(lun->flags & Finqok) fmtprint(&fmt, "inquiry %s\n", lun->inq); if(lun->blocks > 0) diff --git a/sys/src/cmd/plot/plot.c b/sys/src/cmd/plot/plot.c index a7341c4e4..591efe96b 100644 --- a/sys/src/cmd/plot/plot.c +++ b/sys/src/cmd/plot/plot.c @@ -564,7 +564,7 @@ process(Biobuf *fd){ case TEXT: strarg(); text(argstr); pplots=0; break; case VEC: numargs(2); vec(x[0], x[1]); break; default: - sysfatal("%s:%d: plot: missing case %ld\n", fsp->name, fsp->lineno, pplots-plots); + sysfatal("%s:%d: plot: missing case %zd\n", fsp->name, fsp->lineno, pplots-plots); } } return 1; diff --git a/sys/src/cmd/ssh/msg.c b/sys/src/cmd/ssh/msg.c index bdbc63cf5..d74facb44 100644 --- a/sys/src/cmd/ssh/msg.c +++ b/sys/src/cmd/ssh/msg.c @@ -102,7 +102,7 @@ allocmsg(Conn *c, int type, int len) void unrecvmsg(Conn *c, Msg *m) { - debug(DBG_PROTO, "unreceived %s len %ld\n", msgnames[m->type], m->ep - m->rp); + debug(DBG_PROTO, "unreceived %s len %zd\n", msgnames[m->type], m->ep - m->rp); free(c->unget); c->unget = m; } @@ -171,7 +171,7 @@ recvmsg(Conn *c, int type) Msg *m; while((m = recvmsg0(c)) != nil){ - debug(DBG_PROTO, "received %s len %ld\n", msgnames[m->type], m->ep - m->rp); + debug(DBG_PROTO, "received %s len %zd\n", msgnames[m->type], m->ep - m->rp); if(m->type != SSH_MSG_DEBUG && m->type != SSH_MSG_IGNORE) break; if(m->type == SSH_MSG_DEBUG) diff --git a/sys/src/cmd/tcs/tcs.c b/sys/src/cmd/tcs/tcs.c index 7732a03b5..3049dfa24 100644 --- a/sys/src/cmd/tcs/tcs.c +++ b/sys/src/cmd/tcs/tcs.c @@ -378,7 +378,7 @@ intable(int fd, long *table, struct convert *out) c = table[*p]; if(c < 0){ if(squawk) - EPR "%s: bad char 0x%x near byte %ld in %s\n", argv0, *p, ninput+(p-e), file); + EPR "%s: bad char 0x%x near byte %zd in %s\n", argv0, *p, ninput+(p-e), file); nerrors++; if(clean) continue; diff --git a/sys/src/cmd/telco/telco.c b/sys/src/cmd/telco/telco.c index d82d67e5c..87fb1ef96 100644 --- a/sys/src/cmd/telco/telco.c +++ b/sys/src/cmd/telco/telco.c @@ -1418,7 +1418,7 @@ receiver(Dev *d) close(fd); /* open connection through the file system interface */ - sprint(file, "/net/telco/%ld/data", d - dev); + sprint(file, "/net/telco/%zd/data", d - dev); fd = open(file, ORDWR); if(fd < 0){ syslog(0, LOGFILE, "can't open %s: %r", file); diff --git a/sys/src/cmd/upas/bayes/dfa.c b/sys/src/cmd/upas/bayes/dfa.c index 46695efd8..533d5958a 100644 --- a/sys/src/cmd/upas/bayes/dfa.c +++ b/sys/src/cmd/upas/bayes/dfa.c @@ -688,13 +688,13 @@ Bprintdfa(Biobuf *b, Dreprog *p) nc = 0; for(i=0; i<p->ninst; i++) nc += p->inst[i].nc; - Bprint(b, "%d %d %ld %ld %ld %ld\n", p->ninst, nc, + Bprint(b, "%d %d %zd %zd %zd %zd\n", p->ninst, nc, p->start[0]-p->inst, p->start[1]-p->inst, p->start[2]-p->inst, p->start[3]-p->inst); for(i=0; i<p->ninst; i++){ Bprint(b, "%d %d %d", p->inst[i].isfinal, p->inst[i].isloop, p->inst[i].nc); for(j=0; j<p->inst[i].nc; j++) - Bprint(b, " %d %ld", p->inst[i].c[j].start, p->inst[i].c[j].next-p->inst); + Bprint(b, " %d %zd", p->inst[i].c[j].start, p->inst[i].c[j].next-p->inst); Bprint(b, "\n"); } } diff --git a/sys/src/cmd/upas/bayes/msgtok.c b/sys/src/cmd/upas/bayes/msgtok.c index 7c4505469..cbba30dc8 100644 --- a/sys/src/cmd/upas/bayes/msgtok.c +++ b/sys/src/cmd/upas/bayes/msgtok.c @@ -117,7 +117,7 @@ main(int argc, char **argv) n = m[2]; if(n <= 0){ fprint(2, "«%s» %.2ux", p, p[0]); - sysfatal("no regexps matched at %ld", off + (p-msg)); + sysfatal("no regexps matched at %zd", off + (p-msg)); } if(m[0] >= m[1] && m[0] >= m[2]){ diff --git a/sys/src/cmd/upas/fs/mbox.c b/sys/src/cmd/upas/fs/mbox.c index 21f786f0c..3cd14e6cd 100644 --- a/sys/src/cmd/upas/fs/mbox.c +++ b/sys/src/cmd/upas/fs/mbox.c @@ -1382,7 +1382,7 @@ mailplumb(Mailbox *mb, Message *m, int delete) else date = ""; - sprint(lenstr, "%ld", m->end-m->start); + sprint(lenstr, "%zd", m->end-m->start); if(biffing && !delete) print("[ %s / %s / %s ]\n", from, subject, lenstr); diff --git a/sys/src/cmd/venti/srv/buildindex.c b/sys/src/cmd/venti/srv/buildindex.c index 2f24055c9..97ec3855b 100644 --- a/sys/src/cmd/venti/srv/buildindex.c +++ b/sys/src/cmd/venti/srv/buildindex.c @@ -736,7 +736,7 @@ sortminibuffer(ISect *is, Minibuf *mb, uchar *buf, u32int nbuf, u32int bufsize) zerorange(part, bucket2offset(is, lastb+1), bucket2offset(is, is->stop - is->start)); if(n != mb->nwentry) - fprint(2, "sortminibuffer bug: n=%ud nwentry=%ud have=%ld\n", n, mb->nwentry, (ep-buf)/IEntrySize); + fprint(2, "sortminibuffer bug: n=%ud nwentry=%ud have=%zd\n", n, mb->nwentry, (ep-buf)/IEntrySize); free(buckdata); } diff --git a/sys/src/cmd/venti/srv/fixarenas.c b/sys/src/cmd/venti/srv/fixarenas.c index d492b4b87..15d904708 100644 --- a/sys/src/cmd/venti/srv/fixarenas.c +++ b/sys/src/cmd/venti/srv/fixarenas.c @@ -1628,7 +1628,7 @@ Again: } if(ci >= eci || cit < ecit){ print("ran out of space editing existing directory; rewriting\n"); - print("# eci %ld ci %ld ecit %ld cit %ld\n", eci-bci, ci-bci, ecit-bcit, cit-bcit); + print("# eci %zd ci %zd ecit %zd cit %zd\n", eci-bci, ci-bci, ecit-bcit, cit-bcit); assert(smart); /* can't happen second time thru */ smart = 0; goto Again; diff --git a/sys/src/cmd/venti/srv/unwhack.c b/sys/src/cmd/venti/srv/unwhack.c index 5530bd07d..a2c36f791 100644 --- a/sys/src/cmd/venti/srv/unwhack.c +++ b/sys/src/cmd/venti/srv/unwhack.c @@ -156,7 +156,8 @@ unwhack(Unwhack *uw, uchar *dst, int ndst, uchar *src, int nsrc) off++; if(off > d - dst){ - snprint(uw->err, WhackErrLen, "offset out of range: off=%d d=%ld len=%d nbits=%d", off, d - dst, len, uwnbits); + snprint(uw->err, WhackErrLen, "offset out of range: off=%d d=%zd len=%d nbits=%d", + off, d - dst, len, uwnbits); return -1; } if(d + len > dmax){ diff --git a/sys/src/cmd/webfs/fs.c b/sys/src/cmd/webfs/fs.c index 981884417..7f2eb70fd 100644 --- a/sys/src/cmd/webfs/fs.c +++ b/sys/src/cmd/webfs/fs.c @@ -84,7 +84,7 @@ static char *agent; static Client client[64]; static int nclient; -#define CLIENTID(c) (((Client*)(c)) - client) +#define CLIENTID(c) ((int)(((Client*)(c)) - client)) Client* newclient(void) @@ -222,7 +222,7 @@ fsmkdir(Dir *d, int level, void *aux) d->length = strlen(((Key*)aux)->val); break; case Qclient: - snprint(buf, sizeof(buf), "%ld", CLIENTID(aux)); + snprint(buf, sizeof(buf), "%d", CLIENTID(aux)); d->name = estrdup(buf); break; case Qctl: @@ -530,7 +530,7 @@ fsread(Req *r) respond(r, nil); return; case Qctl: - snprint(buf, sizeof(buf), "%ld\n", CLIENTID(f->client)); + snprint(buf, sizeof(buf), "%d\n", CLIENTID(f->client)); goto String; case Qheader: snprint(buf, sizeof(buf), "%s", f->key->val); diff --git a/sys/src/libaml/aml.c b/sys/src/libaml/aml.c index 8615c6c1c..2b8ebd684 100644 --- a/sys/src/libaml/aml.c +++ b/sys/src/libaml/aml.c @@ -833,9 +833,9 @@ Vfmt(Fmt *f) r = p; e = r->ref; if(c == 'A') - return fmtprint(f, "Arg%ld=%V", r->ptr - e->arg, *r->ptr); + return fmtprint(f, "Arg%zd=%V", r->ptr - e->arg, *r->ptr); if(c == 'L') - return fmtprint(f, "Local%ld=%V", r->ptr - e->loc, *r->ptr); + return fmtprint(f, "Local%zd=%V", r->ptr - e->loc, *r->ptr); case 'n': return fmtprint(f, "%s", (char*)p); case 's': @@ -901,7 +901,7 @@ dumpregs(void) print("\n*** dumpregs: PC=%p FP=%p\n", PC, FP); e = nil; for(f = FP; f >= FB; f--){ - print("%.8p.%.2lx: %-8s %N\t", f->start, f-FB, f->phase, f->dot); + print("%.8p.%.2zx: %-8s %N\t", f->start, f-FB, f->phase, f->dot); if(f->op) print("%s", f->op->name); print("("); @@ -950,7 +950,7 @@ xec(uchar *pc, uchar *end, Name *dot, Env *env, void **pret) if((++loop & 127) == 0) gc(); if(amldebug) - print("\n%.8p.%.2lx %-8s\t%N\t", PC, FP - FB, FP->phase, FP->dot); + print("\n%.8p.%.2zx %-8s\t%N\t", PC, FP - FB, FP->phase, FP->dot); r = nil; c = *FP->phase++; switch(c){ diff --git a/sys/src/libflate/deflate.c b/sys/src/libflate/deflate.c index 3a55af3f1..1eb7e866c 100644 --- a/sys/src/libflate/deflate.c +++ b/sys/src/libflate/deflate.c @@ -478,7 +478,7 @@ deflateb(LZstate *lz, LZblock *lzb, void *rr, int (*r)(void*, void*, int)) lzput(lz, lz->eof && !lz->avail, 1); if(lz->debug){ - fprint(2, "block: bytes=%lud entries=%ld extra bits=%d\n\tuncompressed=%lud fixed=%lud dynamic=%lud huffman=%lud\n", + fprint(2, "block: bytes=%lud entries=%zd extra bits=%d\n\tuncompressed=%lud fixed=%lud dynamic=%lud huffman=%lud\n", nunc, lzb->eparse - lzb->parse, lzb->excost, (nunc + 4) * 8, nfix, ndyn, nhuff); fprint(2, "\tnlit=%lud matches=%lud eof=%d\n", nlits, nmatches, lz->eof && !lz->avail); } |