Re: [HACKERS] Re: your mail

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: t-ishii(at)sra(dot)co(dot)jp
Cc: Angelos Karageorgiou <angelos(at)incredible(dot)com>, pgsql-hackers(at)hub(dot)org
Subject: Re: [HACKERS] Re: your mail
Date: 1999-05-10 00:43:58
Message-ID: 199905100043.UAA04227@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I think we decided against this, right?

> >Did we reject this 'unsigned' patch, folks? I seem to remember someone
> >objecting to it.
> [snip]
> >> ***************
> >> *** 1862,1868 ****
> >> #ifdef MULTIBYTE
> >> return (c >= 0 && c <= UCHAR_MAX && isdigit(c));
> >> #else
> >> ! return (isdigit(c));
> >> #endif
> >> }
> >>
> >> --- 1862,1868 ----
> >> #ifdef MULTIBYTE
> >> return (c >= 0 && c <= UCHAR_MAX && isdigit(c));
> >> #else
> >> ! return (isdigit((unsigned char)c));
> >> #endif
> >> }
>
> According to the ANSI/C standard the argument to isdigit (or some
> other friends) must have the value of either an unsigned char or
> *EOF*. That's why the argument is typed to int, I guess. This patch
> seems to break the rule?
>
> BTW, I would like to propose yet another patches for the problem. This
> seems to work on FreeBSD and Linux. Angelos, can you test it on your
> platform (is it a BSD/OS?)?
> --
> Tatsuo Ishii
>
> *** regcomp.c~ Tue Sep 1 13:31:25 1998
> --- regcomp.c Thu Mar 11 16:51:28 1999
> ***************
> *** 95,101 ****
> static void p_b_eclass(struct parse * p, cset *cs);
> static pg_wchar p_b_symbol(struct parse * p);
> static char p_b_coll_elem(struct parse * p, int endc);
> ! static char othercase(int ch);
> static void bothcases(struct parse * p, int ch);
> static void ordinary(struct parse * p, int ch);
> static void nonnewline(struct parse * p);
> --- 95,101 ----
> static void p_b_eclass(struct parse * p, cset *cs);
> static pg_wchar p_b_symbol(struct parse * p);
> static char p_b_coll_elem(struct parse * p, int endc);
> ! static unsigned char othercase(int ch);
> static void bothcases(struct parse * p, int ch);
> static void ordinary(struct parse * p, int ch);
> static void nonnewline(struct parse * p);
> ***************
> *** 1032,1049 ****
> - othercase - return the case counterpart of an alphabetic
> == static char othercase(int ch);
> */
> ! static char /* if no counterpart, return ch */
> othercase(ch)
> int ch;
> {
> assert(pg_isalpha(ch));
> if (pg_isupper(ch))
> ! return tolower(ch);
> else if (pg_islower(ch))
> ! return toupper(ch);
> else
> /* peculiar, but could happen */
> ! return ch;
> }
>
> /*
> --- 1032,1049 ----
> - othercase - return the case counterpart of an alphabetic
> == static char othercase(int ch);
> */
> ! static unsigned char /* if no counterpart, return ch */
> othercase(ch)
> int ch;
> {
> assert(pg_isalpha(ch));
> if (pg_isupper(ch))
> ! return (unsigned char)tolower(ch);
> else if (pg_islower(ch))
> ! return (unsigned char)toupper(ch);
> else
> /* peculiar, but could happen */
> ! return (unsigned char)ch;
> }
>
> /*
>

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-05-10 00:51:25 Re: [HACKERS] Associative Operators? (Was: Re: [NOVICE] Out of frying pan, into fire)
Previous Message Ryan Bradetich 1999-05-10 00:42:35 Re: [HACKERS] Sequences....