mirror of
https://github.com/postgres/postgres.git
synced 2025-11-24 00:23:06 +03:00
I have added these macros to c.h:
#define HIGHBIT (0x80)
#define IS_HIGHBIT_SET(ch) ((unsigned char)(ch) & HIGHBIT)
and removed CSIGNBIT and mapped it uses to HIGHBIT. I have also added
uses for IS_HIGHBIT_SET where appropriate. This change is
purely for code clarity.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* PostgreSQL type definitions for the INET and CIDR types.
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/network.c,v 1.56 2005/10/17 16:24:19 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/network.c,v 1.57 2005/12/25 02:14:17 momjian Exp $
|
||||
*
|
||||
* Jon Postel RIP 16 Oct 1998
|
||||
*/
|
||||
@@ -904,16 +904,16 @@ bitncmp(void *l, void *r, int n)
|
||||
rb = ((const u_char *) r)[b];
|
||||
for (b = n % 8; b > 0; b--)
|
||||
{
|
||||
if ((lb & 0x80) != (rb & 0x80))
|
||||
if (IS_HIGHBIT_SET(lb) != IS_HIGHBIT_SET(rb))
|
||||
{
|
||||
if (lb & 0x80)
|
||||
return (1);
|
||||
return (-1);
|
||||
if (IS_HIGHBIT_SET(lb))
|
||||
return 1;
|
||||
return -1;
|
||||
}
|
||||
lb <<= 1;
|
||||
rb <<= 1;
|
||||
}
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
||||
Reference in New Issue
Block a user