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:
@ -51,7 +51,7 @@ typedef struct StatEntry
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int4 weight;
|
||||
int32 weight;
|
||||
|
||||
uint32 maxdepth;
|
||||
|
||||
@ -221,7 +221,7 @@ Datum
|
||||
tsvector_length(PG_FUNCTION_ARGS)
|
||||
{
|
||||
TSVector in = PG_GETARG_TSVECTOR(0);
|
||||
int4 ret = in->size;
|
||||
int32 ret = in->size;
|
||||
|
||||
PG_FREE_IF_COPY(in, 0);
|
||||
PG_RETURN_INT32(ret);
|
||||
@ -293,10 +293,10 @@ tsvector_setweight(PG_FUNCTION_ARGS)
|
||||
* Add positions from src to dest after offsetting them by maxpos.
|
||||
* Return the number added (might be less than expected due to overflow)
|
||||
*/
|
||||
static int4
|
||||
static int32
|
||||
add_pos(TSVector src, WordEntry *srcptr,
|
||||
TSVector dest, WordEntry *destptr,
|
||||
int4 maxpos)
|
||||
int32 maxpos)
|
||||
{
|
||||
uint16 *clen = &_POSVECPTR(dest, destptr)->npos;
|
||||
int i;
|
||||
@ -552,7 +552,7 @@ tsvector_concat(PG_FUNCTION_ARGS)
|
||||
*
|
||||
* if isPrefix = true then it returns zero value iff b has prefix a
|
||||
*/
|
||||
int4
|
||||
int32
|
||||
tsCompareString(char *a, int lena, char *b, int lenb, bool prefix)
|
||||
{
|
||||
int cmp;
|
||||
|
Reference in New Issue
Block a user