mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Replace int2/int4 in C code with int16/int32
The latter was already the dominant use, and it's preferable because in C the convention is that intXX means XX bits. Therefore, allowing mixed use of int2, int4, int8, int16, int32 is obviously confusing. Remove the typedefs for int2 and int4 for now. They don't seem to be widely used outside of the PostgreSQL source tree, and the few uses can probably be cleaned up by the time this ships.
This commit is contained in:
@ -30,7 +30,7 @@ typedef struct
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int4 val;
|
||||
int32 val;
|
||||
uint16 len;
|
||||
uint8 flag;
|
||||
char name[1];
|
||||
@ -89,9 +89,9 @@ typedef struct
|
||||
*/
|
||||
typedef struct ITEM
|
||||
{
|
||||
int2 type;
|
||||
int2 left;
|
||||
int4 val;
|
||||
int16 type;
|
||||
int16 left;
|
||||
int32 val;
|
||||
uint8 flag;
|
||||
/* user-friendly value */
|
||||
uint8 length;
|
||||
@ -105,11 +105,11 @@ typedef struct ITEM
|
||||
typedef struct
|
||||
{
|
||||
int32 vl_len_; /* varlena header (do not touch directly!) */
|
||||
int4 size;
|
||||
int32 size;
|
||||
char data[1];
|
||||
} ltxtquery;
|
||||
|
||||
#define HDRSIZEQT MAXALIGN(VARHDRSZ + sizeof(int4))
|
||||
#define HDRSIZEQT MAXALIGN(VARHDRSZ + sizeof(int32))
|
||||
#define COMPUTESIZE(size,lenofoperand) ( HDRSIZEQT + (size) * sizeof(ITEM) + (lenofoperand) )
|
||||
#define GETQUERY(x) (ITEM*)( (char*)(x)+HDRSIZEQT )
|
||||
#define GETOPERAND(x) ( (char*)GETQUERY(x) + ((ltxtquery*)x)->size * sizeof(ITEM) )
|
||||
@ -173,7 +173,7 @@ int ltree_strncasecmp(const char *a, const char *b, size_t s);
|
||||
|
||||
#define BITBYTE 8
|
||||
#define SIGLENINT 2
|
||||
#define SIGLEN ( sizeof(int4)*SIGLENINT )
|
||||
#define SIGLEN ( sizeof(int32)*SIGLENINT )
|
||||
#define SIGLENBIT (SIGLEN*BITBYTE)
|
||||
typedef unsigned char BITVEC[SIGLEN];
|
||||
typedef unsigned char *BITVECP;
|
||||
@ -229,7 +229,7 @@ typedef struct
|
||||
/* GiST support for ltree[] */
|
||||
|
||||
#define ASIGLENINT (7)
|
||||
#define ASIGLEN (sizeof(int4)*ASIGLENINT)
|
||||
#define ASIGLEN (sizeof(int32)*ASIGLENINT)
|
||||
#define ASIGLENBIT (ASIGLEN*BITBYTE)
|
||||
typedef unsigned char ABITVEC[ASIGLEN];
|
||||
|
||||
|
Reference in New Issue
Block a user