pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Remove typedef celt from the regex library, along with macro NOC
Date: Fri, 19 Aug 2016 16:51:10 +0000
Message-ID: <E1ban0g-0007ga-Vj@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Remove typedef celt from the regex library, along with macro NOCELT.

The regex library used to have a notion of a "collating element" that was
distinct from a "character", but Henry Spencer never actually implemented
his planned support for multi-character collating elements, and the Tcl
crew ripped out most of the stubs for that years ago.  The only thing left
that distinguished the "celt" typedef from the "chr" typedef was that
"celt" was supposed to also be able to hold the not-a-character "NOCELT"
value.  However, NOCELT was not used anywhere after the MCCE stub removal
changes, which means there's no need for celt to be different from chr.
Removing the separate typedef simplifies matters and also removes a trap
for the unwary, in that celt is signed while chr may not be, so comparisons
could mean different things.  There's no bug there today because we
restrict CHR_MAX to be less than INT_MAX, but I think there may have been
such bugs before we did that, and there could be again if anyone ever
decides to fool with the range of chr.

This patch also removes assorted unnecessary casts to "chr" of values
that are already chrs.  Many of these seem to be leftover from days when
the code was compatible with pre-ANSI C.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/6eefd2422ef232aec2fe12465d9ec4018c63814d

Modified Files
--------------
src/backend/regex/regc_cvec.c   |  6 +++---
src/backend/regex/regc_lex.c    | 12 +++++-------
src/backend/regex/regc_locale.c | 37 ++++++++++++++++++-------------------
src/backend/regex/regcomp.c     | 12 ++++++------
src/include/regex/regcustom.h   |  4 +---
5 files changed, 33 insertions(+), 38 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1ban0g-0007ga-Vj@gemulon.postgresql.org>
Permalink:  ../E1ban0g-0007ga-Vj@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ban0g-0007ga-Vj@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Remove typedef celt from the regex library, along with macro NOC
  In-Reply-To: <E1ban0g-0007ga-Vj@gemulon.postgresql.org>
  References: <E1ban0g-0007ga-Vj@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox