diff options
Diffstat (limited to 'src/backend/utils/adt')
-rw-r--r-- | src/backend/utils/adt/acl.c | 14 | ||||
-rw-r--r-- | src/backend/utils/adt/arrayfuncs.c | 14 | ||||
-rw-r--r-- | src/backend/utils/adt/cash.c | 14 | ||||
-rw-r--r-- | src/backend/utils/adt/datetime.c | 64 | ||||
-rw-r--r-- | src/backend/utils/adt/format_type.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/formatting.c | 24 | ||||
-rw-r--r-- | src/backend/utils/adt/geo_ops.c | 36 | ||||
-rw-r--r-- | src/backend/utils/adt/inet_net_pton.c | 29 | ||||
-rw-r--r-- | src/backend/utils/adt/int.c | 8 | ||||
-rw-r--r-- | src/backend/utils/adt/int8.c | 8 | ||||
-rw-r--r-- | src/backend/utils/adt/nabstime.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/numeric.c | 10 | ||||
-rw-r--r-- | src/backend/utils/adt/oid.c | 8 | ||||
-rw-r--r-- | src/backend/utils/adt/oracle_compat.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/selfuncs.c | 6 | ||||
-rw-r--r-- | src/backend/utils/adt/timestamp.c | 14 | ||||
-rw-r--r-- | src/backend/utils/adt/varlena.c | 12 |
17 files changed, 139 insertions, 134 deletions
diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c index ee3a41701f..1a505ccadd 100644 --- a/src/backend/utils/adt/acl.c +++ b/src/backend/utils/adt/acl.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.54 2000/11/28 23:42:31 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.55 2000/12/03 20:45:35 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -57,7 +57,7 @@ getid(char *s, char *n) Assert(s && n); - while (isspace((int) *s)) + while (isspace((unsigned char) *s)) ++s; if (*s == '"') @@ -66,7 +66,9 @@ getid(char *s, char *n) s++; } - for (id = s, len = 0; isalnum((int) *s) || *s == '_' || in_quotes; ++len, ++s) + for (id = s, len = 0; + isalnum((unsigned char) *s) || *s == '_' || in_quotes; + ++len, ++s) { if (in_quotes && *s == '"') { @@ -80,7 +82,7 @@ getid(char *s, char *n) if (len > 0) memmove(n, id, len); n[len] = '\0'; - while (isspace((int) *s)) + while (isspace((unsigned char) *s)) ++s; return s; } @@ -149,7 +151,7 @@ aclparse(char *s, AclItem *aip, unsigned *modechg) } aip->ai_mode = ACL_NO; - while (isalpha((int) *++s)) + while (isalpha((unsigned char) *++s)) { switch (*s) { @@ -242,7 +244,7 @@ aclitemin(PG_FUNCTION_ARGS) s = aclparse(s, aip, &modechg); if (modechg != ACL_MODECHG_EQL) elog(ERROR, "aclitemin: cannot accept anything but = ACLs"); - while (isspace((int) *s)) + while (isspace((unsigned char) *s)) ++s; if (*s) elog(ERROR, "aclitemin: extra garbage at end of specification"); diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c index 47c1b814c4..6379f041ad 100644 --- a/src/backend/utils/adt/arrayfuncs.c +++ b/src/backend/utils/adt/arrayfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.66 2000/11/16 22:30:31 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.67 2000/12/03 20:45:35 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -146,14 +146,14 @@ array_in(PG_FUNCTION_ARGS) * Note: we currently allow whitespace between, but not within, * dimension items. */ - while (isspace((int) *p)) + while (isspace((unsigned char) *p)) p++; if (*p != '[') break; /* no more dimension items */ p++; if (ndim >= MAXDIM) elog(ERROR, "array_in: more than %d dimensions", MAXDIM); - for (q = p; isdigit((int) *q); q++); + for (q = p; isdigit((unsigned char) *q); q++); if (q == p) /* no digits? */ elog(ERROR, "array_in: missing dimension value"); if (*q == ':') @@ -162,7 +162,7 @@ array_in(PG_FUNCTION_ARGS) *q = '\0'; lBound[ndim] = atoi(p); p = q + 1; - for (q = p; isdigit((int) *q); q++); + for (q = p; isdigit((unsigned char) *q); q++); if (q == p) /* no digits? */ elog(ERROR, "array_in: missing dimension value"); } @@ -197,7 +197,7 @@ array_in(PG_FUNCTION_ARGS) if (strncmp(p, ASSGN, strlen(ASSGN)) != 0) elog(ERROR, "array_in: missing assignment operator"); p += strlen(ASSGN); - while (isspace((int) *p)) + while (isspace((unsigned char) *p)) p++; } @@ -323,7 +323,7 @@ ArrayCount(char *str, int *dim, int typdelim) temp[ndim - 1]++; q++; if (!eoArray) - while (isspace((int) *q)) + while (isspace((unsigned char) *q)) q++; } for (i = 0; i < ndim; ++i) @@ -454,7 +454,7 @@ ReadArrayStr(char *arrayStr, * if not at the end of the array skip white space */ if (!eoArray) - while (isspace((int) *q)) + while (isspace((unsigned char) *q)) { p++; q++; diff --git a/src/backend/utils/adt/cash.c b/src/backend/utils/adt/cash.c index f340fe6aae..7a3a5c11be 100644 --- a/src/backend/utils/adt/cash.c +++ b/src/backend/utils/adt/cash.c @@ -9,7 +9,7 @@ * workings can be found in the book "Software Solutions in C" by * Dale Schumacher, Academic Press, ISBN: 0-12-632360-7. * - * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.48 2000/11/25 22:43:08 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.49 2000/12/03 20:45:35 tgl Exp $ */ #include "postgres.h" @@ -122,7 +122,7 @@ cash_in(PG_FUNCTION_ARGS) /* we need to add all sorts of checking here. For now just */ /* strip all leading whitespace and any leading currency symbol */ - while (isspace((int) *s)) + while (isspace((unsigned char) *s)) s++; if (strncmp(s, csymbol, strlen(csymbol)) == 0) s += strlen(csymbol); @@ -154,7 +154,7 @@ cash_in(PG_FUNCTION_ARGS) printf("cashin- string is '%s'\n", s); #endif - while (isspace((int) *s)) + while (isspace((unsigned char) *s)) s++; if (strncmp(s, csymbol, strlen(csymbol)) == 0) s += strlen(csymbol); @@ -167,7 +167,7 @@ cash_in(PG_FUNCTION_ARGS) { /* we look for digits as int4 as we have less */ /* than the required number of decimal places */ - if (isdigit((int) *s) && dec < fpoint) + if (isdigit((unsigned char) *s) && dec < fpoint) { value = (value * 10) + *s - '0'; @@ -189,7 +189,7 @@ cash_in(PG_FUNCTION_ARGS) else { /* round off */ - if (isdigit((int) *s) && *s >= '5') + if (isdigit((unsigned char) *s) && *s >= '5') value++; /* adjust for less than required decimal places */ @@ -200,7 +200,7 @@ cash_in(PG_FUNCTION_ARGS) } } - while (isspace((int) *s) || *s == '0' || *s == ')') + while (isspace((unsigned char) *s) || *s == '0' || *s == ')') s++; if (*s != '\0') @@ -707,7 +707,7 @@ cash_words(PG_FUNCTION_ARGS) strcat(buf, m0 == 1 ? " cent" : " cents"); /* capitalize output */ - buf[0] = toupper(buf[0]); + buf[0] = toupper((unsigned char) buf[0]); /* make a text type for output */ result = (text *) palloc(strlen(buf) + VARHDRSZ); diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c index a167943dff..1426088e62 100644 --- a/src/backend/utils/adt/datetime.c +++ b/src/backend/utils/adt/datetime.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.56 2000/11/11 19:55:19 thomas Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.57 2000/12/03 20:45:35 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -421,16 +421,17 @@ ParseDateTime(char *timestr, char *lowstr, field[nf] = lp; /* leading digit? then date or time */ - if (isdigit((int) *cp) || (*cp == '.')) + if (isdigit((unsigned char) *cp) || (*cp == '.')) { *lp++ = *cp++; - while (isdigit((int) *cp)) + while (isdigit((unsigned char) *cp)) *lp++ = *cp++; /* time field? */ if (*cp == ':') { ftype[nf] = DTK_TIME; - while (isdigit((int) *cp) || (*cp == ':') || (*cp == '.')) + while (isdigit((unsigned char) *cp) || + (*cp == ':') || (*cp == '.')) *lp++ = *cp++; } @@ -438,8 +439,9 @@ ParseDateTime(char *timestr, char *lowstr, else if ((*cp == '-') || (*cp == '/') || (*cp == '.')) { ftype[nf] = DTK_DATE; - while (isalnum((int) *cp) || (*cp == '-') || (*cp == '/') || (*cp == '.')) - *lp++ = tolower(*cp++); + while (isalnum((unsigned char) *cp) || (*cp == '-') || + (*cp == '/') || (*cp == '.')) + *lp++ = tolower((unsigned char) *cp++); } @@ -456,12 +458,12 @@ ParseDateTime(char *timestr, char *lowstr, * text? then date string, month, day of week, special, or * timezone */ - else if (isalpha((int) *cp)) + else if (isalpha((unsigned char) *cp)) { ftype[nf] = DTK_STRING; - *lp++ = tolower(*cp++); - while (isalpha((int) *cp)) - *lp++ = tolower(*cp++); + *lp++ = tolower((unsigned char) *cp++); + while (isalpha((unsigned char) *cp)) + *lp++ = tolower((unsigned char) *cp++); /* * Full date string with leading text month? Could also be a @@ -470,13 +472,14 @@ ParseDateTime(char *timestr, char *lowstr, if ((*cp == '-') || (*cp == '/') || (*cp == '.')) { ftype[nf] = DTK_DATE; - while (isdigit((int) *cp) || (*cp == '-') || (*cp == '/') || (*cp == '.')) - *lp++ = tolower(*cp++); + while (isdigit((unsigned char) *cp) || + (*cp == '-') || (*cp == '/') || (*cp == '.')) + *lp++ = tolower((unsigned char) *cp++); } /* skip leading spaces */ } - else if (isspace((int) *cp)) + else if (isspace((unsigned char) *cp)) { cp++; continue; @@ -487,24 +490,25 @@ ParseDateTime(char *timestr, char *lowstr, { *lp++ = *cp++; /* soak up leading whitespace */ - while (isspace((int) *cp)) + while (isspace((unsigned char) *cp)) cp++; /* numeric timezone? */ - if (isdigit((int) *cp)) + if (isdigit((unsigned char) *cp)) { ftype[nf] = DTK_TZ; *lp++ = *cp++; - while (isdigit((int) *cp) || (*cp == ':') || (*cp == '.')) + while (isdigit((unsigned char) *cp) || + (*cp == ':') || (*cp == '.')) *lp++ = *cp++; /* special? */ } - else if (isalpha((int) *cp)) + else if (isalpha((unsigned char) *cp)) { ftype[nf] = DTK_SPECIAL; - *lp++ = tolower(*cp++); - while (isalpha((int) *cp)) - *lp++ = tolower(*cp++); + *lp++ = tolower((unsigned char) *cp++); + while (isalpha((unsigned char) *cp)) + *lp++ = tolower((unsigned char) *cp++); /* otherwise something wrong... */ } @@ -513,7 +517,7 @@ ParseDateTime(char *timestr, char *lowstr, /* ignore punctuation but use as delimiter */ } - else if (ispunct((int) *cp)) + else if (ispunct((unsigned char) *cp)) { cp++; continue; @@ -631,7 +635,7 @@ DecodeDateTime(char **field, int *ftype, int nf, * PST) */ if ((i > 0) && ((fmask & DTK_M(TZ)) != 0) - && (ftype[i - 1] == DTK_TZ) && (isalpha((int) *field[i - 1]))) + && (ftype[i - 1] == DTK_TZ) && (isalpha((unsigned char) *field[i - 1]))) { *tzp -= tz; tmask = 0; @@ -974,7 +978,7 @@ DecodeTimeOnly(char **field, int *ftype, int nf, * PST) */ if ((i > 0) && ((fmask & DTK_M(TZ)) != 0) - && (ftype[i - 1] == DTK_TZ) && (isalpha((int) *field[i - 1]))) + && (ftype[i - 1] == DTK_TZ) && (isalpha((unsigned char) *field[i - 1]))) { *tzp -= tz; tmask = 0; @@ -1162,18 +1166,18 @@ DecodeDate(char *str, int fmask, int *tmask, struct tm * tm) while ((*str != '\0') && (nf < MAXDATEFIELDS)) { /* skip field separators */ - while (!isalnum((int) *str)) + while (!isalnum((unsigned char) *str)) str++; field[nf] = str; - if (isdigit((int) *str)) + if (isdigit((unsigned char) *str)) { - while (isdigit((int) *str)) + while (isdigit((unsigned char) *str)) str++; } - else if (isalpha((int) *str)) + else if (isalpha((unsigned char) *str)) { - while (isalpha((int) *str)) + while (isalpha((unsigned char) *str)) str++; } @@ -1193,7 +1197,7 @@ DecodeDate(char *str, int fmask, int *tmask, struct tm * tm) /* look first for text fields, since that will be unambiguous month */ for (i = 0; i < nf; i++) { - if (isalpha((int) *field[i])) + if (isalpha((unsigned char) *field[i])) { type = DecodeSpecial(i, field[i], &val); if (type == IGNORE) @@ -1556,7 +1560,7 @@ DecodePosixTimezone(char *str, int *tzp) char delim; cp = str; - while ((*cp != '\0') && isalpha((int) *cp)) + while ((*cp != '\0') && isalpha((unsigned char) *cp)) cp++; if (DecodeTimezone(cp, &tz) != 0) diff --git a/src/backend/utils/adt/format_type.c b/src/backend/utils/adt/format_type.c index 6022dc7851..62107cb019 100644 --- a/src/backend/utils/adt/format_type.c +++ b/src/backend/utils/adt/format_type.c @@ -8,7 +8,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/format_type.c,v 1.6 2000/11/16 22:30:31 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/format_type.c,v 1.7 2000/12/03 20:45:35 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -203,7 +203,7 @@ format_type_internal(Oid type_oid, int32 typemod) default: name = NameStr(((Form_pg_type) GETSTRUCT(tuple))->typname); if (strspn(name, "abcdefghijklmnopqrstuvwxyz0123456789_") != strlen(name) - || isdigit((int) name[0])) + || isdigit((unsigned char) name[0])) buf = psnprintf(strlen(name) + 3, "\"%s\"", name); else buf = pstrdup(name); diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index 7602848eb9..b7e6bb99d8 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------- * formatting.c * - * $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.25 2000/12/01 05:17:19 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.26 2000/12/03 20:45:35 tgl Exp $ * * * Portions Copyright (c) 1999-2000, PostgreSQL, Inc @@ -127,7 +127,7 @@ typedef struct int len, /* keyword length */ (*action) (), id; /* keyword id */ - bool isdigit; /* is expected output/input digit */ + bool isitdigit; /* is expected output/input digit */ } KeyWord; typedef struct @@ -601,7 +601,7 @@ typedef enum * ---------- */ static KeyWord DCH_keywords[] = { -/* keyword, len, func, type, isdigit is in Index */ +/* keyword, len, func, type, isitdigit is in Index */ {"A.D.", 4, dch_date, DCH_A_D, FALSE}, /* A */ {"A.M.", 4, dch_time, DCH_A_M, FALSE}, {"AD", 2, dch_date, DCH_AD, FALSE}, @@ -682,7 +682,7 @@ static KeyWord DCH_keywords[] = { {NULL, 0, NULL, 0}}; /* ---------- - * KeyWords for NUMBER version (now, isdigit info is not needful here..) + * KeyWords for NUMBER version (now, isitdigit info is not needful here..) * ---------- */ static KeyWord NUM_keywords[] = { @@ -1233,9 +1233,9 @@ DCH_processor(FormatNode *node, char *inout, int flag) * Skip blank space in FROM_CHAR's input * ---------- */ - if (isspace(n->character) && IS_FX == 0) + if (isspace((unsigned char) n->character) && IS_FX == 0) { - while (*s != '\0' && isspace((int) *(s + 1))) + while (*s != '\0' && isspace((unsigned char) *(s + 1))) ++s; } } @@ -1552,12 +1552,12 @@ is_next_separator(FormatNode *n) if (n->type == NODE_TYPE_ACTION) { - if (n->key->isdigit) + if (n->key->isitdigit) return FALSE; return TRUE; } - else if (isdigit(n->character)) + else if (isdigit((unsigned char) n->character)) return FALSE; return TRUE; /* some non-digit input (separator) */ @@ -1952,7 +1952,7 @@ dch_date(int arg, char *inout, int suf, int flag, FormatNode *node) case DCH_month: sprintf(inout, "%*s", S_FM(suf) ? 0 : -9, months_full[tm->tm_mon - 1]); - *inout = tolower(*inout); + *inout = tolower((unsigned char) *inout); if (S_FM(suf)) return strlen(p_inout) - 1; else @@ -1969,7 +1969,7 @@ dch_date(int arg, char *inout, int suf, int flag, FormatNode *node) case DCH_mon: strcpy(inout, months[tm->tm_mon - 1]); - *inout = tolower(*inout); + *inout = tolower((unsigned char) *inout); return 2; case DCH_MM: @@ -2015,7 +2015,7 @@ dch_date(int arg, char *inout, int suf, int flag, FormatNode *node) case DCH_day: sprintf(inout, "%*s", S_FM(suf) ? 0 : -9, days[tm->tm_wday]); - *inout = tolower(*inout); + *inout = tolower((unsigned char) *inout); if (S_FM(suf)) return strlen(p_inout) - 1; else @@ -2032,7 +2032,7 @@ dch_date(int arg, char *inout, int suf, int flag, FormatNode *node) case DCH_dy: strcpy(inout, days[tm->tm_wday]); - *inout = tolower(*inout); + *inout = tolower((unsigned char) *inout); return 2; case DCH_DDD: diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c index 09a2da7158..3a5591ba5d 100644 --- a/src/backend/utils/adt/geo_ops.c +++ b/src/backend/utils/adt/geo_ops.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.54 2000/07/30 20:43:41 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.55 2000/12/03 20:45:35 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -119,7 +119,7 @@ single_decode(char *str, float8 *x, char **s) if (!PointerIsValid(str)) return FALSE; - while (isspace((int) *str)) + while (isspace((unsigned char) *str)) str++; *x = strtod(str, &cp); #ifdef GEODEBUG @@ -127,7 +127,7 @@ single_decode(char *str, float8 *x, char **s) #endif if (cp <= str) return FALSE; - while (isspace((int) *cp)) + while (isspace((unsigned char) *cp)) cp++; if (s != NULL) @@ -152,33 +152,33 @@ pair_decode(char *str, float8 *x, float8 *y, char **s) if (!PointerIsValid(str)) return FALSE; - while (isspace((int) *str)) + while (isspace((unsigned char) *str)) str++; if ((has_delim = (*str == LDELIM))) str++; - while (isspace((int) *str)) + while (isspace((unsigned char) *str)) str++; *x = strtod(str, &cp); if (cp <= str) return FALSE; - while (isspace((int) *cp)) + while (isspace((unsigned char) *cp)) cp++; if (*cp++ != DELIM) return FALSE; - while (isspace((int) *cp)) + while (isspace((unsigned char) *cp)) cp++; *y = strtod(cp, &str); if (str <= cp) return FALSE; - while (isspace((int) *str)) + while (isspace((unsigned char) *str)) str++; if (has_delim) { if (*str != RDELIM) return FALSE; str++; - while (isspace((int) *str)) + while (isspace((unsigned char) *str)) str++; } if (s != NULL) @@ -203,7 +203,7 @@ path_decode(int opentype, int npts, char *str, int *isopen, char **ss, Point *p) int i; s = str; - while (isspace((int) *s)) + while (isspace((unsigned char) *s)) s++; if ((*isopen = (*s == LDELIM_EP))) { @@ -212,14 +212,14 @@ path_decode(int opentype, int npts, char *str, int *isopen, char **ss, Point *p) return FALSE; depth++; s++; - while (isspace((int) *s)) + while (isspace((unsigned char) *s)) s++; } else if (*s == LDELIM) { cp = (s + 1); - while (isspace((int) *cp)) + while (isspace((unsigned char) *cp)) cp++; if (*cp == LDELIM) { @@ -255,7 +255,7 @@ path_decode(int opentype, int npts, char *str, int *isopen, char **ss, Point *p) { depth--; s++; - while (isspace((int) *s)) + while (isspace((unsigned char) *s)) s++; } else @@ -1216,7 +1216,7 @@ path_in(PG_FUNCTION_ARGS) elog(ERROR, "Bad path external representation '%s'", str); s = str; - while (isspace((int) *s)) + while (isspace((unsigned char) *s)) s++; /* skip single leading paren */ @@ -3752,13 +3752,13 @@ circle_in(PG_FUNCTION_ARGS) circle = (CIRCLE *) palloc(sizeof(CIRCLE)); s = str; - while (isspace((int) *s)) + while (isspace((unsigned char) *s)) s++; if ((*s == LDELIM_C) || (*s == LDELIM)) { depth++; cp = (s + 1); - while (isspace((int) *cp)) + while (isspace((unsigned char) *cp)) cp++; if (*cp == LDELIM) s = cp; @@ -3769,7 +3769,7 @@ circle_in(PG_FUNCTION_ARGS) if (*s == DELIM) s++; - while (isspace((int) *s)) + while (isspace((unsigned char) *s)) s++; if ((!single_decode(s, &circle->radius, &s)) || (circle->radius < 0)) @@ -3782,7 +3782,7 @@ circle_in(PG_FUNCTION_ARGS) { depth--; s++; - while (isspace((int) *s)) + while (isspace((unsigned char) *s)) s++; } else diff --git a/src/backend/utils/adt/inet_net_pton.c b/src/backend/utils/adt/inet_net_pton.c index a8a03032a4..3784bf04be 100644 --- a/src/backend/utils/adt/inet_net_pton.c +++ b/src/backend/utils/adt/inet_net_pton.c @@ -16,7 +16,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$Id: inet_net_pton.c,v 1.11 2000/06/14 18:17:44 petere Exp $"; +static const char rcsid[] = "$Id: inet_net_pton.c,v 1.12 2000/12/03 20:45:36 tgl Exp $"; #endif @@ -105,7 +105,7 @@ inet_cidr_pton_ipv4(const char *src, u_char *dst, size_t size) ch = *src++; if (ch == '0' && (src[0] == 'x' || src[0] == 'X') - && isascii((int) src[1]) && isxdigit((int) src[1])) + && isxdigit((unsigned char) src[1])) { /* Hexadecimal: Eat nybble string. */ if (size <= 0) @@ -113,10 +113,10 @@ inet_cidr_pton_ipv4(const char *src, u_char *dst, size_t size) dirty = 0; tmp = 0; src++; /* skip x or X. */ - while ((ch = *src++) != '\0' && isascii(ch) && isxdigit(ch)) + while ((ch = *src++) != '\0' && isxdigit((unsigned char) ch)) { - if (isupper(ch)) - ch = tolower(ch); + if (isupper((unsigned char) ch)) + ch = tolower((unsigned char) ch); n = strchr(xdigits, ch) - xdigits; assert(n >= 0 && n <= 15); if (dirty == 0) @@ -138,7 +138,7 @@ inet_cidr_pton_ipv4(const char *src, u_char *dst, size_t size) *dst++ = (u_char) (tmp << 4); } } - else if (isascii(ch) && isdigit(ch)) + else if (isdigit((unsigned char) ch)) { /* Decimal: eat dotted digit string. */ for (;;) @@ -153,7 +153,7 @@ inet_cidr_pton_ipv4(const char *src, u_char *dst, size_t size) if (tmp > 255) goto enoent; } while ((ch = *src++) != '\0' && - isascii(ch) && isdigit(ch)); + isdigit((unsigned char) ch)); if (size-- <= 0) goto emsgsize; *dst++ = (u_char) tmp; @@ -162,7 +162,7 @@ inet_cidr_pton_ipv4(const char *src, u_char *dst, size_t size) if (ch != '.') goto enoent; ch = *src++; - if (!isascii(ch) || !isdigit(ch)) + if (!isdigit((unsigned char) ch)) goto enoent; } } @@ -170,7 +170,7 @@ inet_cidr_pton_ipv4(const char *src, u_char *dst, size_t size) goto enoent; bits = -1; - if (ch == '/' && isascii((int) src[0]) && isdigit((int) src[0]) && dst > odst) + if (ch == '/' && isdigit((unsigned char) src[0]) && dst > odst) { /* CIDR width specifier. Nothing can follow it. */ ch = *src++; /* Skip over the /. */ @@ -181,8 +181,7 @@ inet_cidr_pton_ipv4(const char *src, u_char *dst, size_t size) assert(n >= 0 && n <= 9); bits *= 10; bits += n; - } while ((ch = *src++) != '\0' && - isascii(ch) && isdigit(ch)); + } while ((ch = *src++) != '\0' && isdigit((unsigned char) ch)); if (ch != '\0') goto enoent; if (bits > 32) @@ -261,7 +260,7 @@ inet_net_pton_ipv4(const char *src, u_char *dst) size_t size = 4; /* Get the mantissa. */ - while (ch = *src++, (isascii(ch) && isdigit(ch))) + while (ch = *src++, isdigit((unsigned char) ch)) { tmp = 0; do @@ -272,7 +271,7 @@ inet_net_pton_ipv4(const char *src, u_char *dst) tmp += n; if (tmp > 255) goto enoent; - } while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch)); + } while ((ch = *src++) != '\0' && isdigit((unsigned char) ch)); if (size-- == 0) goto emsgsize; *dst++ = (u_char) tmp; @@ -284,7 +283,7 @@ inet_net_pton_ipv4(const char *src, u_char *dst) /* Get the prefix length if any. */ bits = -1; - if (ch == '/' && isascii((int) src[0]) && isdigit((int) src[0]) && dst > odst) + if (ch == '/' && isdigit((unsigned char) src[0]) && dst > odst) { /* CIDR width specifier. Nothing can follow it. */ ch = *src++; /* Skip over the /. */ @@ -295,7 +294,7 @@ inet_net_pton_ipv4(const char *src, u_char *dst) assert(n >= 0 && n <= 9); bits *= 10; bits += n; - } while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch)); + } while ((ch = *src++) != '\0' && isdigit((unsigned char) ch)); if (ch != '\0') goto enoent; if (bits > 32) diff --git a/src/backend/utils/adt/int.c b/src/backend/utils/adt/int.c index 4f786784eb..c4677a8934 100644 --- a/src/backend/utils/adt/int.c +++ b/src/backend/utils/adt/int.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.43 2000/10/24 20:14:35 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.44 2000/12/03 20:45:36 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -85,12 +85,12 @@ int2vectorin(PG_FUNCTION_ARGS) { if (sscanf(intString, "%hd", &result[slot]) != 1) break; - while (*intString && isspace((int) *intString)) + while (*intString && isspace((unsigned char) *intString)) intString++; - while (*intString && !isspace((int) *intString)) + while (*intString && !isspace((unsigned char) *intString)) intString++; } - while (*intString && isspace((int) *intString)) + while (*intString && isspace((unsigned char) *intString)) intString++; if (*intString) elog(ERROR, "int2vector value has too many values"); diff --git a/src/backend/utils/adt/int8.c b/src/backend/utils/adt/int8.c index bc4b64b9ec..eb49363fae 100644 --- a/src/backend/utils/adt/int8.c +++ b/src/backend/utils/adt/int8.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/int8.c,v 1.25 2000/10/24 20:14:35 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/int8.c,v 1.26 2000/12/03 20:45:36 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -67,15 +67,15 @@ int8in(PG_FUNCTION_ARGS) * Do our own scan, rather than relying on sscanf which might be * broken for long long. */ - while (*ptr && isspace((int) *ptr)) /* skip leading spaces */ + while (*ptr && isspace((unsigned char) *ptr)) /* skip leading spaces */ ptr++; if (*ptr == '-') /* handle sign */ sign = -1, ptr++; else if (*ptr == '+') ptr++; - if (!isdigit((int) *ptr)) /* require at least one digit */ + if (!isdigit((unsigned char) *ptr)) /* require at least one digit */ elog(ERROR, "Bad int8 external representation \"%s\"", str); - while (*ptr && isdigit((int) *ptr)) /* process digits */ + while (*ptr && isdigit((unsigned char) *ptr)) /* process digits */ { int64 newtmp = tmp * 10 + (*ptr++ - '0'); diff --git a/src/backend/utils/adt/nabstime.c b/src/backend/utils/adt/nabstime.c index a7ee883f7b..f5d238bda7 100644 --- a/src/backend/utils/adt/nabstime.c +++ b/src/backend/utils/adt/nabstime.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.75 2000/10/29 13:17:34 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.76 2000/12/03 20:45:36 tgl Exp $ * * NOTES * @@ -1655,7 +1655,7 @@ dummyfunc() for (;;) { c = *p; - if (isdigit(c)) + if (isdigit((unsigned char) c)) { *quantity = *quantity * 10 + (c - '0'); p++; diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c index a867e7f348..6bb7ba379d 100644 --- a/src/backend/utils/adt/numeric.c +++ b/src/backend/utils/adt/numeric.c @@ -5,7 +5,7 @@ * * 1998 Jan Wieck * - * $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.34 2000/08/01 18:29:35 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.35 2000/12/03 20:45:36 tgl Exp $ * * ---------- */ @@ -2339,7 +2339,7 @@ set_var_from_str(char *str, NumericVar *dest) while (*cp) { - if (!isspace((int) *cp)) + if (!isspace((unsigned char) *cp)) break; cp++; } @@ -2368,12 +2368,12 @@ set_var_from_str(char *str, NumericVar *dest) cp++; } - if (!isdigit((int) *cp)) + if (!isdigit((unsigned char) *cp)) elog(ERROR, "Bad numeric input format '%s'", str); while (*cp) { - if (isdigit((int) *cp)) + if (isdigit((unsigned char) *cp)) { dest->digits[i++] = *cp++ - '0'; if (!have_dp) @@ -2416,7 +2416,7 @@ set_var_from_str(char *str, NumericVar *dest) /* Should be nothing left but spaces */ while (*cp) { - if (!isspace((int) *cp)) + if (!isspace((unsigned char) *cp)) elog(ERROR, "Bad numeric input format '%s'", str); cp++; } diff --git a/src/backend/utils/adt/oid.c b/src/backend/utils/adt/oid.c index f5df76bf38..daf66621fa 100644 --- a/src/backend/utils/adt/oid.c +++ b/src/backend/utils/adt/oid.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.40 2000/11/21 04:27:39 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.41 2000/12/03 20:45:36 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -42,12 +42,12 @@ oidvectorin(PG_FUNCTION_ARGS) { if (sscanf(oidString, "%u", &result[slot]) != 1) break; - while (*oidString && isspace((int) *oidString)) + while (*oidString && isspace((unsigned char) *oidString)) oidString++; - while (*oidString && isdigit((int) *oidString)) + while (*oidString && isdigit((unsigned char) *oidString)) oidString++; } - while (*oidString && isspace((int) *oidString)) + while (*oidString && isspace((unsigned char) *oidString)) oidString++; if (*oidString) elog(ERROR, "oidvector value has too many values"); diff --git a/src/backend/utils/adt/oracle_compat.c b/src/backend/utils/adt/oracle_compat.c index 8b483ee5c6..e851102620 100644 --- a/src/backend/utils/adt/oracle_compat.c +++ b/src/backend/utils/adt/oracle_compat.c @@ -1,7 +1,7 @@ /* * Edmund Mergl <E.Mergl@bawue.de> * - * $Header: /cvsroot/pgsql/src/backend/utils/adt/oracle_compat.c,v 1.28 2000/09/25 12:58:47 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/oracle_compat.c,v 1.29 2000/12/03 20:45:36 tgl Exp $ * */ @@ -118,7 +118,7 @@ initcap(PG_FUNCTION_ARGS) while (m-- > 0) { - if (isspace(ptr[-1])) + if (isspace((unsigned char) ptr[-1])) *ptr = toupper((unsigned char) *ptr); else *ptr = tolower((unsigned char) *ptr); diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 8d4c4d080a..078f5bcdb6 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -15,7 +15,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.83 2000/11/25 20:33:53 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.84 2000/12/03 20:45:36 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1421,7 +1421,7 @@ like_fixed_prefix(char *patt, bool case_insensitive, * XXX I suspect isalpha() is not an adequately locale-sensitive * test for characters that can vary under case folding? */ - if (case_insensitive && isalpha((int) patt[pos])) + if (case_insensitive && isalpha((unsigned char) patt[pos])) break; /* * NOTE: this code used to think that %% meant a literal %, but @@ -1504,7 +1504,7 @@ regex_fixed_prefix(char *patt, bool case_insensitive, patt[pos] == '(' || patt[pos] == '[' || patt[pos] == '$' || - (case_insensitive && isalpha((int) patt[pos]))) + (case_insensitive && isalpha((unsigned char) patt[pos]))) break; /* * Check for quantifiers. Except for +, this means the preceding diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c index 4478dc95ef..6930205b15 100644 --- a/src/backend/utils/adt/timestamp.c +++ b/src/backend/utils/adt/timestamp.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.38 2000/11/11 19:55:19 thomas Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.39 2000/12/03 20:45:36 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1597,7 +1597,7 @@ timestamp_trunc(PG_FUNCTION_ARGS) up = VARDATA(units); lp = lowunits; for (i = 0; i < (VARSIZE(units) - VARHDRSZ); i++) - *lp++ = tolower(*up++); + *lp++ = tolower((unsigned char) *up++); *lp = '\0'; type = DecodeUnits(0, lowunits, &val); @@ -1730,7 +1730,7 @@ interval_trunc(PG_FUNCTION_ARGS) up = VARDATA(units); lp = lowunits; for (i = 0; i < (VARSIZE(units) - VARHDRSZ); i++) - *lp++ = tolower(*up++); + *lp++ = tolower((unsigned char) *up++); *lp = '\0'; type = DecodeUnits(0, lowunits, &val); @@ -1921,7 +1921,7 @@ timestamp_part(PG_FUNCTION_ARGS) up = VARDATA(units); lp = lowunits; for (i = 0; i < (VARSIZE(units) - VARHDRSZ); i++) - *lp++ = tolower(*up++); + *lp++ = tolower((unsigned char) *up++); *lp = '\0'; type = DecodeUnits(0, lowunits, &val); @@ -2079,7 +2079,7 @@ interval_part(PG_FUNCTION_ARGS) up = VARDATA(units); lp = lowunits; for (i = 0; i < (VARSIZE(units) - VARHDRSZ); i++) - *lp++ = tolower(*up++); + *lp++ = tolower((unsigned char) *up++); *lp = '\0'; type = DecodeUnits(0, lowunits, &val); @@ -2214,7 +2214,7 @@ timestamp_zone(PG_FUNCTION_ARGS) up = VARDATA(zone); lp = lowzone; for (i = 0; i < (VARSIZE(zone) - VARHDRSZ); i++) - *lp++ = tolower(*up++); + *lp++ = tolower((unsigned char) *up++); *lp = '\0'; type = DecodeSpecial(0, lowzone, &val); @@ -2237,7 +2237,7 @@ timestamp_zone(PG_FUNCTION_ARGS) up = upzone; lp = lowzone; for (i = 0; *lp != '\0'; i++) - *up++ = toupper(*lp++); + *up++ = toupper((unsigned char) *lp++); *up = '\0'; tzn = upzone; diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index b075bf9111..89ca5c4ecd 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.65 2000/07/29 03:26:42 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.66 2000/12/03 20:45:36 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -56,9 +56,9 @@ byteain(PG_FUNCTION_ARGS) { if (*tp == '\\') tp++; - else if (!isdigit((int) *tp++) || - !isdigit((int) *tp++) || - !isdigit((int) *tp++)) + else if (!isdigit((unsigned char) *tp++) || + !isdigit((unsigned char) *tp++) || + !isdigit((unsigned char) *tp++)) elog(ERROR, "Bad input string for type bytea"); } } @@ -111,7 +111,7 @@ byteaout(PG_FUNCTION_ARGS) { if (*vp == '\\') len += 2; - else if (isascii((int) *vp) && isprint((int) *vp)) + else if (isprint((unsigned char) *vp)) len++; else len += 4; @@ -125,7 +125,7 @@ byteaout(PG_FUNCTION_ARGS) *rp++ = '\\'; *rp++ = '\\'; } - else if (isascii((int) *vp) && isprint((int) *vp)) + else if (isprint((unsigned char) *vp)) *rp++ = *vp; else { |