From: Chip Salzenberg Date: Fri, 4 Apr 1997 00:00:00 +0000 (+0000) Subject: Use SSize_t for values of PerlIO_{read,write} X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5b54f415353cb889898fb25391f5dff73990f3f2;p=p5sagit%2Fp5-mst-13.2.git Use SSize_t for values of PerlIO_{read,write} --- diff --git a/perlio.c b/perlio.c index d9b3d81..0a0625c 100644 --- a/perlio.c +++ b/perlio.c @@ -382,21 +382,21 @@ int ch; } #undef PerlIO_read -int +SSize_t PerlIO_read(f,buf,count) PerlIO *f; void *buf; -size_t count; +Size_t count; { return fread(buf,1,count,f); } #undef PerlIO_write -int +SSize_t PerlIO_write(f,buf,count) PerlIO *f; const void *buf; -size_t count; +Size_t count; { return fwrite1(buf,1,count,f); } diff --git a/perlio.h b/perlio.h index 9af62f5..59d1a19 100644 --- a/perlio.h +++ b/perlio.h @@ -120,10 +120,10 @@ extern FILE * PerlIO_findFILE _((PerlIO *)); extern void PerlIO_releaseFILE _((PerlIO *,FILE *)); #endif #ifndef PerlIO_read -extern int PerlIO_read _((PerlIO *,void *,size_t)); +extern SSize_t PerlIO_read _((PerlIO *,void *,Size_t)); #endif #ifndef PerlIO_write -extern int PerlIO_write _((PerlIO *,const void *,size_t)); +extern SSize_t PerlIO_write _((PerlIO *,const void *,Size_t)); #endif #ifndef PerlIO_setlinebuf extern void PerlIO_setlinebuf _((PerlIO *)); diff --git a/perlsdio.h b/perlsdio.h index 97add0f..8bb5051 100644 --- a/perlsdio.h +++ b/perlsdio.h @@ -39,12 +39,14 @@ * VAXCRTL which causes read from a pipe after EOF has been returned * once to hang. */ -# define PerlIO_getc(f) (feof(f) ? EOF : getc(f)) -# define PerlIO_read(f,buf,count) (feof(f) ? 0 : fread(buf,1,count,f)) +# define PerlIO_getc(f) \ + (feof(f) ? EOF : getc(f)) +# define PerlIO_read(f,buf,count) \ + (feof(f) ? 0 : (SSize_t)fread(buf,1,count,f)) #else # define PerlIO_ungetc(f,c) ungetc(c,f) # define PerlIO_getc(f) getc(f) -# define PerlIO_read(f,buf,count) fread(buf,1,count,f) +# define PerlIO_read(f,buf,count) (SSize_t)fread(buf,1,count,f) #endif #define PerlIO_eof(f) feof(f) #define PerlIO_getname(f,b) fgetname(f,b) diff --git a/pp_sys.c b/pp_sys.c index 45290d6..fe11f85 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -1155,7 +1155,7 @@ PP(pp_sysread) GV *gv; IO *io; char *buffer; - int length; + SSize_t length; Sock_size_t bufsize; SV *bufsv; STRLEN blen;