summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorChip Salzenberg <chip@perl.com>1997-01-29 18:54:47 +1200
committerChip Salzenberg <chip@atlantic.net>1997-02-04 17:47:00 +1200
commit5344da4ec91b18285fb144f52fd37c696c5187d4 (patch)
treea14f61a994c860b8e4f895a73ff05dd24d61c76a /ext
parent6adf1df6c95069d09f9538d7c0eab6948cc799c9 (diff)
downloadperl-5344da4ec91b18285fb144f52fd37c696c5187d4.tar.gz
Make POSIX::is*() eight-bit-clean
Diffstat (limited to 'ext')
-rw-r--r--ext/POSIX/POSIX.xs88
1 files changed, 44 insertions, 44 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index 42aeb3bb93..3754e8c888 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -2798,11 +2798,11 @@ constant(name,arg)
int
isalnum(charstring)
- char * charstring
+ unsigned char * charstring
CODE:
- char *s;
- RETVAL = 1;
- for (s = charstring; *s && RETVAL; s++)
+ unsigned char *s = charstring;
+ unsigned char *e = s + na; /* "na" set by typemap side effect */
+ for (RETVAL = 1; RETVAL && s < e; s++)
if (!isalnum(*s))
RETVAL = 0;
OUTPUT:
@@ -2810,11 +2810,11 @@ isalnum(charstring)
int
isalpha(charstring)
- char * charstring
+ unsigned char * charstring
CODE:
- char *s;
- RETVAL = 1;
- for (s = charstring; *s && RETVAL; s++)
+ unsigned char *s = charstring;
+ unsigned char *e = s + na; /* "na" set by typemap side effect */
+ for (RETVAL = 1; RETVAL && s < e; s++)
if (!isalpha(*s))
RETVAL = 0;
OUTPUT:
@@ -2822,11 +2822,11 @@ isalpha(charstring)
int
iscntrl(charstring)
- char * charstring
+ unsigned char * charstring
CODE:
- char *s;
- RETVAL = 1;
- for (s = charstring; *s && RETVAL; s++)
+ unsigned char *s = charstring;
+ unsigned char *e = s + na; /* "na" set by typemap side effect */
+ for (RETVAL = 1; RETVAL && s < e; s++)
if (!iscntrl(*s))
RETVAL = 0;
OUTPUT:
@@ -2834,11 +2834,11 @@ iscntrl(charstring)
int
isdigit(charstring)
- char * charstring
+ unsigned char * charstring
CODE:
- char *s;
- RETVAL = 1;
- for (s = charstring; *s && RETVAL; s++)
+ unsigned char *s = charstring;
+ unsigned char *e = s + na; /* "na" set by typemap side effect */
+ for (RETVAL = 1; RETVAL && s < e; s++)
if (!isdigit(*s))
RETVAL = 0;
OUTPUT:
@@ -2846,11 +2846,11 @@ isdigit(charstring)
int
isgraph(charstring)
- char * charstring
+ unsigned char * charstring
CODE:
- char *s;
- RETVAL = 1;
- for (s = charstring; *s && RETVAL; s++)
+ unsigned char *s = charstring;
+ unsigned char *e = s + na; /* "na" set by typemap side effect */
+ for (RETVAL = 1; RETVAL && s < e; s++)
if (!isgraph(*s))
RETVAL = 0;
OUTPUT:
@@ -2858,11 +2858,11 @@ isgraph(charstring)
int
islower(charstring)
- char * charstring
+ unsigned char * charstring
CODE:
- char *s;
- RETVAL = 1;
- for (s = charstring; *s && RETVAL; s++)
+ unsigned char *s = charstring;
+ unsigned char *e = s + na; /* "na" set by typemap side effect */
+ for (RETVAL = 1; RETVAL && s < e; s++)
if (!islower(*s))
RETVAL = 0;
OUTPUT:
@@ -2870,11 +2870,11 @@ islower(charstring)
int
isprint(charstring)
- char * charstring
+ unsigned char * charstring
CODE:
- char *s;
- RETVAL = 1;
- for (s = charstring; *s && RETVAL; s++)
+ unsigned char *s = charstring;
+ unsigned char *e = s + na; /* "na" set by typemap side effect */
+ for (RETVAL = 1; RETVAL && s < e; s++)
if (!isprint(*s))
RETVAL = 0;
OUTPUT:
@@ -2882,11 +2882,11 @@ isprint(charstring)
int
ispunct(charstring)
- char * charstring
+ unsigned char * charstring
CODE:
- char *s;
- RETVAL = 1;
- for (s = charstring; *s && RETVAL; s++)
+ unsigned char *s = charstring;
+ unsigned char *e = s + na; /* "na" set by typemap side effect */
+ for (RETVAL = 1; RETVAL && s < e; s++)
if (!ispunct(*s))
RETVAL = 0;
OUTPUT:
@@ -2894,11 +2894,11 @@ ispunct(charstring)
int
isspace(charstring)
- char * charstring
+ unsigned char * charstring
CODE:
- char *s;
- RETVAL = 1;
- for (s = charstring; *s && RETVAL; s++)
+ unsigned char *s = charstring;
+ unsigned char *e = s + na; /* "na" set by typemap side effect */
+ for (RETVAL = 1; RETVAL && s < e; s++)
if (!isspace(*s))
RETVAL = 0;
OUTPUT:
@@ -2906,11 +2906,11 @@ isspace(charstring)
int
isupper(charstring)
- char * charstring
+ unsigned char * charstring
CODE:
- char *s;
- RETVAL = 1;
- for (s = charstring; *s && RETVAL; s++)
+ unsigned char *s = charstring;
+ unsigned char *e = s + na; /* "na" set by typemap side effect */
+ for (RETVAL = 1; RETVAL && s < e; s++)
if (!isupper(*s))
RETVAL = 0;
OUTPUT:
@@ -2918,11 +2918,11 @@ isupper(charstring)
int
isxdigit(charstring)
- char * charstring
+ unsigned char * charstring
CODE:
- char *s;
- RETVAL = 1;
- for (s = charstring; *s && RETVAL; s++)
+ unsigned char *s = charstring;
+ unsigned char *e = s + na; /* "na" set by typemap side effect */
+ for (RETVAL = 1; RETVAL && s < e; s++)
if (!isxdigit(*s))
RETVAL = 0;
OUTPUT: