]> git.lizzy.rs Git - plan9front.git/commitdiff
format pointer subtraction results with %zd instead of %ld (for long -> intptr on...
authorcinap_lenrek <cinap_lenrek@felloff.net>
Thu, 7 Jan 2016 03:44:13 +0000 (04:44 +0100)
committercinap_lenrek <cinap_lenrek@felloff.net>
Thu, 7 Jan 2016 03:44:13 +0000 (04:44 +0100)
35 files changed:
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

index 19a6554f34e032e0bca62c270c9cbae93c05be0f..9023e08a59e9bb181293c01f134a0d2680cc8148 100644 (file)
@@ -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;
index 6e7aa3de9eabe69e2a05ad07954859a3babc0d57..18e19e120dbf5f8e25e8a2e60a878327b8d871d2 100644 (file)
@@ -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);
index 6544a80a7225acb9b991557c4167f71271b8b3d8..7d71d612f559152a5a7674a553131b1d1277975b 100644 (file)
@@ -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;
index 68d66c25d6861b11df6f1ac9ad4446d6bfb0e3f6..5c01c922d4badc978f5315e5168d8da45532e34d 100644 (file)
@@ -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;
                        }
index 7511a765451c0dbfc9a075d3ba248ca8fac6683f..2b5cc9304d1a8d36de8cffe0913f85d41a54909a 100644 (file)
@@ -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:");
 
 
index eadca93ec267f133c7804114f99c2e5527c33d45..412a8eef91bbff65ca9a469cd3cbbc0b94c37488 100644 (file)
@@ -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");
index 55575c384db9d63a91309e03831df9cdd0b536a7..74919f2e861a0f5f73638f6ccd5cc08f401ffc63 100644 (file)
@@ -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;
index c0153674214d74f244ced78470aca5e8d003ec05..a11a6e3cbcd58aac00532e23a3d0708c4416bdb5 100644 (file)
@@ -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;
index 583669273b51902b0de9d3b03949ab31e21c38a0..6f0e67b3938feed7161a093814b91fc44529d29e 100644 (file)
@@ -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;
index e71bb2e20a06dc0b3213bd72ad7cd78224738a98..156d4310a3bbf6b17a7cf8f60c81f4f807a4506d 100644 (file)
@@ -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
index b1b45ad6787939c97ea3bb5af0c223358e0c74dd..c6f477303e23aab62fed5dc6f0c15008a6a70042 100644 (file)
@@ -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";
        }
 
index 8b72a274226f18d453a33446e8022d818445483b..cb551160f21d155e3cd00c61913cfacb81d1391c 100644 (file)
@@ -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;
index 708dd41a19f75f9cd522e4dac5af308698215f9a..99dd3e32c054c564a83c55ac3987a0c94187b093 100644 (file)
@@ -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
index 5deabd8a2e46c3eef4e239e6adf36905e3570528..834a83891d12f77df2a8a09f677d094db7701685 100644 (file)
@@ -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;
index b3ef1c13b082c94326619e701ff559b27584df3e..f0ddc4c398409566c29fd499fe9d12d4f20c3b41 100644 (file)
@@ -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))
index aaf6fc7f334fc0e91636573170244ec1fbc819d8..52560f9968a57e9ca90e916d1a244ebdbb057c03 100644 (file)
@@ -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);
index 125893990025cc69a912d6935a16047ea654a427..4f9ce3cf8cd4da981e0baae2ef45782e71d07037 100644 (file)
@@ -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;
        }
index fdf2aaac89879464607d472f3499acb6db39c1bc..1b691d96dbb1d9412089a4085d3ac41897540abd 100644 (file)
@@ -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;
        }
index d5ee1eb7274ece852f12863b56649ceee329ddc1..3441fca7b8e6bd7d0a42f422886eb2aea75dcd46 100644 (file)
@@ -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");
 
index 0f24119611c13ef35a786cc9f1d13ab48c4c1d2e..ea7ba9a7ea41311f8b7b3d094d61a0cb0527c934 100644 (file)
@@ -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;
        }
 
index d920462ce87b7cdf274cf4a7fcfbcbc58b1cc0a1..8d35bbddb3131cdcca4c00ce80ec82bab5b500f7 100644 (file)
@@ -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);
index 94306d11716a5f119de852a5d24374d7258bc460..dd7085a66b7d13afb38f1f739c597c3e133f4a74 100644 (file)
@@ -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)
index a7341c4e45470df6481058ecd99f8bfe98513b76..591efe96b70fdb7e5e9c561361afe96eb7ae3858 100644 (file)
@@ -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;
index bdbc63cf53b880b3acb17ced87ea99c9ba170b4d..d74facb442c64705e3851ccfc8fdcb401a9c07be 100644 (file)
@@ -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)
index 7732a03b59830ca0a3b5c316a980ca6a1fbbeac1..3049dfa24d1e45c85a92fe495bf743e159c6b8ab 100644 (file)
@@ -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;
index d82d67e5c498654e9b18de892d77c91151f46dbd..87fb1ef96ab89d36634e15c5f2c96b3bd5c0be52 100644 (file)
@@ -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);
index 46695efd8e5193db3a23d16f4a5142e9a0aa5081..533d5958a2e12d3c0e6b2cff8f774a4d2048b9b7 100644 (file)
@@ -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");
        }
 }
index 7c450546983f3c004c43edf9fd7eae6563fa2728..cbba30dc8fa317ea4911cca7368cb385e6c18802 100644 (file)
@@ -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]){
index 21f786f0cdaf440ef23237f91aa864250a7b03fa..3cd14e6cd8b0a241dfa58ee2ba92c203b623431e 100644 (file)
@@ -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);
index 2f24055c9a52811d89dc13d364b1135745e9a66f..97ec3855b3421ec37008c9b74c0c84f2b31793f1 100644 (file)
@@ -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);
 }
index d492b4b874f93c4a4416360af04d862fd93792b2..15d9047086988734f40f7c62afd5fc6206d672a8 100644 (file)
@@ -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;
index 5530bd07d003f43c444940d600c9b41cae07a809..a2c36f791db1415ebec68d47279cb18917d46124 100644 (file)
@@ -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){
index 9818844174f16ee8e648f704fb11607f88132fd2..7f2eb70fd769c511e702ff352259fa8a4dd9a79c 100644 (file)
@@ -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);
index 8615c6c1c8d988edf7a3fd3b23c39bf45938193a..2b8ebd68420c597a6bb90bda179ea2d155681623 100644 (file)
@@ -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){
index 3a55af3f10c95abcffed9207357027220ad0a77a..1eb7e866c79b56775bf9d22c563adfb08b9b0259 100644 (file)
@@ -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);
        }