summaryrefslogtreecommitdiff
path: root/src/backend/regex/regcomp.c
diff options
context:
space:
mode:
authorTom Lane2000-12-03 20:45:40 +0000
committerTom Lane2000-12-03 20:45:40 +0000
commita27b691e2903a886be640db801677f6f988d3793 (patch)
treec68f25c9edef18954e9c5b3d74893f1df87b8871 /src/backend/regex/regcomp.c
parent4d2a506526ceacab5f75df040596a5287ab40612 (diff)
Ensure that all uses of <ctype.h> functions are applied to unsigned-char
values, whether the local char type is signed or not. This is necessary for portability. Per discussion on pghackers around 9/16/00.
Diffstat (limited to 'src/backend/regex/regcomp.c')
-rw-r--r--src/backend/regex/regcomp.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/backend/regex/regcomp.c b/src/backend/regex/regcomp.c
index 65cf92fc565..3d9ff83de83 100644
--- a/src/backend/regex/regcomp.c
+++ b/src/backend/regex/regcomp.c
@@ -1049,15 +1049,15 @@ int ch;
assert(pg_isalpha(ch));
if (pg_isupper(ch))
#ifdef MULTIBYTE
- return (unsigned char) tolower(ch);
+ return (unsigned char) tolower((unsigned char) ch);
#else
- return tolower(ch);
+ return tolower((unsigned char) ch);
#endif
else if (pg_islower(ch))
#ifdef MULTIBYTE
- return (unsigned char) toupper(ch);
+ return (unsigned char) toupper((unsigned char) ch);
#else
- return toupper(ch);
+ return toupper((unsigned char) ch);
#endif
else
/* peculiar, but could happen */
@@ -1882,9 +1882,9 @@ static int
pg_isdigit(int c)
{
#ifdef MULTIBYTE
- return (c >= 0 && c <= UCHAR_MAX && isdigit(c));
+ return (c >= 0 && c <= UCHAR_MAX && isdigit((unsigned char) c));
#else
- return (isdigit(c));
+ return (isdigit((unsigned char) c));
#endif
}
@@ -1892,9 +1892,9 @@ static int
pg_isalpha(int c)
{
#ifdef MULTIBYTE
- return (c >= 0 && c <= UCHAR_MAX && isalpha(c));
+ return (c >= 0 && c <= UCHAR_MAX && isalpha((unsigned char) c));
#else
- return (isalpha(c));
+ return (isalpha((unsigned char) c));
#endif
}
@@ -1902,9 +1902,9 @@ static int
pg_isupper(int c)
{
#ifdef MULTIBYTE
- return (c >= 0 && c <= UCHAR_MAX && isupper(c));
+ return (c >= 0 && c <= UCHAR_MAX && isupper((unsigned char) c));
#else
- return (isupper(c));
+ return (isupper((unsigned char) c));
#endif
}
@@ -1912,8 +1912,8 @@ static int
pg_islower(int c)
{
#ifdef MULTIBYTE
- return (c >= 0 && c <= UCHAR_MAX && islower(c));
+ return (c >= 0 && c <= UCHAR_MAX && islower((unsigned char) c));
#else
- return (islower(c));
+ return (islower((unsigned char) c));
#endif
}