ptr_diff is a long in ANSI C; cast to int

This commit is contained in:
ceriel 1991-04-23 09:35:51 +00:00
parent d6a224ea5f
commit e8ff85905f
6 changed files with 7 additions and 7 deletions

View file

@ -145,7 +145,7 @@ _catch(erno) unsigned erno; {
p = q; p = q;
while (*p) while (*p)
p++; p++;
if (_write(2,q,p-q) < 0) if (_write(2,q,(int)(p-q)) < 0)
; ;
} }
_exit(erno); _exit(erno);

View file

@ -64,5 +64,5 @@ _wrf(n,w,r,f) int n,w; double r; struct file *f; {
*p++ = (*b ? *b++ : FILL_CHAR); *p++ = (*b ? *b++ : FILL_CHAR);
assert(p <= buf+BUFSIZE); assert(p <= buf+BUFSIZE);
} }
_wstrin(w,p-buf,buf,f); _wstrin(w,(int)(p-buf),buf,f);
} }

View file

@ -64,7 +64,7 @@ _wsi(w,i,f) int w,i; struct file *f; {
while (j /= 10); while (j /= 10);
if (i<0) if (i<0)
*--p = '-'; *--p = '-';
_wstrin(w,&buf[SZ]-p,p,f); _wstrin(w,(int)(&buf[SZ]-p),p,f);
} }
_wri(i,f) int i; struct file *f; { _wri(i,f) int i; struct file *f; {

View file

@ -43,7 +43,7 @@ _wsl(w,l,f) int w; long l; struct file *f; {
} while (j /= 10); } while (j /= 10);
if (l<0) if (l<0)
*--p = '-'; *--p = '-';
_wstrin(w,&buf[11]-p,p,f); _wstrin(w,(int)(&buf[11]-p),p,f);
} }
_wrl(l,f) long l; struct file *f; { _wrl(l,f) long l; struct file *f; {

View file

@ -59,7 +59,7 @@ _wsr(w,r,f) int w; double r; struct file *f; {
*p++ = '0' + (d/10) % 10; *p++ = '0' + (d/10) % 10;
*p++ = '0' + d%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; { _wrr(r,f) double r; struct file *f; {

View file

@ -27,12 +27,12 @@ _wsz(w,s,f) int w; char *s; struct file *f; {
if (w < 0) _trp(EWIDTH); if (w < 0) _trp(EWIDTH);
for (p=s; *p; p++); 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; { _wrz(s,f) char *s; struct file *f; {
char *p; char *p;
for (p=s; *p; p++); for (p=s; *p; p++);
_wrs(p-s,s,f); _wrs((int)(p-s),s,f);
} }