From: ceriel Date: Tue, 23 Apr 1991 09:35:51 +0000 (+0000) Subject: ptr_diff is a long in ANSI C; cast to int X-Git-Tag: release-5-5~1127 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=e8ff85905f04790b6f6d46408892af02dbece47d;p=ack.git ptr_diff is a long in ANSI C; cast to int --- diff --git a/lang/pc/libpc/catch.c b/lang/pc/libpc/catch.c index 1526e6267..204140294 100644 --- a/lang/pc/libpc/catch.c +++ b/lang/pc/libpc/catch.c @@ -145,7 +145,7 @@ _catch(erno) unsigned erno; { p = q; while (*p) p++; - if (_write(2,q,p-q) < 0) + if (_write(2,q,(int)(p-q)) < 0) ; } _exit(erno); diff --git a/lang/pc/libpc/wrf.c b/lang/pc/libpc/wrf.c index acc42d94b..5ee6e629a 100644 --- a/lang/pc/libpc/wrf.c +++ b/lang/pc/libpc/wrf.c @@ -64,5 +64,5 @@ _wrf(n,w,r,f) int n,w; double r; struct file *f; { *p++ = (*b ? *b++ : FILL_CHAR); assert(p <= buf+BUFSIZE); } - _wstrin(w,p-buf,buf,f); + _wstrin(w,(int)(p-buf),buf,f); } diff --git a/lang/pc/libpc/wri.c b/lang/pc/libpc/wri.c index 11a8dc92d..5c06e5290 100644 --- a/lang/pc/libpc/wri.c +++ b/lang/pc/libpc/wri.c @@ -64,7 +64,7 @@ _wsi(w,i,f) int w,i; struct file *f; { while (j /= 10); if (i<0) *--p = '-'; - _wstrin(w,&buf[SZ]-p,p,f); + _wstrin(w,(int)(&buf[SZ]-p),p,f); } _wri(i,f) int i; struct file *f; { diff --git a/lang/pc/libpc/wrl.c b/lang/pc/libpc/wrl.c index ae6018b8f..f5a3d67ca 100644 --- a/lang/pc/libpc/wrl.c +++ b/lang/pc/libpc/wrl.c @@ -43,7 +43,7 @@ _wsl(w,l,f) int w; long l; struct file *f; { } while (j /= 10); if (l<0) *--p = '-'; - _wstrin(w,&buf[11]-p,p,f); + _wstrin(w,(int)(&buf[11]-p),p,f); } _wrl(l,f) long l; struct file *f; { diff --git a/lang/pc/libpc/wrr.c b/lang/pc/libpc/wrr.c index 4f8cfc3ca..5c2df66e7 100644 --- a/lang/pc/libpc/wrr.c +++ b/lang/pc/libpc/wrr.c @@ -59,7 +59,7 @@ _wsr(w,r,f) int w; double r; struct file *f; { *p++ = '0' + (d/10) % 10; *p++ = '0' + d%10; } - _wstrin(w,p-buf,buf,f); + _wstrin(w,(int)(p-buf),buf,f); } _wrr(r,f) double r; struct file *f; { diff --git a/lang/pc/libpc/wrz.c b/lang/pc/libpc/wrz.c index b14b5f2d4..220c66a49 100644 --- a/lang/pc/libpc/wrz.c +++ b/lang/pc/libpc/wrz.c @@ -27,12 +27,12 @@ _wsz(w,s,f) int w; char *s; struct file *f; { if (w < 0) _trp(EWIDTH); for (p=s; *p; p++); - _wss(w,p-s,s,f); + _wss(w,(int)(p-s),s,f); } _wrz(s,f) char *s; struct file *f; { char *p; for (p=s; *p; p++); - _wrs(p-s,s,f); + _wrs((int)(p-s),s,f); }