1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +03:00

More uses of IS_HIGHBIT_SET() macro.

This commit is contained in:
Bruce Momjian
2005-12-26 19:30:45 +00:00
parent 6840cccd11
commit a2384d008a
6 changed files with 34 additions and 46 deletions

View File

@@ -6,7 +6,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/mb/conv.c,v 1.57 2005/12/25 02:14:17 momjian Exp $
* $PostgreSQL: pgsql/src/backend/utils/mb/conv.c,v 1.58 2005/12/26 19:30:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -95,7 +95,7 @@ mic2gb18030(unsigned char *mic, unsigned char *p, int len)
{
len -= pg_mic_mblen(mic++);
if (c1 <= 0x7f) /* ASCII */
if (!IS_HIGHBIT_SET(c1)) /* ASCII */
*p++ = c1;
else if (c1 >= 0x81 && c1 <= 0xfe)
{
@@ -141,10 +141,8 @@ latin2mic(unsigned char *l, unsigned char *p, int len, int lc)
while (len-- > 0 && (c1 = *l++))
{
if (c1 > 0x7f)
{ /* Latin? */
*p++ = lc;
}
if (IS_HIGHBIT_SET(c1))
*p++ = lc; /* Latin? */
*p++ = c1;
}
*p = '\0';
@@ -164,7 +162,7 @@ mic2latin(unsigned char *mic, unsigned char *p, int len, int lc)
if (c1 == lc)
*p++ = *mic++;
else if (c1 > 0x7f)
else if (IS_HIGHBIT_SET(c1))
{
mic--;
pg_print_bogus_char(&mic, &p);
@@ -201,7 +199,7 @@ pg_mic2ascii(unsigned char *mic, unsigned char *p, int len)
while (len-- > 0 && (c1 = *mic))
{
if (c1 > 0x7f)
if (IS_HIGHBIT_SET(c1))
pg_print_bogus_char(&mic, &p);
else
{ /* should be ASCII */