From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-hackers(at)postgreSQL(dot)org |
Subject: | Marginal cleanup in regex code: remove typedef "celt" |
Date: | 2016-08-18 17:28:11 |
Message-ID: | 13851.1471541291@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
The regex library used to have a notion of a "collating element"
that was distinct from a "character", but Henry Spencer never
actually implemented support for multi-character collating elements,
and the Tcl crew ripped out most of the stubs for it 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. I noticed however that the
NOCELT macro is no longer used anywhere, which means we could remove
it as well as the separate typedef, and just deal in chrs. This
simplifies matters and also removes a trap for the unwary, in that
celt is signed while chr is not, 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.
The attached patch removes celt and NOCELT, and also removes unnecessary
casts to "chr" (some of them were already unnecessary, probably as a
result of the earlier celt-support-removal changes).
Comments? Anyone feel like actually reviewing this, or shall I just
push it?
regards, tom lane
Attachment | Content-Type | Size |
---|---|---|
celt-is-dead-so-kill-it.patch | text/x-diff | 9.5 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Geoghegan | 2016-08-18 17:40:28 | Re: amcheck (B-Tree integrity checking tool) |
Previous Message | Heikki Linnakangas | 2016-08-18 16:51:49 | Re: Password identifiers, protocol aging and SCRAM protocol |