From: Chip Salzenberg Date: Sat, 21 Dec 1996 08:08:54 +0000 (+1200) Subject: Prevent warnings when STDCHAR is unsigned X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=888911fcc68a18021b42aeaddb5cb8725ce411af;p=p5sagit%2Fp5-mst-13.2.git Prevent warnings when STDCHAR is unsigned --- diff --git a/perlio.c b/perlio.c index a1e6ff0..85b036c 100644 --- a/perlio.c +++ b/perlio.c @@ -158,19 +158,19 @@ int cnt; void PerlIO_set_ptrcnt(f,ptr,cnt) PerlIO *f; -char *ptr; +STDCHAR *ptr; int cnt; { #ifdef FILE_bufsiz - char *e = (char *)(FILE_base(f) + FILE_bufsiz(f)); - int ec = e - ptr; + STDCHAR *e = FILE_base(f) + FILE_bufsiz(f); + int ec = e - ptr; if (ptr > e + 1) warn("Setting ptr %p > end+1 %p\n", ptr, e + 1); if (cnt != ec) warn("Setting cnt to %d, ptr implies %d\n",cnt,ec); #endif #if defined(USE_STDIO_PTR) && defined(STDIO_PTR_LVALUE) - FILE_ptr(f) = (STDCHAR *) ptr; + FILE_ptr(f) = ptr; #else croak("Cannot set 'ptr' of FILE * on this system"); #endif @@ -208,12 +208,12 @@ PerlIO *f; } #undef PerlIO_get_ptr -char * +STDCHAR * PerlIO_get_ptr(f) PerlIO *f; { #ifdef FILE_ptr - return (char *) FILE_ptr(f); + return FILE_ptr(f); #else croak("Cannot get 'ptr' of FILE * on this system"); return NULL; @@ -221,12 +221,12 @@ PerlIO *f; } #undef PerlIO_get_base -char * +STDCHAR * PerlIO_get_base(f) PerlIO *f; { #ifdef FILE_base - return (char *) FILE_base(f); + return FILE_base(f); #else croak("Cannot get 'base' of FILE * on this system"); return NULL; diff --git a/perlio.h b/perlio.h index a117504..9af62f5 100644 --- a/perlio.h +++ b/perlio.h @@ -161,7 +161,7 @@ extern int PerlIO_fast_gets _((PerlIO *)); extern int PerlIO_canset_cnt _((PerlIO *)); #endif #ifndef PerlIO_get_ptr -extern char * PerlIO_get_ptr _((PerlIO *)); +extern STDCHAR * PerlIO_get_ptr _((PerlIO *)); #endif #ifndef PerlIO_get_cnt extern int PerlIO_get_cnt _((PerlIO *)); @@ -170,10 +170,10 @@ extern int PerlIO_get_cnt _((PerlIO *)); extern void PerlIO_set_cnt _((PerlIO *,int)); #endif #ifndef PerlIO_set_ptrcnt -extern void PerlIO_set_ptrcnt _((PerlIO *,char *,int)); +extern void PerlIO_set_ptrcnt _((PerlIO *,STDCHAR *,int)); #endif #ifndef PerlIO_get_base -extern char * PerlIO_get_base _((PerlIO *)); +extern STDCHAR * PerlIO_get_base _((PerlIO *)); #endif #ifndef PerlIO_get_bufsiz extern int PerlIO_get_bufsiz _((PerlIO *));