]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Remove bits* typedefs.
authorNathan Bossart <nathan@postgresql.org>
Mon, 30 Mar 2026 21:12:08 +0000 (16:12 -0500)
committerNathan Bossart <nathan@postgresql.org>
Mon, 30 Mar 2026 21:12:08 +0000 (16:12 -0500)
In addition to removing the bits8, bits16, and bits32 typedefs,
this commit replaces all uses with uint8, uint16, or uint32.  bits*
provided little benefit beyond establishing the intent of the
variable, and they were inconsistently used for that purpose.
Third-party code should instead use the corresponding uint*
typedef.

Suggested-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Discussion: https://postgr.es/m/absbX33E4eaA0Ity%40nathan

73 files changed:
contrib/dblink/dblink.c
contrib/pageinspect/gistfuncs.c
contrib/pageinspect/heapfuncs.c
contrib/postgres_fdw/deparse.c
doc/src/sgml/fdwhandler.sgml
src/backend/access/brin/brin_tuple.c
src/backend/access/common/heaptuple.c
src/backend/access/common/indextuple.c
src/backend/access/common/reloptions.c
src/backend/access/spgist/spgutils.c
src/backend/catalog/index.c
src/backend/catalog/indexing.c
src/backend/catalog/objectaddress.c
src/backend/commands/indexcmds.c
src/backend/commands/subscriptioncmds.c
src/backend/commands/tablecmds.c
src/backend/commands/vacuum.c
src/backend/executor/execExprInterp.c
src/backend/executor/execIndexing.c
src/backend/executor/execReplication.c
src/backend/executor/execTuples.c
src/backend/executor/nodeModifyTable.c
src/backend/foreign/foreign.c
src/backend/nodes/gen_node_support.pl
src/backend/postmaster/bgworker.c
src/backend/postmaster/syslogger.c
src/backend/utils/activity/pgstat_backend.c
src/backend/utils/adt/array_userfuncs.c
src/backend/utils/adt/arrayfuncs.c
src/backend/utils/adt/format_type.c
src/backend/utils/adt/misc.c
src/backend/utils/adt/regproc.c
src/backend/utils/adt/ruleutils.c
src/backend/utils/adt/varbit.c
src/backend/utils/adt/varlena.c
src/backend/utils/fmgr/funcapi.c
src/backend/utils/init/postinit.c
src/bin/pg_basebackup/pg_createsubscriber.c
src/bin/psql/tab-complete.in.c
src/bin/scripts/vacuumdb.c
src/bin/scripts/vacuuming.h
src/include/access/htup_details.h
src/include/access/itup.h
src/include/access/reloptions.h
src/include/access/tupmacs.h
src/include/c.h
src/include/catalog/index.h
src/include/commands/cluster.h
src/include/commands/vacuum.h
src/include/common/jsonapi.h
src/include/executor/executor.h
src/include/executor/instrument_node.h
src/include/foreign/foreign.h
src/include/funcapi.h
src/include/miscadmin.h
src/include/nodes/parsenodes.h
src/include/port/pg_bitutils.h
src/include/postmaster/syslogger.h
src/include/replication/reorderbuffer.h
src/include/replication/walsender_private.h
src/include/utils/array.h
src/include/utils/arrayaccess.h
src/include/utils/builtins.h
src/include/utils/pgstat_internal.h
src/include/utils/regproc.h
src/include/utils/ruleutils.h
src/include/utils/varbit.h
src/pl/plpython/plpy_typeio.c
src/port/pg_bitutils.c
src/port/pg_popcount_aarch64.c
src/port/pg_popcount_x86.c
src/test/modules/worker_spi/worker_spi.c
src/tools/pgindent/typedefs.list

index ac6127ec1b5d4d13019cc14bd6c5398a7bd1d243..134b52085b79f93f87eaef9a85c080f3846fa0b2 100644 (file)
@@ -2077,7 +2077,7 @@ get_text_array_contents(ArrayType *array, int *numitems)
        uint8           typalignby;
        char      **values;
        char       *ptr;
-       bits8      *bitmap;
+       uint8      *bitmap;
        int                     bitmask;
        int                     i;
 
index e56c7d8a601f0486456f146d1d4c8737d0fd526e..89678d377c7bfc12e55494bbd7bbbfb039ab357d 100644 (file)
@@ -203,7 +203,7 @@ gist_page_items(PG_FUNCTION_ARGS)
        TupleDesc       tupdesc;
        Page            page;
        uint16          flagbits;
-       bits16          printflags = 0;
+       uint16          printflags = 0;
        OffsetNumber offset;
        OffsetNumber maxoff = InvalidOffsetNumber;
        char       *index_columns;
index 3a61954e1d9a98d545ccfcd9552aa240f4919d41..4f0f3bd53e743b2a06cb6c3f2276cf4cbf7905b7 100644 (file)
@@ -56,11 +56,11 @@ HeapTupleHeaderGetOidOld(const HeapTupleHeaderData *tup)
 /*
  * bits_to_text
  *
- * Converts a bits8-array of 'len' bits to a human-readable
+ * Converts a uint8-array of 'len' bits to a human-readable
  * c-string representation.
  */
 static char *
-bits_to_text(bits8 *bits, int len)
+bits_to_text(uint8 *bits, int len)
 {
        int                     i;
        char       *str;
@@ -79,13 +79,13 @@ bits_to_text(bits8 *bits, int len)
 /*
  * text_to_bits
  *
- * Converts a c-string representation of bits into a bits8-array. This is
+ * Converts a c-string representation of bits into a uint8-array. This is
  * the reverse operation of previous routine.
  */
-static bits8 *
+static uint8 *
 text_to_bits(char *str, int len)
 {
-       bits8      *bits;
+       uint8      *bits;
        int                     off = 0;
        char            byte = 0;
 
@@ -305,7 +305,7 @@ heap_page_items(PG_FUNCTION_ARGS)
 static Datum
 tuple_data_split_internal(Oid relid, char *tupdata,
                                                  uint16 tupdata_len, uint16 t_infomask,
-                                                 uint16 t_infomask2, bits8 *t_bits,
+                                                 uint16 t_infomask2, uint8 *t_bits,
                                                  bool do_detoast)
 {
        ArrayBuildState *raw_attrs;
@@ -434,7 +434,7 @@ tuple_data_split(PG_FUNCTION_ARGS)
        uint16          t_infomask2;
        char       *t_bits_str;
        bool            do_detoast = false;
-       bits8      *t_bits = NULL;
+       uint8      *t_bits = NULL;
        Datum           res;
 
        relid = PG_GETARG_OID(0);
@@ -456,7 +456,7 @@ tuple_data_split(PG_FUNCTION_ARGS)
                PG_RETURN_NULL();
 
        /*
-        * Convert t_bits string back to the bits8 array as represented in the
+        * Convert t_bits string back to the uint8 array as represented in the
         * tuple header.
         */
        if (t_infomask & HEAP_HASNULL)
index ebe2c3a596a2b86f6864b75ade832cdea068f88c..c159ecd1558350fa2bb20b21f2b3dd6317308bd1 100644 (file)
@@ -1189,7 +1189,7 @@ is_foreign_pathkey(PlannerInfo *root,
 static char *
 deparse_type_name(Oid type_oid, int32 typemod)
 {
-       bits16          flags = FORMAT_TYPE_TYPEMOD_GIVEN;
+       uint16          flags = FORMAT_TYPE_TYPEMOD_GIVEN;
 
        if (!is_builtin(type_oid))
                flags |= FORMAT_TYPE_FORCE_QUALIFY;
index 9826e09f98360e9393d3f1870370d275db442260..f601d22d191ddba9d3c7f72f71a584166f90a867 100644 (file)
@@ -1702,7 +1702,7 @@ ReparameterizeForeignPathByChild(PlannerInfo *root, List *fdw_private,
     <para>
 <programlisting>
 ForeignDataWrapper *
-GetForeignDataWrapperExtended(Oid fdwid, bits16 flags);
+GetForeignDataWrapperExtended(Oid fdwid, uint16 flags);
 </programlisting>
 
      This function returns a <structname>ForeignDataWrapper</structname>
@@ -1731,7 +1731,7 @@ GetForeignDataWrapper(Oid fdwid);
     <para>
 <programlisting>
 ForeignServer *
-GetForeignServerExtended(Oid serverid, bits16 flags);
+GetForeignServerExtended(Oid serverid, uint16 flags);
 </programlisting>
 
      This function returns a <structname>ForeignServer</structname> object
index 742ac089a28428ba45bb25d11d98d78c25faaaf6..af39d4489622ca4e72fc05430ee0bc735cf54a93 100644 (file)
@@ -50,7 +50,7 @@
 
 
 static inline void brin_deconstruct_tuple(BrinDesc *brdesc,
-                                                                                 char *tp, bits8 *nullbits, bool nulls,
+                                                                                 char *tp, uint8 *nullbits, bool nulls,
                                                                                  Datum *values, bool *allnulls, bool *hasnulls);
 
 
@@ -107,7 +107,7 @@ brin_form_tuple(BrinDesc *brdesc, BlockNumber blkno, BrinMemTuple *tuple,
        int                     keyno;
        int                     idxattno;
        uint16          phony_infomask = 0;
-       bits8      *phony_nullbitmap;
+       uint8      *phony_nullbitmap;
        Size            len,
                                hoff,
                                data_len;
@@ -122,7 +122,7 @@ brin_form_tuple(BrinDesc *brdesc, BlockNumber blkno, BrinMemTuple *tuple,
 
        values = palloc_array(Datum, brdesc->bd_totalstored);
        nulls = palloc0_array(bool, brdesc->bd_totalstored);
-       phony_nullbitmap = palloc_array(bits8, BITMAPLEN(brdesc->bd_totalstored));
+       phony_nullbitmap = palloc_array(uint8, BITMAPLEN(brdesc->bd_totalstored));
 
 #ifdef TOAST_INDEX_HACK
        untoasted_values = palloc_array(Datum, brdesc->bd_totalstored);
@@ -322,7 +322,7 @@ brin_form_tuple(BrinDesc *brdesc, BlockNumber blkno, BrinMemTuple *tuple,
         */
        if (anynulls)
        {
-               bits8      *bitP;
+               uint8      *bitP;
                int                     bitmask;
 
                rettuple->bt_info |= BRIN_NULLS_MASK;
@@ -332,7 +332,7 @@ brin_form_tuple(BrinDesc *brdesc, BlockNumber blkno, BrinMemTuple *tuple,
                 * store a 1 for a null attribute rather than a 0.  So we must reverse
                 * the sense of the att_isnull test in brin_deconstruct_tuple as well.
                 */
-               bitP = ((bits8 *) ((char *) rettuple + SizeOfBrinTuple)) - 1;
+               bitP = ((uint8 *) ((char *) rettuple + SizeOfBrinTuple)) - 1;
                bitmask = HIGHBIT;
                for (keyno = 0; keyno < brdesc->bd_tupdesc->natts; keyno++)
                {
@@ -391,7 +391,7 @@ brin_form_placeholder_tuple(BrinDesc *brdesc, BlockNumber blkno, Size *size)
        Size            hoff;
        BrinTuple  *rettuple;
        int                     keyno;
-       bits8      *bitP;
+       uint8      *bitP;
        int                     bitmask;
 
        /* compute total space needed: always add nulls */
@@ -404,7 +404,7 @@ brin_form_placeholder_tuple(BrinDesc *brdesc, BlockNumber blkno, Size *size)
        rettuple->bt_info = hoff;
        rettuple->bt_info |= BRIN_NULLS_MASK | BRIN_PLACEHOLDER_MASK | BRIN_EMPTY_RANGE_MASK;
 
-       bitP = ((bits8 *) ((char *) rettuple + SizeOfBrinTuple)) - 1;
+       bitP = ((uint8 *) ((char *) rettuple + SizeOfBrinTuple)) - 1;
        bitmask = HIGHBIT;
        /* set allnulls true for all attributes */
        for (keyno = 0; keyno < brdesc->bd_tupdesc->natts; keyno++)
@@ -557,7 +557,7 @@ brin_deform_tuple(BrinDesc *brdesc, BrinTuple *tuple, BrinMemTuple *dMemtuple)
        bool       *allnulls;
        bool       *hasnulls;
        char       *tp;
-       bits8      *nullbits;
+       uint8      *nullbits;
        int                     keyno;
        int                     valueno;
        MemoryContext oldcxt;
@@ -581,7 +581,7 @@ brin_deform_tuple(BrinDesc *brdesc, BrinTuple *tuple, BrinMemTuple *dMemtuple)
        tp = (char *) tuple + BrinTupleDataOffset(tuple);
 
        if (BrinTupleHasNulls(tuple))
-               nullbits = (bits8 *) ((char *) tuple + SizeOfBrinTuple);
+               nullbits = (uint8 *) ((char *) tuple + SizeOfBrinTuple);
        else
                nullbits = NULL;
        brin_deconstruct_tuple(brdesc,
@@ -643,7 +643,7 @@ brin_deform_tuple(BrinDesc *brdesc, BrinTuple *tuple, BrinMemTuple *dMemtuple)
  */
 static inline void
 brin_deconstruct_tuple(BrinDesc *brdesc,
-                                          char *tp, bits8 *nullbits, bool nulls,
+                                          char *tp, uint8 *nullbits, bool nulls,
                                           Datum *values, bool *allnulls, bool *hasnulls)
 {
        int                     attnum;
index 46d3fd13a9ef9e05360e3df8f536ab3bd755c934..dce97a162a5e772700d2dfbf3400a0e8945fa049 100644 (file)
@@ -273,7 +273,7 @@ heap_compute_data_size(TupleDesc tupleDesc,
  */
 static inline void
 fill_val(CompactAttribute *att,
-                bits8 **bit,
+                uint8 **bit,
                 int *bitmask,
                 char **dataP,
                 uint16 *infomask,
@@ -401,9 +401,9 @@ void
 heap_fill_tuple(TupleDesc tupleDesc,
                                const Datum *values, const bool *isnull,
                                char *data, Size data_size,
-                               uint16 *infomask, bits8 *bit)
+                               uint16 *infomask, uint8 *bit)
 {
-       bits8      *bitP;
+       uint8      *bitP;
        int                     bitmask;
        int                     i;
        int                     numberOfAttributes = tupleDesc->natts;
@@ -513,7 +513,7 @@ nocachegetattr(HeapTuple tup,
        CompactAttribute *cattr;
        HeapTupleHeader td = tup->t_data;
        char       *tp;                         /* ptr to data part of tuple */
-       bits8      *bp = td->t_bits;    /* ptr to null bitmap in tuple */
+       uint8      *bp = td->t_bits;    /* ptr to null bitmap in tuple */
        int                     off;                    /* current offset within data */
        int                     startAttr;
        int                     firstNullAttr;
@@ -766,7 +766,7 @@ expand_tuple(HeapTuple *targetHeapTuple,
        Size            targetDataLen;
        Size            len;
        int                     hoff;
-       bits8      *nullBits = NULL;
+       uint8      *nullBits = NULL;
        int                     bitMask = 0;
        char       *targetData;
        uint16     *infoMask;
@@ -878,7 +878,7 @@ expand_tuple(HeapTuple *targetHeapTuple,
                /* We also make sure that t_ctid is invalid unless explicitly set */
                ItemPointerSetInvalid(&(targetTHeader->t_ctid));
                if (targetNullLen > 0)
-                       nullBits = (bits8 *) ((char *) (*targetHeapTuple)->t_data
+                       nullBits = (uint8 *) ((char *) (*targetHeapTuple)->t_data
                                                                  + offsetof(HeapTupleHeaderData, t_bits));
                targetData = (char *) (*targetHeapTuple)->t_data + hoff;
                infoMask = &(targetTHeader->t_infomask);
@@ -896,7 +896,7 @@ expand_tuple(HeapTuple *targetHeapTuple,
                /* Same macro works for MinimalTuples */
                HeapTupleHeaderSetNatts(*targetMinimalTuple, natts);
                if (targetNullLen > 0)
-                       nullBits = (bits8 *) ((char *) *targetMinimalTuple
+                       nullBits = (uint8 *) ((char *) *targetMinimalTuple
                                                                  + offsetof(MinimalTupleData, t_bits));
                targetData = (char *) *targetMinimalTuple + hoff;
                infoMask = &((*targetMinimalTuple)->t_infomask);
@@ -1274,7 +1274,7 @@ heap_deform_tuple(HeapTuple tuple, TupleDesc tupleDesc,
        int                     attnum;
        char       *tp;                         /* ptr to tuple data */
        uint32          off;                    /* offset in tuple data */
-       bits8      *bp = tup->t_bits;   /* ptr to null bitmap in tuple */
+       uint8      *bp = tup->t_bits;   /* ptr to null bitmap in tuple */
        int                     firstNonCacheOffsetAttr;
        int                     firstNullAttr;
 
index 6abb222cf104270e7f763628a98e3d7cd7d215ee..a2db55e9b7367ae76276373fd78ef7d6ffd40bbb 100644 (file)
@@ -175,7 +175,7 @@ index_form_tuple_context(TupleDesc tupleDescriptor,
                                        tp + hoff,
                                        data_size,
                                        &tupmask,
-                                       (hasnull ? (bits8 *) tp + sizeof(IndexTupleData) : NULL));
+                                       (hasnull ? (uint8 *) tp + sizeof(IndexTupleData) : NULL));
 
 #ifdef TOAST_INDEX_HACK
        for (i = 0; i < numberOfAttributes; i++)
@@ -232,7 +232,7 @@ nocache_index_getattr(IndexTuple tup,
 {
        CompactAttribute *cattr;
        char       *tp;                         /* ptr to data part of tuple */
-       bits8      *bp = NULL;          /* ptr to null bitmap in tuple */
+       uint8      *bp = NULL;          /* ptr to null bitmap in tuple */
        int                     data_off;               /* tuple data offset */
        int                     off;                    /* current offset within data */
        int                     startAttr;
@@ -255,7 +255,7 @@ nocache_index_getattr(IndexTuple tup,
         */
        if (hasnulls)
        {
-               bp = (bits8 *) ((char *) tup + sizeof(IndexTupleData));
+               bp = (uint8 *) ((char *) tup + sizeof(IndexTupleData));
                firstNullAttr = first_null_attr(bp, attnum);
        }
        else
@@ -365,10 +365,10 @@ index_deform_tuple(IndexTuple tup, TupleDesc tupleDescriptor,
                                   Datum *values, bool *isnull)
 {
        char       *tp;                         /* ptr to tuple data */
-       bits8      *bp;                         /* ptr to null bitmap in tuple */
+       uint8      *bp;                         /* ptr to null bitmap in tuple */
 
        /* XXX "knows" t_bits are just after fixed tuple header! */
-       bp = (bits8 *) ((char *) tup + sizeof(IndexTupleData));
+       bp = (uint8 *) ((char *) tup + sizeof(IndexTupleData));
 
        tp = (char *) tup + IndexInfoFindDataOffset(tup->t_info);
 
@@ -386,7 +386,7 @@ index_deform_tuple(IndexTuple tup, TupleDesc tupleDescriptor,
 void
 index_deform_tuple_internal(TupleDesc tupleDescriptor,
                                                        Datum *values, bool *isnull,
-                                                       char *tp, bits8 *bp, int hasnulls)
+                                                       char *tp, uint8 *bp, int hasnulls)
 {
        CompactAttribute *cattr;
        int                     natts = tupleDescriptor->natts; /* number of atts to extract */
index a6002ae9b07241631cf26f09967e505b0b3192c7..b41eafd7691258595cc6bc92b670839e4af5c6f3 100644 (file)
@@ -585,7 +585,7 @@ static relopt_string stringRelOpts[] =
 };
 
 static relopt_gen **relOpts = NULL;
-static bits32 last_assigned_kind = RELOPT_KIND_LAST_DEFAULT;
+static uint32 last_assigned_kind = RELOPT_KIND_LAST_DEFAULT;
 
 static int     num_custom_options = 0;
 static relopt_gen **custom_options = NULL;
@@ -821,7 +821,7 @@ add_local_reloption(local_relopts *relopts, relopt_gen *newoption, int offset)
  *             (for types other than string)
  */
 static relopt_gen *
-allocate_reloption(bits32 kinds, int type, const char *name, const char *desc,
+allocate_reloption(uint32 kinds, int type, const char *name, const char *desc,
                                   LOCKMODE lockmode)
 {
        MemoryContext oldcxt;
@@ -881,7 +881,7 @@ allocate_reloption(bits32 kinds, int type, const char *name, const char *desc,
  *             Allocate and initialize a new boolean reloption
  */
 static relopt_bool *
-init_bool_reloption(bits32 kinds, const char *name, const char *desc,
+init_bool_reloption(uint32 kinds, const char *name, const char *desc,
                                        bool default_val, LOCKMODE lockmode)
 {
        relopt_bool *newoption;
@@ -898,7 +898,7 @@ init_bool_reloption(bits32 kinds, const char *name, const char *desc,
  *             Add a new boolean reloption
  */
 void
-add_bool_reloption(bits32 kinds, const char *name, const char *desc,
+add_bool_reloption(uint32 kinds, const char *name, const char *desc,
                                   bool default_val, LOCKMODE lockmode)
 {
        relopt_bool *newoption = init_bool_reloption(kinds, name, desc,
@@ -929,7 +929,7 @@ add_local_bool_reloption(local_relopts *relopts, const char *name,
  *             Allocate and initialize a new ternary reloption
  */
 static relopt_ternary *
-init_ternary_reloption(bits32 kinds, const char *name, const char *desc,
+init_ternary_reloption(uint32 kinds, const char *name, const char *desc,
                                           LOCKMODE lockmode)
 {
        relopt_ternary *newoption;
@@ -945,7 +945,7 @@ init_ternary_reloption(bits32 kinds, const char *name, const char *desc,
  *             Add a new ternary reloption
  */
 void
-add_ternary_reloption(bits32 kinds, const char *name, const char *desc,
+add_ternary_reloption(uint32 kinds, const char *name, const char *desc,
                                          LOCKMODE lockmode)
 {
        relopt_ternary *newoption;
@@ -979,7 +979,7 @@ add_local_ternary_reloption(local_relopts *relopts, const char *name,
  *             Allocate and initialize a new integer reloption
  */
 static relopt_int *
-init_int_reloption(bits32 kinds, const char *name, const char *desc,
+init_int_reloption(uint32 kinds, const char *name, const char *desc,
                                   int default_val, int min_val, int max_val,
                                   LOCKMODE lockmode)
 {
@@ -999,7 +999,7 @@ init_int_reloption(bits32 kinds, const char *name, const char *desc,
  *             Add a new integer reloption
  */
 void
-add_int_reloption(bits32 kinds, const char *name, const char *desc, int default_val,
+add_int_reloption(uint32 kinds, const char *name, const char *desc, int default_val,
                                  int min_val, int max_val, LOCKMODE lockmode)
 {
        relopt_int *newoption = init_int_reloption(kinds, name, desc,
@@ -1032,7 +1032,7 @@ add_local_int_reloption(local_relopts *relopts, const char *name,
  *             Allocate and initialize a new real reloption
  */
 static relopt_real *
-init_real_reloption(bits32 kinds, const char *name, const char *desc,
+init_real_reloption(uint32 kinds, const char *name, const char *desc,
                                        double default_val, double min_val, double max_val,
                                        LOCKMODE lockmode)
 {
@@ -1052,7 +1052,7 @@ init_real_reloption(bits32 kinds, const char *name, const char *desc,
  *             Add a new float reloption
  */
 void
-add_real_reloption(bits32 kinds, const char *name, const char *desc,
+add_real_reloption(uint32 kinds, const char *name, const char *desc,
                                   double default_val, double min_val, double max_val,
                                   LOCKMODE lockmode)
 {
@@ -1087,7 +1087,7 @@ add_local_real_reloption(local_relopts *relopts, const char *name,
  *             Allocate and initialize a new enum reloption
  */
 static relopt_enum *
-init_enum_reloption(bits32 kinds, const char *name, const char *desc,
+init_enum_reloption(uint32 kinds, const char *name, const char *desc,
                                        relopt_enum_elt_def *members, int default_val,
                                        const char *detailmsg, LOCKMODE lockmode)
 {
@@ -1116,7 +1116,7 @@ init_enum_reloption(bits32 kinds, const char *name, const char *desc,
  * they are valid throughout the life of the process.
  */
 void
-add_enum_reloption(bits32 kinds, const char *name, const char *desc,
+add_enum_reloption(uint32 kinds, const char *name, const char *desc,
                                   relopt_enum_elt_def *members, int default_val,
                                   const char *detailmsg, LOCKMODE lockmode)
 {
@@ -1151,7 +1151,7 @@ add_local_enum_reloption(local_relopts *relopts, const char *name,
  *             Allocate and initialize a new string reloption
  */
 static relopt_string *
-init_string_reloption(bits32 kinds, const char *name, const char *desc,
+init_string_reloption(uint32 kinds, const char *name, const char *desc,
                                          const char *default_val,
                                          validate_string_relopt validator,
                                          fill_string_relopt filler,
@@ -1196,7 +1196,7 @@ init_string_reloption(bits32 kinds, const char *name, const char *desc,
  * the validation.
  */
 void
-add_string_reloption(bits32 kinds, const char *name, const char *desc,
+add_string_reloption(uint32 kinds, const char *name, const char *desc,
                                         const char *default_val, validate_string_relopt validator,
                                         LOCKMODE lockmode)
 {
index a4694bd8065b756bcef7c7612a1f8064f69e90f9..f2ee333f60d84be6f52e51025a5b37bd13386381 100644 (file)
@@ -929,12 +929,12 @@ spgFormLeafTuple(SpGistState *state, const ItemPointerData *heapPtr,
 
        if (needs_null_mask)
        {
-               bits8      *bp;                 /* ptr to null bitmap in tuple */
+               uint8      *bp;                 /* ptr to null bitmap in tuple */
 
                /* Set nullmask presence bit in SpGistLeafTuple header */
                SGLT_SET_HASNULLMASK(tup, true);
                /* Fill the data area and null mask */
-               bp = (bits8 *) ((char *) tup + sizeof(SpGistLeafTupleData));
+               bp = (uint8 *) ((char *) tup + sizeof(SpGistLeafTupleData));
                heap_fill_tuple(tupleDescriptor, datums, isnulls, tp, data_size,
                                                &tupmask, bp);
        }
@@ -942,7 +942,7 @@ spgFormLeafTuple(SpGistState *state, const ItemPointerData *heapPtr,
        {
                /* Fill data area only */
                heap_fill_tuple(tupleDescriptor, datums, isnulls, tp, data_size,
-                                               &tupmask, (bits8 *) NULL);
+                                               &tupmask, (uint8 *) NULL);
        }
        /* otherwise we have no data, nor a bitmap, to fill */
 
@@ -1116,7 +1116,7 @@ spgDeformLeafTuple(SpGistLeafTuple tup, TupleDesc tupleDescriptor,
 {
        bool            hasNullsMask = SGLT_GET_HASNULLMASK(tup);
        char       *tp;                         /* ptr to tuple data */
-       bits8      *bp;                         /* ptr to null bitmap in tuple */
+       uint8      *bp;                         /* ptr to null bitmap in tuple */
 
        if (keyColumnIsNull && tupleDescriptor->natts == 1)
        {
@@ -1137,7 +1137,7 @@ spgDeformLeafTuple(SpGistLeafTuple tup, TupleDesc tupleDescriptor,
        }
 
        tp = (char *) tup + SGLTHDRSZ(hasNullsMask);
-       bp = (bits8 *) ((char *) tup + sizeof(SpGistLeafTupleData));
+       bp = (uint8 *) ((char *) tup + sizeof(SpGistLeafTupleData));
 
        index_deform_tuple_internal(tupleDescriptor,
                                                                datums, isnulls,
index d8219b18c489bd46d06d667b86c5a1e93d475038..1ccfa687f052b1d63ba1f807d131558b6b52a516 100644 (file)
@@ -740,8 +740,8 @@ index_create(Relation heapRelation,
                         const int16 *coloptions,
                         const NullableDatum *stattargets,
                         Datum reloptions,
-                        bits16 flags,
-                        bits16 constr_flags,
+                        uint16 flags,
+                        uint16 constr_flags,
                         bool allow_system_table_mods,
                         bool is_internal,
                         Oid *constraintId)
@@ -1889,7 +1889,7 @@ index_constraint_create(Relation heapRelation,
                                                const IndexInfo *indexInfo,
                                                const char *constraintName,
                                                char constraintType,
-                                               bits16 constr_flags,
+                                               uint16 constr_flags,
                                                bool allow_system_table_mods,
                                                bool is_internal)
 {
index 0a1a68e064481a6092b1c77997acb65b8e7dd99c..fd7d2ec0e3aba4f1ff49f09f1a127beccf979171 100644 (file)
@@ -201,7 +201,7 @@ CatalogTupleCheckConstraints(Relation heapRel, HeapTuple tup)
        if (HeapTupleHasNulls(tup))
        {
                TupleDesc       tupdesc = RelationGetDescr(heapRel);
-               bits8      *bp = tup->t_data->t_bits;
+               uint8      *bp = tup->t_data->t_bits;
 
                for (int attnum = 0; attnum < tupdesc->natts; attnum++)
                {
index 7c93f5240eda5cee890403a14608aaeb29fc50cc..9771c6a9b63ff33ffbc6861447ba822adba04f3b 100644 (file)
@@ -3039,7 +3039,7 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok)
 
                case ProcedureRelationId:
                        {
-                               bits16          flags = FORMAT_PROC_INVALID_AS_NULL;
+                               uint16          flags = FORMAT_PROC_INVALID_AS_NULL;
                                char       *proname = format_procedure_extended(object->objectId,
                                                                                                                                flags);
 
@@ -3052,7 +3052,7 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok)
 
                case TypeRelationId:
                        {
-                               bits16          flags = FORMAT_TYPE_INVALID_AS_NULL;
+                               uint16          flags = FORMAT_TYPE_INVALID_AS_NULL;
                                char       *typname = format_type_extended(object->objectId, -1,
                                                                                                                   flags);
 
@@ -3245,7 +3245,7 @@ getObjectDescription(const ObjectAddress *object, bool missing_ok)
 
                case OperatorRelationId:
                        {
-                               bits16          flags = FORMAT_OPERATOR_INVALID_AS_NULL;
+                               uint16          flags = FORMAT_OPERATOR_INVALID_AS_NULL;
                                char       *oprname = format_operator_extended(object->objectId,
                                                                                                                           flags);
 
@@ -5160,7 +5160,7 @@ getObjectIdentityParts(const ObjectAddress *object,
 
                case ProcedureRelationId:
                        {
-                               bits16          flags = FORMAT_PROC_FORCE_QUALIFY | FORMAT_PROC_INVALID_AS_NULL;
+                               uint16          flags = FORMAT_PROC_FORCE_QUALIFY | FORMAT_PROC_INVALID_AS_NULL;
                                char       *proname = format_procedure_extended(object->objectId,
                                                                                                                                flags);
 
@@ -5176,7 +5176,7 @@ getObjectIdentityParts(const ObjectAddress *object,
 
                case TypeRelationId:
                        {
-                               bits16          flags = FORMAT_TYPE_INVALID_AS_NULL | FORMAT_TYPE_FORCE_QUALIFY;
+                               uint16          flags = FORMAT_TYPE_INVALID_AS_NULL | FORMAT_TYPE_FORCE_QUALIFY;
                                char       *typeout;
 
                                typeout = format_type_extended(object->objectId, -1, flags);
@@ -5383,7 +5383,7 @@ getObjectIdentityParts(const ObjectAddress *object,
 
                case OperatorRelationId:
                        {
-                               bits16          flags = FORMAT_OPERATOR_FORCE_QUALIFY | FORMAT_OPERATOR_INVALID_AS_NULL;
+                               uint16          flags = FORMAT_OPERATOR_FORCE_QUALIFY | FORMAT_OPERATOR_INVALID_AS_NULL;
                                char       *oprname = format_operator_extended(object->objectId,
                                                                                                                           flags);
 
index dd593ccbc1cb276b815768d3f54102a7093f63ef..373e82347946685d6f9494e34d85e26c6cb03ab0 100644 (file)
@@ -581,8 +581,8 @@ DefineIndex(ParseState *pstate,
        Datum           reloptions;
        int16      *coloptions;
        IndexInfo  *indexInfo;
-       bits16          flags;
-       bits16          constr_flags;
+       uint16          flags;
+       uint16          constr_flags;
        int                     numberOfAttributes;
        int                     numberOfKeyAttributes;
        TransactionId limitXmin;
index 7375e214cb4c16ea11e0f7e28020ef04e05cd0e3..3a30d8ddb1fd0ed9c6bbcd61ac45419b5afae5ac 100644 (file)
@@ -89,7 +89,7 @@
  */
 typedef struct SubOpts
 {
-       bits32          specified_opts;
+       uint32          specified_opts;
        char       *slot_name;
        char       *synchronous_commit;
        bool            connect;
@@ -150,7 +150,7 @@ static void CheckAlterSubOption(Subscription *sub, const char *option,
  */
 static void
 parse_subscription_options(ParseState *pstate, List *stmt_options,
-                                                  bits32 supported_opts, SubOpts *opts)
+                                                  uint32 supported_opts, SubOpts *opts)
 {
        ListCell   *lc;
 
@@ -626,7 +626,7 @@ CreateSubscription(ParseState *pstate, CreateSubscriptionStmt *stmt,
        char       *conninfo;
        char            originname[NAMEDATALEN];
        List       *publications;
-       bits32          supported_opts;
+       uint32          supported_opts;
        SubOpts         opts = {0};
        AclResult       aclresult;
 
@@ -1430,7 +1430,7 @@ AlterSubscription(ParseState *pstate, AlterSubscriptionStmt *stmt,
        char       *origin;
        Subscription *sub;
        Form_pg_subscription form;
-       bits32          supported_opts;
+       uint32          supported_opts;
        SubOpts         opts = {0};
 
        rel = table_open(SubscriptionRelationId, RowExclusiveLock);
index cfb60940f4d8890ea734a8dacb18092ba103c6f0..8b4ebc6f226a6e32a5795f29deb3026a03c1cd04 100644 (file)
@@ -9787,7 +9787,7 @@ ATExecAddIndexConstraint(AlteredTableInfo *tab, Relation rel,
        char       *constraintName;
        char            constraintType;
        ObjectAddress address;
-       bits16          flags;
+       uint16          flags;
 
        Assert(IsA(stmt, IndexStmt));
        Assert(OidIsValid(index_oid));
index bce3a2daa245dfdcca207d74766506583b8bc4c6..766a518c7a1bcf3f9aacb4260bbc27d0017483dc 100644 (file)
@@ -717,7 +717,7 @@ vacuum(List *relations, const VacuumParams params, BufferAccessStrategy bstrateg
  */
 bool
 vacuum_is_permitted_for_relation(Oid relid, Form_pg_class reltuple,
-                                                                bits32 options)
+                                                                uint32 options)
 {
        char       *relname;
 
@@ -768,7 +768,7 @@ vacuum_is_permitted_for_relation(Oid relid, Form_pg_class reltuple,
  * or locked, a log is emitted if possible.
  */
 Relation
-vacuum_open_relation(Oid relid, RangeVar *relation, bits32 options,
+vacuum_open_relation(Oid relid, RangeVar *relation, uint32 options,
                                         bool verbose, LOCKMODE lmode)
 {
        Relation        rel;
index 43116431edfc14cbe052c2f19b200cf3b7cf790d..3c4843cde868eee9319a438c9b40beb78c7b1cd7 100644 (file)
@@ -3442,7 +3442,7 @@ ExecEvalArrayExpr(ExprState *state, ExprEvalStep *op)
                bool            havenulls = false;
                bool            haveempty = false;
                char      **subdata;
-               bits8     **subbitmaps;
+               uint8     **subbitmaps;
                int                *subbytes;
                int                *subnitems;
                int32           dataoffset;
@@ -3450,7 +3450,7 @@ ExecEvalArrayExpr(ExprState *state, ExprEvalStep *op)
                int                     iitem;
 
                subdata = (char **) palloc(nelems * sizeof(char *));
-               subbitmaps = (bits8 **) palloc(nelems * sizeof(bits8 *));
+               subbitmaps = (uint8 **) palloc(nelems * sizeof(uint8 *));
                subbytes = (int *) palloc(nelems * sizeof(int));
                subnitems = (int *) palloc(nelems * sizeof(int));
 
@@ -4036,7 +4036,7 @@ ExecEvalScalarArrayOp(ExprState *state, ExprEvalStep *op)
        char            typalign;
        uint8           typalignby;
        char       *s;
-       bits8      *bitmap;
+       uint8      *bitmap;
        int                     bitmask;
 
        /*
@@ -4263,7 +4263,7 @@ ExecEvalHashedScalarArrayOp(ExprState *state, ExprEvalStep *op, ExprContext *eco
                int                     nitems;
                bool            has_nulls = false;
                char       *s;
-               bits8      *bitmap;
+               uint8      *bitmap;
                int                     bitmask;
                MemoryContext oldcontext;
                ArrayType  *arr;
index cc6eb3a6ee9f0c3387bfb0f67b7bffce7fb80ae0..4363e154c0f27376c9b2199f102f6c3c9b0cd152 100644 (file)
@@ -309,7 +309,7 @@ ExecCloseIndices(ResultRelInfo *resultRelInfo)
 List *
 ExecInsertIndexTuples(ResultRelInfo *resultRelInfo,
                                          EState *estate,
-                                         bits32 flags,
+                                         uint32 flags,
                                          TupleTableSlot *slot,
                                          List *arbiterIndexes,
                                          bool *specConflict)
index fea8991cb04371a1d0f7be198cf814b677b09fb9..b2ca5cbf1176167048eaa7f39557ade90b895797 100644 (file)
@@ -851,7 +851,7 @@ ExecSimpleRelationInsert(ResultRelInfo *resultRelInfo,
 
                if (resultRelInfo->ri_NumIndices > 0)
                {
-                       bits32          flags;
+                       uint32          flags;
 
                        if (conflictindexes != NIL)
                                flags = EIIT_NO_DUPE_ERROR;
@@ -955,7 +955,7 @@ ExecSimpleRelationUpdate(ResultRelInfo *resultRelInfo,
 
                if (resultRelInfo->ri_NumIndices > 0 && (update_indexes != TU_None))
                {
-                       bits32          flags = EIIT_IS_UPDATE;
+                       uint32          flags = EIIT_IS_UPDATE;
 
                        if (conflictindexes != NIL)
                                flags |= EIIT_NO_DUPE_ERROR;
index 9d900147a55f1c18ca9c1f843800fbef28b59b6b..f08982a43cc07f89a10553b80c74ab744ab4faa5 100644 (file)
@@ -1059,7 +1059,7 @@ slot_deform_heap_tuple(TupleTableSlot *slot, HeapTuple tuple, uint32 *offp,
                natts = Min(natts, reqnatts);
                if (natts > firstNonGuaranteedAttr)
                {
-                       bits8      *bp = tup->t_bits;
+                       uint8      *bp = tup->t_bits;
 
                        /* Find the first NULL attr */
                        firstNullAttr = first_null_attr(bp, natts);
index 4cd5e262e0f33039b4071ca7c3d796caf9bf4760..582bcc367c060f2610ac4b4a49ac4b6cc342b450 100644 (file)
@@ -2357,7 +2357,7 @@ ExecUpdateEpilogue(ModifyTableContext *context, UpdateContext *updateCxt,
        /* insert index entries for tuple if necessary */
        if (resultRelInfo->ri_NumIndices > 0 && (updateCxt->updateIndexes != TU_None))
        {
-               bits32          flags = EIIT_IS_UPDATE;
+               uint32          flags = EIIT_IS_UPDATE;
 
                if (updateCxt->updateIndexes == TU_Summarizing)
                        flags |= EIIT_ONLY_SUMMARIZING;
index 005282f17f6cb16b7d07ad30bfd4ec572d2c2d48..821d45c1e110d2e8d3285e878728952d5a541d0d 100644 (file)
@@ -48,7 +48,7 @@ GetForeignDataWrapper(Oid fdwid)
  * be found instead of raising an error.
  */
 ForeignDataWrapper *
-GetForeignDataWrapperExtended(Oid fdwid, bits16 flags)
+GetForeignDataWrapperExtended(Oid fdwid, uint16 flags)
 {
        Form_pg_foreign_data_wrapper fdwform;
        ForeignDataWrapper *fdw;
@@ -123,7 +123,7 @@ GetForeignServer(Oid serverid)
  * instead of raising an error.
  */
 ForeignServer *
-GetForeignServerExtended(Oid serverid, bits16 flags)
+GetForeignServerExtended(Oid serverid, uint16 flags)
 {
        Form_pg_foreign_server serverform;
        ForeignServer *server;
index 4308751f787e69a4323c7976e3696ff2f5657f1e..a21f5a754bf537bb5d9192460d82388991dbdf2c 100644 (file)
@@ -135,7 +135,7 @@ my @nodetag_only;
 
 # types that are copied by straight assignment
 my @scalar_types = qw(
-  bits32 bool char double int int8 int16 int32 int64 long uint8 uint16 uint32 uint64
+  bool char double int int8 int16 int32 int64 long uint8 uint16 uint32 uint64
   AclMode AttrNumber Cardinality Cost Index Oid RelFileNumber Selectivity Size StrategyNumber SubTransactionId TimeLineID XLogRecPtr
 );
 
@@ -1031,7 +1031,6 @@ _read${n}(void)
                        print $rff "\tREAD_INT_FIELD($f);\n" unless $no_read;
                }
                elsif ($t eq 'uint32'
-                       || $t eq 'bits32'
                        || $t eq 'BlockNumber'
                        || $t eq 'Index'
                        || $t eq 'SubTransactionId')
index 4d8b46adb4650b3ce1813b6ccd43d19446810365..f2a62489d9cf2b1cbc1dbf45741a627a65553c55 100644 (file)
@@ -861,7 +861,7 @@ void
 BackgroundWorkerInitializeConnection(const char *dbname, const char *username, uint32 flags)
 {
        BackgroundWorker *worker = MyBgworkerEntry;
-       bits32          init_flags = 0; /* never honor session_preload_libraries */
+       uint32          init_flags = 0; /* never honor session_preload_libraries */
 
        /* ignore datallowconn and ACL_CONNECT? */
        if (flags & BGWORKER_BYPASS_ALLOWCONN)
@@ -895,7 +895,7 @@ void
 BackgroundWorkerInitializeConnectionByOid(Oid dboid, Oid useroid, uint32 flags)
 {
        BackgroundWorker *worker = MyBgworkerEntry;
-       bits32          init_flags = 0; /* never honor session_preload_libraries */
+       uint32          init_flags = 0; /* never honor session_preload_libraries */
 
        /* ignore datallowconn and ACL_CONNECT? */
        if (flags & BGWORKER_BYPASS_ALLOWCONN)
index 9792f6387189470548212514e8343f7d6d0cb6cd..0c2a7bc8578075a18fc91ad29bc8cc14632ea534 100644 (file)
@@ -887,7 +887,7 @@ process_pipe_input(char *logbuffer, int *bytes_in_logbuffer)
        {
                PipeProtoHeader p;
                int                     chunklen;
-               bits8           dest_flags;
+               uint8           dest_flags;
 
                /* Do we have a valid header? */
                memcpy(&p, cursor, offsetof(PipeProtoHeader, data));
index f2f8d3ff75f541c2c5b5bc0e07d597be624c8d66..7727fed3bdad412f406ad72c78da2d7044123c7b 100644 (file)
@@ -268,7 +268,7 @@ pgstat_flush_backend_entry_wal(PgStat_EntryRef *entry_ref)
  * if some statistics could not be flushed due to lock contention.
  */
 bool
-pgstat_flush_backend(bool nowait, bits32 flags)
+pgstat_flush_backend(bool nowait, uint32 flags)
 {
        PgStat_EntryRef *entry_ref;
        bool            has_pending_data = false;
index 453a53a65fb3df5c1abe6c09912e2ff03fd7844c..50c81a088df8b517a82c01e3d9bee6b9742de626 100644 (file)
@@ -337,7 +337,7 @@ array_cat(PG_FUNCTION_ARGS)
        int                     i;
        char       *dat1,
                           *dat2;
-       bits8      *bitmap1,
+       uint8      *bitmap1,
                           *bitmap2;
        Oid                     element_type;
        Oid                     element_type1;
@@ -1013,7 +1013,7 @@ array_agg_array_combine(PG_FUNCTION_ARGS)
                {
                        int                     size = (state2->aitems + 7) / 8;
 
-                       state1->nullbitmap = (bits8 *) palloc(size);
+                       state1->nullbitmap = (uint8 *) palloc(size);
                        memcpy(state1->nullbitmap, state2->nullbitmap, size);
                }
 
@@ -1084,7 +1084,7 @@ array_agg_array_combine(PG_FUNCTION_ARGS)
                                 * previous inputs by marking all their items non-null.
                                 */
                                state1->aitems = pg_nextpower2_32(Max(256, newnitems + 1));
-                               state1->nullbitmap = (bits8 *) palloc((state1->aitems + 7) / 8);
+                               state1->nullbitmap = (uint8 *) palloc((state1->aitems + 7) / 8);
                                array_bitmap_copy(state1->nullbitmap, 0,
                                                                  NULL, 0,
                                                                  state1->nitems);
@@ -1094,7 +1094,7 @@ array_agg_array_combine(PG_FUNCTION_ARGS)
                                int                     newaitems = state1->aitems + state2->aitems;
 
                                state1->aitems = pg_nextpower2_32(newaitems);
-                               state1->nullbitmap = (bits8 *)
+                               state1->nullbitmap = (uint8 *)
                                        repalloc(state1->nullbitmap, (state1->aitems + 7) / 8);
                        }
                        array_bitmap_copy(state1->nullbitmap, state1->nitems,
@@ -1238,7 +1238,7 @@ array_agg_array_deserialize(PG_FUNCTION_ARGS)
        {
                int                     size = (result->aitems + 7) / 8;
 
-               result->nullbitmap = (bits8 *) palloc(size);
+               result->nullbitmap = (uint8 *) palloc(size);
                temp = pq_getmsgbytes(&buf, size);
                memcpy(result->nullbitmap, temp, size);
        }
index 734e5fea45e4b1d33946fd03c5f096eeef37b0e4..2933a95c4a59c35dca0938d6c2dab0b130008e3b 100644 (file)
@@ -70,7 +70,7 @@ typedef struct ArrayIteratorData
 {
        /* basic info about the array, set up during array_create_iterator() */
        ArrayType  *arr;                        /* array we're iterating through */
-       bits8      *nullbitmap;         /* its null bitmap, if any */
+       uint8      *nullbitmap;         /* its null bitmap, if any */
        int                     nitems;                 /* total number of elements in array */
        int16           typlen;                 /* element type's length */
        bool            typbyval;               /* element type's byval property */
@@ -120,26 +120,26 @@ static Datum array_set_element_expanded(Datum arraydatum,
                                                                                Datum dataValue, bool isNull,
                                                                                int arraytyplen,
                                                                                int elmlen, bool elmbyval, char elmalign);
-static bool array_get_isnull(const bits8 *nullbitmap, int offset);
-static void array_set_isnull(bits8 *nullbitmap, int offset, bool isNull);
+static bool array_get_isnull(const uint8 *nullbitmap, int offset);
+static void array_set_isnull(uint8 *nullbitmap, int offset, bool isNull);
 static Datum ArrayCast(char *value, bool byval, int len);
 static int     ArrayCastAndSet(Datum src,
                                                        int typlen, bool typbyval, uint8 typalignby,
                                                        char *dest);
-static char *array_seek(char *ptr, int offset, bits8 *nullbitmap, int nitems,
+static char *array_seek(char *ptr, int offset, uint8 *nullbitmap, int nitems,
                                                int typlen, bool typbyval, char typalign);
-static int     array_nelems_size(char *ptr, int offset, bits8 *nullbitmap,
+static int     array_nelems_size(char *ptr, int offset, uint8 *nullbitmap,
                                                          int nitems, int typlen, bool typbyval, char typalign);
 static int     array_copy(char *destptr, int nitems,
-                                          char *srcptr, int offset, bits8 *nullbitmap,
+                                          char *srcptr, int offset, uint8 *nullbitmap,
                                           int typlen, bool typbyval, char typalign);
-static int     array_slice_size(char *arraydataptr, bits8 *arraynullsptr,
+static int     array_slice_size(char *arraydataptr, uint8 *arraynullsptr,
                                                         int ndim, int *dim, int *lb,
                                                         int *st, int *endp,
                                                         int typlen, bool typbyval, char typalign);
 static void array_extract_slice(ArrayType *newarray,
                                                                int ndim, int *dim, int *lb,
-                                                               char *arraydataptr, bits8 *arraynullsptr,
+                                                               char *arraydataptr, uint8 *arraynullsptr,
                                                                int *st, int *endp,
                                                                int typlen, bool typbyval, char typalign);
 static void array_insert_slice(ArrayType *destArray, ArrayType *origArray,
@@ -972,7 +972,7 @@ CopyArrayEls(ArrayType *array,
                         bool freedata)
 {
        char       *p = ARR_DATA_PTR(array);
-       bits8      *bitmap = ARR_NULLBITMAP(array);
+       uint8      *bitmap = ARR_NULLBITMAP(array);
        int                     bitval = 0;
        int                     bitmask = 1;
        uint8           typalignby = typalign_to_alignby(typalign);
@@ -1839,7 +1839,7 @@ array_get_element(Datum arraydatum,
                                fixedLb[1];
        char       *arraydataptr,
                           *retptr;
-       bits8      *arraynullsptr;
+       uint8      *arraynullsptr;
 
        if (arraytyplen > 0)
        {
@@ -2053,7 +2053,7 @@ array_get_slice(Datum arraydatum,
                                fixedLb[1];
        Oid                     elemtype;
        char       *arraydataptr;
-       bits8      *arraynullsptr;
+       uint8      *arraynullsptr;
        int32           dataoffset;
        int                     bytes,
                                span[MAXDIM];
@@ -2221,7 +2221,7 @@ array_set_element(Datum arraydatum,
                                offset;
        char       *elt_ptr;
        bool            newhasnulls;
-       bits8      *oldnullbitmap;
+       uint8      *oldnullbitmap;
        int                     oldnitems,
                                newnitems,
                                olddatasize,
@@ -2467,7 +2467,7 @@ array_set_element(Datum arraydatum,
         */
        if (newhasnulls)
        {
-               bits8      *newnullbitmap = ARR_NULLBITMAP(newarray);
+               uint8      *newnullbitmap = ARR_NULLBITMAP(newarray);
 
                /* palloc0 above already marked any inserted positions as nulls */
                /* Fix the inserted value */
@@ -3059,7 +3059,7 @@ array_set_slice(Datum arraydatum,
                int                     slicelb = Max(oldlb, lowerIndx[0]);
                int                     sliceub = Min(oldub, upperIndx[0]);
                char       *oldarraydata = ARR_DATA_PTR(array);
-               bits8      *oldarraybitmap = ARR_NULLBITMAP(array);
+               uint8      *oldarraybitmap = ARR_NULLBITMAP(array);
 
                /* count/size of old array entries that will go before the slice */
                itemsbefore = Min(slicelb, oldub + 1) - oldlb;
@@ -3121,8 +3121,8 @@ array_set_slice(Datum arraydatum,
                /* fill in nulls bitmap if needed */
                if (newhasnulls)
                {
-                       bits8      *newnullbitmap = ARR_NULLBITMAP(newarray);
-                       bits8      *oldnullbitmap = ARR_NULLBITMAP(array);
+                       uint8      *newnullbitmap = ARR_NULLBITMAP(newarray);
+                       uint8      *oldnullbitmap = ARR_NULLBITMAP(array);
 
                        /* palloc0 above already marked any inserted positions as nulls */
                        array_bitmap_copy(newnullbitmap, addedbefore,
@@ -3644,7 +3644,7 @@ deconstruct_array(const ArrayType *array,
        bool       *nulls;
        int                     nelems;
        char       *p;
-       bits8      *bitmap;
+       uint8      *bitmap;
        int                     bitmask;
        int                     i;
        uint8           elmalignby = typalign_to_alignby(elmalign);
@@ -3781,7 +3781,7 @@ bool
 array_contains_nulls(const ArrayType *array)
 {
        int                     nelems;
-       bits8      *bitmap;
+       uint8      *bitmap;
        int                     bitmask;
 
        /* Easy answer if there's no null bitmap */
@@ -4791,7 +4791,7 @@ array_free_iterator(ArrayIterator iterator)
  * offset: 0-based linear element number of array element
  */
 static bool
-array_get_isnull(const bits8 *nullbitmap, int offset)
+array_get_isnull(const uint8 *nullbitmap, int offset)
 {
        if (nullbitmap == NULL)
                return false;                   /* assume not null */
@@ -4808,7 +4808,7 @@ array_get_isnull(const bits8 *nullbitmap, int offset)
  * isNull: null status to set
  */
 static void
-array_set_isnull(bits8 *nullbitmap, int offset, bool isNull)
+array_set_isnull(uint8 *nullbitmap, int offset, bool isNull)
 {
        int                     bitmask;
 
@@ -4876,7 +4876,7 @@ ArrayCastAndSet(Datum src,
  * It is caller's responsibility to ensure that nitems is within range
  */
 static char *
-array_seek(char *ptr, int offset, bits8 *nullbitmap, int nitems,
+array_seek(char *ptr, int offset, uint8 *nullbitmap, int nitems,
                   int typlen, bool typbyval, char typalign)
 {
        uint8           typalignby = typalign_to_alignby(typalign);
@@ -4925,7 +4925,7 @@ array_seek(char *ptr, int offset, bits8 *nullbitmap, int nitems,
  * Parameters same as for array_seek
  */
 static int
-array_nelems_size(char *ptr, int offset, bits8 *nullbitmap, int nitems,
+array_nelems_size(char *ptr, int offset, uint8 *nullbitmap, int nitems,
                                  int typlen, bool typbyval, char typalign)
 {
        return array_seek(ptr, offset, nullbitmap, nitems,
@@ -4948,7 +4948,7 @@ array_nelems_size(char *ptr, int offset, bits8 *nullbitmap, int nitems,
  */
 static int
 array_copy(char *destptr, int nitems,
-                  char *srcptr, int offset, bits8 *nullbitmap,
+                  char *srcptr, int offset, uint8 *nullbitmap,
                   int typlen, bool typbyval, char typalign)
 {
        int                     numbytes;
@@ -4977,8 +4977,8 @@ array_copy(char *destptr, int nitems,
  * to make it worth worrying too much.  For the moment, KISS.
  */
 void
-array_bitmap_copy(bits8 *destbitmap, int destoffset,
-                                 const bits8 *srcbitmap, int srcoffset,
+array_bitmap_copy(uint8 *destbitmap, int destoffset,
+                                 const uint8 *srcbitmap, int srcoffset,
                                  int nitems)
 {
        int                     destbitmask,
@@ -5048,7 +5048,7 @@ array_bitmap_copy(bits8 *destbitmap, int destoffset,
  * We assume the caller has verified that the slice coordinates are valid.
  */
 static int
-array_slice_size(char *arraydataptr, bits8 *arraynullsptr,
+array_slice_size(char *arraydataptr, uint8 *arraynullsptr,
                                 int ndim, int *dim, int *lb,
                                 int *st, int *endp,
                                 int typlen, bool typbyval, char typalign)
@@ -5114,7 +5114,7 @@ array_extract_slice(ArrayType *newarray,
                                        int *dim,
                                        int *lb,
                                        char *arraydataptr,
-                                       bits8 *arraynullsptr,
+                                       uint8 *arraynullsptr,
                                        int *st,
                                        int *endp,
                                        int typlen,
@@ -5122,7 +5122,7 @@ array_extract_slice(ArrayType *newarray,
                                        char typalign)
 {
        char       *destdataptr = ARR_DATA_PTR(newarray);
-       bits8      *destnullsptr = ARR_NULLBITMAP(newarray);
+       uint8      *destnullsptr = ARR_NULLBITMAP(newarray);
        char       *srcdataptr;
        int                     src_offset,
                                dest_offset,
@@ -5197,9 +5197,9 @@ array_insert_slice(ArrayType *destArray,
        char       *destPtr = ARR_DATA_PTR(destArray);
        char       *origPtr = ARR_DATA_PTR(origArray);
        char       *srcPtr = ARR_DATA_PTR(srcArray);
-       bits8      *destBitmap = ARR_NULLBITMAP(destArray);
-       bits8      *origBitmap = ARR_NULLBITMAP(origArray);
-       bits8      *srcBitmap = ARR_NULLBITMAP(srcArray);
+       uint8      *destBitmap = ARR_NULLBITMAP(destArray);
+       uint8      *origBitmap = ARR_NULLBITMAP(origArray);
+       uint8      *srcBitmap = ARR_NULLBITMAP(srcArray);
        int                     orignitems = ArrayGetNItems(ARR_NDIM(origArray),
                                                                                        ARR_DIMS(origArray));
        int                     dest_offset,
@@ -5679,7 +5679,7 @@ accumArrayResultArr(ArrayBuildStateArr *astate,
                         * previous inputs by marking all their items non-null.
                         */
                        astate->aitems = pg_nextpower2_32(Max(256, newnitems + 1));
-                       astate->nullbitmap = (bits8 *) palloc((astate->aitems + 7) / 8);
+                       astate->nullbitmap = (uint8 *) palloc((astate->aitems + 7) / 8);
                        array_bitmap_copy(astate->nullbitmap, 0,
                                                          NULL, 0,
                                                          astate->nitems);
@@ -5687,7 +5687,7 @@ accumArrayResultArr(ArrayBuildStateArr *astate,
                else if (newnitems > astate->aitems)
                {
                        astate->aitems = Max(astate->aitems * 2, newnitems);
-                       astate->nullbitmap = (bits8 *)
+                       astate->nullbitmap = (uint8 *)
                                repalloc(astate->nullbitmap, (astate->aitems + 7) / 8);
                }
                array_bitmap_copy(astate->nullbitmap, astate->nitems,
@@ -6419,7 +6419,7 @@ array_replace_internal(ArrayType *array,
        char            typalign;
        uint8           typalignby;
        char       *arraydataptr;
-       bits8      *bitmap;
+       uint8      *bitmap;
        int                     bitmask;
        bool            changed = false;
        TypeCacheEntry *typentry;
index 3cd5053d11802512cf4d7f47ab25d0833b00005d..7a5695c624565e7efca5399ae48119c0a1f91e32 100644 (file)
@@ -62,7 +62,7 @@ format_type(PG_FUNCTION_ARGS)
        Oid                     type_oid;
        int32           typemod;
        char       *result;
-       bits16          flags = FORMAT_TYPE_ALLOW_INVALID;
+       uint16          flags = FORMAT_TYPE_ALLOW_INVALID;
 
        /* Since this function is not strict, we must test for null args */
        if (PG_ARGISNULL(0))
@@ -109,7 +109,7 @@ format_type(PG_FUNCTION_ARGS)
  * Returns a palloc'd string, or NULL.
  */
 char *
-format_type_extended(Oid type_oid, int32 typemod, bits16 flags)
+format_type_extended(Oid type_oid, int32 typemod, uint16 flags)
 {
        HeapTuple       tuple;
        Form_pg_type typeform;
index 29ef800d9923ffca88c1a1ade177688dedac1a76..c033e68ba151772731eed14a76f94478993affc2 100644 (file)
@@ -88,7 +88,7 @@ count_nulls(FunctionCallInfo fcinfo,
                int                     ndims,
                                        nitems,
                                   *dims;
-               bits8      *bitmap;
+               uint8      *bitmap;
 
                Assert(PG_NARGS() == 1);
 
index ee34d1d85f82d60837df0dc3359c04c03410c77a..64f293f4e98b01405a3b7732af24eb5bd7fac097 100644 (file)
@@ -329,7 +329,7 @@ format_procedure_qualified(Oid procedure_oid)
  *                     always schema-qualify procedure names, regardless of search_path
  */
 char *
-format_procedure_extended(Oid procedure_oid, bits16 flags)
+format_procedure_extended(Oid procedure_oid, uint16 flags)
 {
        char       *result;
        HeapTuple       proctup;
@@ -727,7 +727,7 @@ to_regoperator(PG_FUNCTION_ARGS)
  *                     always schema-qualify operator names, regardless of search_path
  */
 char *
-format_operator_extended(Oid operator_oid, bits16 flags)
+format_operator_extended(Oid operator_oid, uint16 flags)
 {
        char       *result;
        HeapTuple       opertup;
index 7bc12589e40e64c65fbe1ce9fe98a947a8509e27..e5f2b6082ce992f49cbaf30d24b38608b8274f6a 100644 (file)
@@ -1255,7 +1255,7 @@ pg_get_indexdef_columns(Oid indexrelid, bool pretty)
 
 /* Internal version, extensible with flags to control its behavior */
 char *
-pg_get_indexdef_columns_extended(Oid indexrelid, bits16 flags)
+pg_get_indexdef_columns_extended(Oid indexrelid, uint16 flags)
 {
        bool            pretty = ((flags & RULE_INDEXDEF_PRETTY) != 0);
        bool            keys_only = ((flags & RULE_INDEXDEF_KEYS_ONLY) != 0);
index c46b5bae70d6149093a7d225360d8ddfa2c8553b..7dde1b6db531da0fe3113211295b42db82ce22b2 100644 (file)
@@ -154,13 +154,13 @@ bit_in(PG_FUNCTION_ARGS)
        Node       *escontext = fcinfo->context;
        VarBit     *result;                     /* The resulting bit string                       */
        char       *sp;                         /* pointer into the character string  */
-       bits8      *r;                          /* pointer into the result */
+       uint8      *r;                          /* pointer into the result */
        int                     len,                    /* Length of the whole data structure */
                                bitlen,                 /* Number of bits in the bit string   */
                                slen;                   /* Length of the input string             */
        bool            bit_not_hex;    /* false = hex string  true = bit string */
        int                     bc;
-       bits8           x = 0;
+       uint8           x = 0;
 
        /* Check that the first character is a b or an x */
        if (input_string[0] == 'b' || input_string[0] == 'B')
@@ -248,11 +248,11 @@ bit_in(PG_FUNCTION_ARGS)
                for (bc = 0; *sp; sp++)
                {
                        if (*sp >= '0' && *sp <= '9')
-                               x = (bits8) (*sp - '0');
+                               x = (uint8) (*sp - '0');
                        else if (*sp >= 'A' && *sp <= 'F')
-                               x = (bits8) (*sp - 'A') + 10;
+                               x = (uint8) (*sp - 'A') + 10;
                        else if (*sp >= 'a' && *sp <= 'f')
-                               x = (bits8) (*sp - 'a') + 10;
+                               x = (uint8) (*sp - 'a') + 10;
                        else
                                ereturn(escontext, (Datum) 0,
                                                (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
@@ -291,7 +291,7 @@ bit_out(PG_FUNCTION_ARGS)
        VarBit     *s = PG_GETARG_VARBIT_P(0);
        char       *result,
                           *r;
-       bits8      *sp;
+       uint8      *sp;
        int                     i,
                                len,
                                bitlen;
@@ -459,13 +459,13 @@ varbit_in(PG_FUNCTION_ARGS)
        Node       *escontext = fcinfo->context;
        VarBit     *result;                     /* The resulting bit string                       */
        char       *sp;                         /* pointer into the character string  */
-       bits8      *r;                          /* pointer into the result */
+       uint8      *r;                          /* pointer into the result */
        int                     len,                    /* Length of the whole data structure */
                                bitlen,                 /* Number of bits in the bit string   */
                                slen;                   /* Length of the input string             */
        bool            bit_not_hex;    /* false = hex string  true = bit string */
        int                     bc;
-       bits8           x = 0;
+       uint8           x = 0;
 
        /* Check that the first character is a b or an x */
        if (input_string[0] == 'b' || input_string[0] == 'B')
@@ -549,11 +549,11 @@ varbit_in(PG_FUNCTION_ARGS)
                for (bc = 0; *sp; sp++)
                {
                        if (*sp >= '0' && *sp <= '9')
-                               x = (bits8) (*sp - '0');
+                               x = (uint8) (*sp - '0');
                        else if (*sp >= 'A' && *sp <= 'F')
-                               x = (bits8) (*sp - 'A') + 10;
+                               x = (uint8) (*sp - 'A') + 10;
                        else if (*sp >= 'a' && *sp <= 'f')
-                               x = (bits8) (*sp - 'a') + 10;
+                               x = (uint8) (*sp - 'a') + 10;
                        else
                                ereturn(escontext, (Datum) 0,
                                                (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
@@ -589,8 +589,8 @@ varbit_out(PG_FUNCTION_ARGS)
        VarBit     *s = PG_GETARG_VARBIT_P(0);
        char       *result,
                           *r;
-       bits8      *sp;
-       bits8           x;
+       uint8      *sp;
+       uint8           x;
        int                     i,
                                k,
                                len;
@@ -982,7 +982,7 @@ bit_catenate(VarBit *arg1, VarBit *arg2)
                                bytelen,
                                bit1pad,
                                bit2shift;
-       bits8      *pr,
+       uint8      *pr,
                           *pa;
 
        bitlen1 = VARBITLEN(arg1);
@@ -1063,7 +1063,7 @@ bitsubstring(VarBit *arg, int32 s, int32 l, bool length_not_specified)
        int32           e,
                                s1,
                                e1;
-       bits8      *r,
+       uint8      *r,
                           *ps;
 
        bitlen = VARBITLEN(arg);
@@ -1249,7 +1249,7 @@ bit_and(PG_FUNCTION_ARGS)
                                bitlen1,
                                bitlen2,
                                i;
-       bits8      *p1,
+       uint8      *p1,
                           *p2,
                           *r;
 
@@ -1290,7 +1290,7 @@ bit_or(PG_FUNCTION_ARGS)
                                bitlen1,
                                bitlen2,
                                i;
-       bits8      *p1,
+       uint8      *p1,
                           *p2,
                           *r;
 
@@ -1330,7 +1330,7 @@ bitxor(PG_FUNCTION_ARGS)
                                bitlen1,
                                bitlen2,
                                i;
-       bits8      *p1,
+       uint8      *p1,
                           *p2,
                           *r;
 
@@ -1366,7 +1366,7 @@ bitnot(PG_FUNCTION_ARGS)
 {
        VarBit     *arg = PG_GETARG_VARBIT_P(0);
        VarBit     *result;
-       bits8      *p,
+       uint8      *p,
                           *r;
 
        result = (VarBit *) palloc(VARSIZE(arg));
@@ -1397,7 +1397,7 @@ bitshiftleft(PG_FUNCTION_ARGS)
        int                     byte_shift,
                                ishift,
                                len;
-       bits8      *p,
+       uint8      *p,
                           *r;
 
        /* Negative shift is a shift to the right */
@@ -1464,7 +1464,7 @@ bitshiftright(PG_FUNCTION_ARGS)
        int                     byte_shift,
                                ishift,
                                len;
-       bits8      *p,
+       uint8      *p,
                           *r;
 
        /* Negative shift is a shift to the left */
@@ -1533,7 +1533,7 @@ bitfromint4(PG_FUNCTION_ARGS)
        int32           a = PG_GETARG_INT32(0);
        int32           typmod = PG_GETARG_INT32(1);
        VarBit     *result;
-       bits8      *r;
+       uint8      *r;
        int                     rlen;
        int                     destbitsleft,
                                srcbitsleft;
@@ -1554,7 +1554,7 @@ bitfromint4(PG_FUNCTION_ARGS)
        /* sign-fill any excess bytes in output */
        while (destbitsleft >= srcbitsleft + 8)
        {
-               *r++ = (bits8) ((a < 0) ? BITMASK : 0);
+               *r++ = (uint8) ((a < 0) ? BITMASK : 0);
                destbitsleft -= 8;
        }
        /* store first fractional byte */
@@ -1565,19 +1565,19 @@ bitfromint4(PG_FUNCTION_ARGS)
                /* Force sign-fill in case the compiler implements >> as zero-fill */
                if (a < 0)
                        val |= ((unsigned int) -1) << (srcbitsleft + 8 - destbitsleft);
-               *r++ = (bits8) (val & BITMASK);
+               *r++ = (uint8) (val & BITMASK);
                destbitsleft -= 8;
        }
        /* Now srcbitsleft and destbitsleft are the same, need not track both */
        /* store whole bytes */
        while (destbitsleft >= 8)
        {
-               *r++ = (bits8) ((a >> (destbitsleft - 8)) & BITMASK);
+               *r++ = (uint8) ((a >> (destbitsleft - 8)) & BITMASK);
                destbitsleft -= 8;
        }
        /* store last fractional byte */
        if (destbitsleft > 0)
-               *r = (bits8) ((a << (8 - destbitsleft)) & BITMASK);
+               *r = (uint8) ((a << (8 - destbitsleft)) & BITMASK);
 
        PG_RETURN_VARBIT_P(result);
 }
@@ -1587,7 +1587,7 @@ bittoint4(PG_FUNCTION_ARGS)
 {
        VarBit     *arg = PG_GETARG_VARBIT_P(0);
        uint32          result;
-       bits8      *r;
+       uint8      *r;
 
        /* Check that the bit string is not too long */
        if (VARBITLEN(arg) > sizeof(result) * BITS_PER_BYTE)
@@ -1613,7 +1613,7 @@ bitfromint8(PG_FUNCTION_ARGS)
        int64           a = PG_GETARG_INT64(0);
        int32           typmod = PG_GETARG_INT32(1);
        VarBit     *result;
-       bits8      *r;
+       uint8      *r;
        int                     rlen;
        int                     destbitsleft,
                                srcbitsleft;
@@ -1634,7 +1634,7 @@ bitfromint8(PG_FUNCTION_ARGS)
        /* sign-fill any excess bytes in output */
        while (destbitsleft >= srcbitsleft + 8)
        {
-               *r++ = (bits8) ((a < 0) ? BITMASK : 0);
+               *r++ = (uint8) ((a < 0) ? BITMASK : 0);
                destbitsleft -= 8;
        }
        /* store first fractional byte */
@@ -1645,19 +1645,19 @@ bitfromint8(PG_FUNCTION_ARGS)
                /* Force sign-fill in case the compiler implements >> as zero-fill */
                if (a < 0)
                        val |= ((unsigned int) -1) << (srcbitsleft + 8 - destbitsleft);
-               *r++ = (bits8) (val & BITMASK);
+               *r++ = (uint8) (val & BITMASK);
                destbitsleft -= 8;
        }
        /* Now srcbitsleft and destbitsleft are the same, need not track both */
        /* store whole bytes */
        while (destbitsleft >= 8)
        {
-               *r++ = (bits8) ((a >> (destbitsleft - 8)) & BITMASK);
+               *r++ = (uint8) ((a >> (destbitsleft - 8)) & BITMASK);
                destbitsleft -= 8;
        }
        /* store last fractional byte */
        if (destbitsleft > 0)
-               *r = (bits8) ((a << (8 - destbitsleft)) & BITMASK);
+               *r = (uint8) ((a << (8 - destbitsleft)) & BITMASK);
 
        PG_RETURN_VARBIT_P(result);
 }
@@ -1667,7 +1667,7 @@ bittoint8(PG_FUNCTION_ARGS)
 {
        VarBit     *arg = PG_GETARG_VARBIT_P(0);
        uint64          result;
-       bits8      *r;
+       uint8      *r;
 
        /* Check that the bit string is not too long */
        if (VARBITLEN(arg) > sizeof(result) * BITS_PER_BYTE)
@@ -1703,9 +1703,9 @@ bitposition(PG_FUNCTION_ARGS)
                                str_length,
                                i,
                                is;
-       bits8      *s,                          /* pointer into substring */
+       uint8      *s,                          /* pointer into substring */
                           *p;                          /* pointer into str */
-       bits8           cmp,                    /* shifted substring byte to compare */
+       uint8           cmp,                    /* shifted substring byte to compare */
                                mask1,                  /* mask for substring byte shifted right */
                                mask2,                  /* mask for substring byte shifted left */
                                end_mask,               /* pad mask for last substring byte */
@@ -1812,7 +1812,7 @@ bitsetbit(PG_FUNCTION_ARGS)
        VarBit     *result;
        int                     len,
                                bitlen;
-       bits8      *r,
+       uint8      *r,
                           *p;
        int                     byteNo,
                                bitNo;
@@ -1871,7 +1871,7 @@ bitgetbit(PG_FUNCTION_ARGS)
        VarBit     *arg1 = PG_GETARG_VARBIT_P(0);
        int32           n = PG_GETARG_INT32(1);
        int                     bitlen;
-       bits8      *p;
+       uint8      *p;
        int                     byteNo,
                                bitNo;
 
index 7b1ee61bde60142c2bbe2059308698267b7e1de9..ecad6d6218401ddc460aa6957410fc1c122c8e63 100644 (file)
@@ -3952,7 +3952,7 @@ array_to_text_internal(FunctionCallInfo fcinfo, ArrayType *v,
        StringInfoData buf;
        bool            printed = false;
        char       *p;
-       bits8      *bitmap;
+       uint8      *bitmap;
        int                     bitmask;
        int                     i;
        ArrayMetaState *my_extra;
index 516d02cfb82a3ce8c39a5393c599e880f3999178..6f0785067b8a62c78386e70a02a653fdbda8e9d6 100644 (file)
@@ -73,7 +73,7 @@ static TypeFuncClass get_type_func_class(Oid typid, Oid *base_typeid);
  * RECORD datatype.
  */
 void
-InitMaterializedSRF(FunctionCallInfo fcinfo, bits32 flags)
+InitMaterializedSRF(FunctionCallInfo fcinfo, uint32 flags)
 {
        bool            random_access;
        ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
index 26118661f07acf08d604450f92d1eda2d647abdc..577ef5effbb4637d4df045dfb3f5b04297042ac8 100644 (file)
@@ -718,7 +718,7 @@ BaseInit(void)
 void
 InitPostgres(const char *in_dbname, Oid dboid,
                         const char *username, Oid useroid,
-                        bits32 flags,
+                        uint32 flags,
                         char *out_dbname)
 {
        bool            bootstrap = IsBootstrapProcessingMode();
index 44c10a71d29d6219bd6136cdeda82c5a15258d4a..37631f700af9ae52a1e1abefe048448113cc35d9 100644 (file)
@@ -94,7 +94,7 @@ struct LogicalRepInfos
 {
        struct LogicalRepInfo *dbinfo;
        bool            two_phase;              /* enable-two-phase option */
-       bits32          objecttypes_to_clean;   /* flags indicating which object types
+       uint32          objecttypes_to_clean;   /* flags indicating which object types
                                                                                 * to clean up on subscriber */
 };
 
index 523d3f39fc543bb02e24d37e517c1cebb40265e1..adcff1f6ffb57870cbbe083bcf5f3695409ae3c8 100644 (file)
@@ -1296,7 +1296,7 @@ typedef struct
        const VersionedQuery *vquery;   /* versioned query, or NULL */
        const SchemaQuery *squery;      /* schema query, or NULL */
        const char *const *keywords;    /* keywords to be offered as well */
-       const bits32 flags;                     /* visibility flags, see below */
+       const uint32 flags;                     /* visibility flags, see below */
 } pgsql_thing_t;
 
 #define THING_NO_CREATE                (1 << 0)        /* should not show up after CREATE */
@@ -5839,7 +5839,7 @@ match_previous_words(int pattern_id,
  * Entries that have 'excluded' flags are not returned.
  */
 static char *
-create_or_drop_command_generator(const char *text, int state, bits32 excluded)
+create_or_drop_command_generator(const char *text, int state, uint32 excluded)
 {
        static int      list_index,
                                string_length;
index e0c4dd7086ca63cdd1851a19afb89972d46096d0..ccc7f88a2917a13a1c7ab95b00720aa86fd50601 100644 (file)
@@ -20,7 +20,7 @@
 #include "vacuuming.h"
 
 static void help(const char *progname);
-static void check_objfilter(bits32 objfilter);
+static void check_objfilter(uint32 objfilter);
 
 
 int
@@ -322,7 +322,7 @@ main(int argc, char *argv[])
  * Verify that the filters used at command line are compatible.
  */
 void
-check_objfilter(bits32 objfilter)
+check_objfilter(uint32 objfilter)
 {
        if ((objfilter & OBJFILTER_ALL_DBS) &&
                (objfilter & OBJFILTER_DATABASE))
index be4a75ef2f4e7110297ba3fc31b99b70b6a8e17d..5a491db2526d7eac61d221ba08f03f6fc5f74db0 100644 (file)
@@ -32,7 +32,7 @@ typedef enum
 typedef struct vacuumingOptions
 {
        RunMode         mode;
-       bits32          objfilter;
+       uint32          objfilter;
        bool            verbose;
        bool            and_analyze;
        bool            full;
index 75f8b159b8aefb6db01a2a3ed48c945af6d6d0f9..77a6c48fd711ab25c0dc4ea581a9c75ea829ea6d 100644 (file)
@@ -175,7 +175,7 @@ struct HeapTupleHeaderData
        /* ^ - 23 bytes - ^ */
 
 #define FIELDNO_HEAPTUPLEHEADERDATA_BITS 5
-       bits8           t_bits[FLEXIBLE_ARRAY_MEMBER];  /* bitmap of NULLs */
+       uint8           t_bits[FLEXIBLE_ARRAY_MEMBER];  /* bitmap of NULLs */
 
        /* MORE DATA FOLLOWS AT END OF STRUCT */
 };
@@ -680,7 +680,7 @@ struct MinimalTupleData
 
        /* ^ - 23 bytes - ^ */
 
-       bits8           t_bits[FLEXIBLE_ARRAY_MEMBER];  /* bitmap of NULLs */
+       uint8           t_bits[FLEXIBLE_ARRAY_MEMBER];  /* bitmap of NULLs */
 
        /* MORE DATA FOLLOWS AT END OF STRUCT */
 };
@@ -797,7 +797,7 @@ extern Size heap_compute_data_size(TupleDesc tupleDesc,
 extern void heap_fill_tuple(TupleDesc tupleDesc,
                                                        const Datum *values, const bool *isnull,
                                                        char *data, Size data_size,
-                                                       uint16 *infomask, bits8 *bit);
+                                                       uint16 *infomask, uint8 *bit);
 extern bool heap_attisnull(HeapTuple tup, int attnum, TupleDesc tupleDesc);
 extern Datum nocachegetattr(HeapTuple tup, int attnum,
                                                        TupleDesc tupleDesc);
index 57e4daafb0db5e0c9f7bd8232c95553884a36d5c..5758bbdf6eb4c4a69a72662f1b916fe1d2eecdbf 100644 (file)
@@ -54,7 +54,7 @@ typedef IndexTupleData *IndexTuple;
 
 typedef struct IndexAttributeBitMapData
 {
-       bits8           bits[(INDEX_MAX_KEYS + 8 - 1) / 8];
+       uint8           bits[(INDEX_MAX_KEYS + 8 - 1) / 8];
 }                      IndexAttributeBitMapData;
 
 typedef IndexAttributeBitMapData * IndexAttributeBitMap;
@@ -99,7 +99,7 @@ extern void index_deform_tuple(IndexTuple tup, TupleDesc tupleDescriptor,
                                                           Datum *values, bool *isnull);
 extern void index_deform_tuple_internal(TupleDesc tupleDescriptor,
                                                                                Datum *values, bool *isnull,
-                                                                               char *tp, bits8 *bp, int hasnulls);
+                                                                               char *tp, uint8 *bp, int hasnulls);
 extern IndexTuple CopyIndexTuple(IndexTuple source);
 extern IndexTuple index_truncate_tuple(TupleDesc sourceDescriptor,
                                                                           IndexTuple source, int leavenatts);
@@ -151,7 +151,7 @@ index_getattr(IndexTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
        }
        else
        {
-               if (att_isnull(attnum - 1, (bits8 *) tup + sizeof(IndexTupleData)))
+               if (att_isnull(attnum - 1, (uint8 *) tup + sizeof(IndexTupleData)))
                {
                        *isnull = true;
                        return (Datum) 0;
index c228147420a94faec6f77af4c0cc2f747d298364..e8cb7f7a6277e4add44434f6a87e3cc04a836483 100644 (file)
@@ -66,7 +66,7 @@ typedef struct relopt_gen
        const char *name;                       /* must be first (used as list termination
                                                                 * marker) */
        const char *desc;
-       bits32          kinds;
+       uint32          kinds;
        LOCKMODE        lockmode;
        int                     namelen;
        relopt_type type;
@@ -187,20 +187,20 @@ typedef struct local_relopts
         (char *)(optstruct) + (optstruct)->member)
 
 extern relopt_kind add_reloption_kind(void);
-extern void add_bool_reloption(bits32 kinds, const char *name, const char *desc,
+extern void add_bool_reloption(uint32 kinds, const char *name, const char *desc,
                                                           bool default_val, LOCKMODE lockmode);
-extern void add_ternary_reloption(bits32 kinds, const char *name,
+extern void add_ternary_reloption(uint32 kinds, const char *name,
                                                                  const char *desc, LOCKMODE lockmode);
-extern void add_int_reloption(bits32 kinds, const char *name, const char *desc,
+extern void add_int_reloption(uint32 kinds, const char *name, const char *desc,
                                                          int default_val, int min_val, int max_val,
                                                          LOCKMODE lockmode);
-extern void add_real_reloption(bits32 kinds, const char *name, const char *desc,
+extern void add_real_reloption(uint32 kinds, const char *name, const char *desc,
                                                           double default_val, double min_val, double max_val,
                                                           LOCKMODE lockmode);
-extern void add_enum_reloption(bits32 kinds, const char *name, const char *desc,
+extern void add_enum_reloption(uint32 kinds, const char *name, const char *desc,
                                                           relopt_enum_elt_def *members, int default_val,
                                                           const char *detailmsg, LOCKMODE lockmode);
-extern void add_string_reloption(bits32 kinds, const char *name, const char *desc,
+extern void add_string_reloption(uint32 kinds, const char *name, const char *desc,
                                                                 const char *default_val, validate_string_relopt validator,
                                                                 LOCKMODE lockmode);
 
index a447b41c128c1e8a22160935891246549cddaacd..fa76d0f2eaca13ffe15de76238ee22419826b18e 100644 (file)
@@ -25,7 +25,7 @@
  * non-null.
  */
 static inline bool
-att_isnull(int ATT, const bits8 *BITS)
+att_isnull(int ATT, const uint8 *BITS)
 {
        return !(BITS[ATT >> 3] & (1 << (ATT & 0x07)));
 }
@@ -40,7 +40,7 @@ att_isnull(int ATT, const bits8 *BITS)
  * effectively as if natts is rounded up to the next multiple of 8.
  */
 static inline void
-populate_isnull_array(const bits8 *bits, int natts, bool *isnull)
+populate_isnull_array(const uint8 *bits, int natts, bool *isnull)
 {
        int                     nbytes = (natts + 7) >> 3;
 
@@ -60,7 +60,7 @@ populate_isnull_array(const bits8 *bits, int natts, bool *isnull)
        for (int i = 0; i < nbytes; i++, isnull += 8)
        {
                uint64          isnull_8;
-               bits8           nullbyte = ~bits[i];
+               uint8           nullbyte = ~bits[i];
 
                /* Convert the lower 4 bits of NULL bitmap word into a 64 bit int */
                isnull_8 = (nullbyte & 0xf) * SPREAD_BITS_MULTIPLIER_32;
@@ -241,7 +241,7 @@ align_fetch_then_add(const char *tupptr, uint32 *off, bool attbyval, int attlen,
  * case.
  */
 static inline int
-first_null_attr(const bits8 *bits, int natts)
+first_null_attr(const uint8 *bits, int natts)
 {
        int                     nattByte = natts >> 3;
        int                     bytenum;
index fd6b093bb3a7a75f51c28d22be8b7c345faf225d..0b2eb9ce8661705ba04ea4e201ac36d9e962b339 100644 (file)
@@ -618,14 +618,6 @@ typedef uint16_t uint16;
 typedef uint32_t uint32;
 typedef uint64_t uint64;
 
-/*
- * bitsN
- *             Unit of bitwise operation, AT LEAST N BITS IN SIZE.
- */
-typedef uint8 bits8;                   /* >= 8 bits */
-typedef uint16 bits16;                 /* >= 16 bits */
-typedef uint32 bits32;                 /* >= 32 bits */
-
 /*
  * 64-bit integers
  */
index 36b7068925440ab6782ccbc7e3021022eb36bb59..a38e95bc0eb59c6a932ff1c6f3080dc6d9b5780e 100644 (file)
@@ -38,7 +38,7 @@ typedef enum
 /* options for REINDEX */
 typedef struct ReindexParams
 {
-       bits32          options;                /* bitmask of REINDEXOPT_* */
+       uint32          options;                /* bitmask of REINDEXOPT_* */
        Oid                     tablespaceOid;  /* New tablespace to move indexes to.
                                                                 * InvalidOid to do nothing. */
 } ReindexParams;
@@ -88,8 +88,8 @@ extern Oid    index_create(Relation heapRelation,
                                                 const int16 *coloptions,
                                                 const NullableDatum *stattargets,
                                                 Datum reloptions,
-                                                bits16 flags,
-                                                bits16 constr_flags,
+                                                uint16 flags,
+                                                uint16 constr_flags,
                                                 bool allow_system_table_mods,
                                                 bool is_internal,
                                                 Oid *constraintId);
@@ -122,7 +122,7 @@ extern ObjectAddress index_constraint_create(Relation heapRelation,
                                                                                         const IndexInfo *indexInfo,
                                                                                         const char *constraintName,
                                                                                         char constraintType,
-                                                                                        bits16 constr_flags,
+                                                                                        uint16 constr_flags,
                                                                                         bool allow_system_table_mods,
                                                                                         bool is_internal);
 
index c79cd2d0e19e5d511dfbe28e98b734a71b9cf410..d6b62c747e8db864d5d0769a618d8d410106812b 100644 (file)
@@ -29,7 +29,7 @@
 /* options for CLUSTER */
 typedef struct ClusterParams
 {
-       bits32          options;                /* bitmask of CLUOPT_* */
+       uint32          options;                /* bitmask of CLUOPT_* */
 } ClusterParams;
 
 
index 1f45bca015cf33185f08bade6ca2aa3fe19a2de4..5d351f0df33388074f23ca593450a4cf8d7355f3 100644 (file)
@@ -215,7 +215,7 @@ typedef enum VacOptValue
  */
 typedef struct VacuumParams
 {
-       bits32          options;                /* bitmask of VACOPT_* */
+       uint32          options;                /* bitmask of VACOPT_* */
        int                     freeze_min_age; /* min freeze age, -1 to use default */
        int                     freeze_table_age;       /* age at which to scan whole table */
        int                     multixact_freeze_min_age;       /* min multixact freeze age, -1 to
@@ -389,9 +389,9 @@ extern bool vacuum_xid_failsafe_check(const struct VacuumCutoffs *cutoffs);
 extern void vac_update_datfrozenxid(void);
 extern void vacuum_delay_point(bool is_analyze);
 extern bool vacuum_is_permitted_for_relation(Oid relid, Form_pg_class reltuple,
-                                                                                        bits32 options);
+                                                                                        uint32 options);
 extern Relation vacuum_open_relation(Oid relid, RangeVar *relation,
-                                                                        bits32 options, bool verbose,
+                                                                        uint32 options, bool verbose,
                                                                         LOCKMODE lmode);
 extern IndexBulkDeleteResult *vac_bulkdel_one_index(IndexVacuumInfo *ivinfo,
                                                                                                        IndexBulkDeleteResult *istat,
index 71310c85f2e307b148a743cfb4d0374b0197a0f7..85cc9a11d974495ed850ca662420954d87a257e5 100644 (file)
@@ -108,7 +108,7 @@ typedef struct JsonLexContext
        bool            incremental;
        JsonTokenType token_type;
        int                     lex_level;
-       bits32          flags;
+       uint32          flags;
        int                     line_number;    /* line number, starting from 1 */
        const char *line_start;         /* where that line starts within input */
        JsonParserStack *pstack;
index 7979a17e4ec79a42de84630c9a0bdf7c56453483..491c48865066a52af6e15544e4d6b8dc995ce90b 100644 (file)
@@ -751,7 +751,7 @@ extern void ExecCloseIndices(ResultRelInfo *resultRelInfo);
 #define                EIIT_NO_DUPE_ERROR              (1<<1)
 #define                EIIT_ONLY_SUMMARIZING   (1<<2)
 extern List *ExecInsertIndexTuples(ResultRelInfo *resultRelInfo, EState *estate,
-                                                                  bits32 options, TupleTableSlot *slot,
+                                                                  uint32 options, TupleTableSlot *slot,
                                                                   List *arbiterIndexes,
                                                                   bool *specConflict);
 extern bool ExecCheckIndexConstraints(ResultRelInfo *resultRelInfo,
index 8847d7f94fa57f5bfa385bc6398145bd087b7c2e..2a0ff377a73128a840bbd4bf459b54eb1acbc7db 100644 (file)
@@ -192,7 +192,7 @@ typedef struct IncrementalSortGroupInfo
        int64           totalDiskSpaceUsed;
        int64           maxMemorySpaceUsed;
        int64           totalMemorySpaceUsed;
-       bits32          sortMethods;    /* bitmask of TuplesortMethod */
+       uint32          sortMethods;    /* bitmask of TuplesortMethod */
 } IncrementalSortGroupInfo;
 
 typedef struct IncrementalSortInfo
index 564c3cc1b7f54afb0c2657dce9345bc904eeb7ad..92a55214feeb849d5261288636ad4c98e31d77b1 100644 (file)
@@ -67,7 +67,7 @@ typedef struct ForeignTable
 
 extern ForeignServer *GetForeignServer(Oid serverid);
 extern ForeignServer *GetForeignServerExtended(Oid serverid,
-                                                                                          bits16 flags);
+                                                                                          uint16 flags);
 extern ForeignServer *GetForeignServerByName(const char *srvname,
                                                                                         bool missing_ok);
 extern char *ForeignServerConnectionString(Oid userid,
@@ -75,7 +75,7 @@ extern char *ForeignServerConnectionString(Oid userid,
 extern UserMapping *GetUserMapping(Oid userid, Oid serverid);
 extern ForeignDataWrapper *GetForeignDataWrapper(Oid fdwid);
 extern ForeignDataWrapper *GetForeignDataWrapperExtended(Oid fdwid,
-                                                                                                                bits16 flags);
+                                                                                                                uint16 flags);
 extern ForeignDataWrapper *GetForeignDataWrapperByName(const char *fdwname,
                                                                                                           bool missing_ok);
 extern ForeignTable *GetForeignTable(Oid relid);
index eb119d9854ffb88fc714a654bab5572aaa58f0d1..a31d6857a35558a846d16e66c71ae7caecef57cc 100644 (file)
@@ -296,7 +296,7 @@ HeapTupleGetDatum(const HeapTupleData *tuple)
 #define MAT_SRF_USE_EXPECTED_DESC      0x01    /* use expectedDesc as tupdesc. */
 #define MAT_SRF_BLESS                          0x02    /* "Bless" a tuple descriptor with
                                                                                         * BlessTupleDesc(). */
-extern void InitMaterializedSRF(FunctionCallInfo fcinfo, bits32 flags);
+extern void InitMaterializedSRF(FunctionCallInfo fcinfo, uint32 flags);
 
 extern FuncCallContext *init_MultiFuncCall(PG_FUNCTION_ARGS);
 extern FuncCallContext *per_MultiFuncCall(PG_FUNCTION_ARGS);
index f16f35659b9be88be6aa931f80b1cb6a6d7c14a1..04f29748be7a520c569813202657a0757018154b 100644 (file)
@@ -504,7 +504,7 @@ extern void InitializeMaxBackends(void);
 extern void InitializeFastPathLocks(void);
 extern void InitPostgres(const char *in_dbname, Oid dboid,
                                                 const char *username, Oid useroid,
-                                                bits32 flags,
+                                                uint32 flags,
                                                 char *out_dbname);
 extern void BaseInit(void);
 extern void StoreConnectionWarning(char *msg, char *detail);
index df431220ac537a112e2c87a515bf39f854966107..a501cdfb249cc0a22a56528091e24adf4868fd08 100644 (file)
@@ -793,7 +793,7 @@ typedef struct TableLikeClause
 {
        NodeTag         type;
        RangeVar   *relation;
-       bits32          options;                /* OR of TableLikeOption flags */
+       uint32          options;                /* OR of TableLikeOption flags */
        Oid                     relationOid;    /* If table has been looked up, its OID */
 } TableLikeClause;
 
index 0bca559caaa1ef03af777353588db569f5e7c75a..7a00d197013baf3fd6c3ae50dbe74d01e59737a9 100644 (file)
@@ -277,7 +277,7 @@ pg_ceil_log2_64(uint64 num)
 }
 
 extern uint64 pg_popcount_portable(const char *buf, int bytes);
-extern uint64 pg_popcount_masked_portable(const char *buf, int bytes, bits8 mask);
+extern uint64 pg_popcount_masked_portable(const char *buf, int bytes, uint8 mask);
 
 #if defined(HAVE_X86_64_POPCNTQ) || defined(USE_SVE_POPCNT_WITH_RUNTIME_CHECK)
 /*
@@ -285,12 +285,12 @@ extern uint64 pg_popcount_masked_portable(const char *buf, int bytes, bits8 mask
  * first.
  */
 extern PGDLLIMPORT uint64 (*pg_popcount_optimized) (const char *buf, int bytes);
-extern PGDLLIMPORT uint64 (*pg_popcount_masked_optimized) (const char *buf, int bytes, bits8 mask);
+extern PGDLLIMPORT uint64 (*pg_popcount_masked_optimized) (const char *buf, int bytes, uint8 mask);
 
 #else
 /* Use a portable implementation -- no need for a function pointer. */
 extern uint64 pg_popcount_optimized(const char *buf, int bytes);
-extern uint64 pg_popcount_masked_optimized(const char *buf, int bytes, bits8 mask);
+extern uint64 pg_popcount_masked_optimized(const char *buf, int bytes, uint8 mask);
 
 #endif
 
@@ -369,7 +369,7 @@ pg_popcount(const char *buf, int bytes)
  * it's likely to be faster.
  */
 static inline uint64
-pg_popcount_masked(const char *buf, int bytes, bits8 mask)
+pg_popcount_masked(const char *buf, int bytes, uint8 mask)
 {
        /*
         * We set the threshold to the point at which we'll first use special
index 9000a45cd13488065c0ece4fce9ff864a2ceefa9..30c4b2daf3f660d98b82e1d80916ffabeec6c973 100644 (file)
@@ -46,7 +46,7 @@ typedef struct
        char            nuls[2];                /* always \0\0 */
        uint16          len;                    /* size of this chunk (counts data only) */
        int32           pid;                    /* writer's pid */
-       bits8           flags;                  /* bitmask of PIPE_PROTO_* */
+       uint8           flags;                  /* bitmask of PIPE_PROTO_* */
        char            data[FLEXIBLE_ARRAY_MEMBER];    /* data payload starts here */
 } PipeProtoHeader;
 
index 2d717a9e1527a6ecf1dde300b5f7546337f4fd6e..ff825e4b7b2385a19c77eb620e140d552db34001 100644 (file)
@@ -293,7 +293,7 @@ typedef struct ReorderBufferChange
 typedef struct ReorderBufferTXN
 {
        /* See above */
-       bits32          txn_flags;
+       uint32          txn_flags;
 
        /* The transaction's transaction id, can be a toplevel or sub xid. */
        TransactionId xid;
index 5de674d54108cc21634cd88b4674a0127a5f7d62..b0c80deeb24de7b29d236edfa4cd2c799f9b0a67 100644 (file)
@@ -100,7 +100,7 @@ typedef struct
         * can't reload the config file safely, so checkpointer updates this value
         * as needed. Protected by SyncRepLock.
         */
-       bits8           sync_standbys_status;
+       uint8           sync_standbys_status;
 
        /* used as a registry of physical / logical walsenders to wake */
        ConditionVariable wal_flush_cv;
index d0b6d8786a304307f07fa1b5388add4b1dea772f..88e4f4d70d8e476317ada934eafea0bab4b0009a 100644 (file)
@@ -206,7 +206,7 @@ typedef struct ArrayBuildStateArr
 {
        MemoryContext mcontext;         /* where all the temp stuff is kept */
        char       *data;                       /* accumulated data */
-       bits8      *nullbitmap;         /* bitmap of is-null flags, or NULL if none */
+       uint8      *nullbitmap;         /* bitmap of is-null flags, or NULL if none */
        int                     abytes;                 /* allocated length of "data" */
        int                     nbytes;                 /* number of bytes used so far */
        int                     aitems;                 /* allocated length of bitmap (in elements) */
@@ -299,9 +299,9 @@ typedef struct ArrayIteratorData *ArrayIterator;
 
 #define ARR_NULLBITMAP(a) \
                (ARR_HASNULL(a) ? \
-                (bits8 *) (((char *) (a)) + sizeof(ArrayType) + \
+                (uint8 *) (((char *) (a)) + sizeof(ArrayType) + \
                                        2 * sizeof(int) * ARR_NDIM(a)) \
-                : (bits8 *) NULL)
+                : (uint8 *) NULL)
 
 /*
  * The total array header size (in bytes) for an array with the specified
@@ -387,8 +387,8 @@ extern Datum array_map(Datum arrayd,
                                           ExprState *exprstate, ExprContext *econtext,
                                           Oid retType, ArrayMapState *amstate);
 
-extern void array_bitmap_copy(bits8 *destbitmap, int destoffset,
-                                                         const bits8 *srcbitmap, int srcoffset,
+extern void array_bitmap_copy(uint8 *destbitmap, int destoffset,
+                                                         const uint8 *srcbitmap, int srcoffset,
                                                          int nitems);
 
 extern ArrayType *construct_array(Datum *elems, int nelems,
index a325ae52574d8fc47ae492c958d2f4091495a31b..b983014ab0f0715d02aadf4fc328d52d4a35ee73 100644 (file)
@@ -40,7 +40,7 @@ typedef struct array_iter
 
        /* Fields used when we have a flat array */
        char       *dataptr;            /* Current spot in the data area */
-       bits8      *bitmapptr;          /* Current byte of the nulls bitmap, or NULL */
+       uint8      *bitmapptr;          /* Current byte of the nulls bitmap, or NULL */
        int                     bitmask;                /* mask for current bit in nulls bitmap */
 
        /* Fields used in both cases: data about array's element type */
index 5dcd788ff8080c0336dd3a76faa8e1dcd515c047..b6a11bfa2883250b462b73936c8fc90751cd60f5 100644 (file)
@@ -126,7 +126,7 @@ extern Datum numeric_float8_no_overflow(PG_FUNCTION_ARGS);
 #define FORMAT_TYPE_ALLOW_INVALID      0x02    /* allow invalid types */
 #define FORMAT_TYPE_FORCE_QUALIFY      0x04    /* force qualification of type */
 #define FORMAT_TYPE_INVALID_AS_NULL    0x08    /* NULL if undefined */
-extern char *format_type_extended(Oid type_oid, int32 typemod, bits16 flags);
+extern char *format_type_extended(Oid type_oid, int32 typemod, uint16 flags);
 
 extern char *format_type_be(Oid type_oid);
 extern char *format_type_be_qualified(Oid type_oid);
index 97704421a92d8e354b3e7c033f6fdfd1545ccc6a..eed4c6b359c6cea306aa4f86c22b4c9f69b0b57e 100644 (file)
@@ -709,7 +709,7 @@ extern void pgstat_archiver_snapshot_cb(void);
 #define PGSTAT_BACKEND_FLUSH_WAL   (1 << 1) /* Flush WAL statistics */
 #define PGSTAT_BACKEND_FLUSH_ALL   (PGSTAT_BACKEND_FLUSH_IO | PGSTAT_BACKEND_FLUSH_WAL)
 
-extern bool pgstat_flush_backend(bool nowait, bits32 flags);
+extern bool pgstat_flush_backend(bool nowait, uint32 flags);
 extern bool pgstat_backend_flush_cb(bool nowait);
 extern void pgstat_backend_reset_timestamp_cb(PgStatShared_Common *header,
                                                                                          TimestampTz ts);
index 10681896a813f5e1a40ce67d69d131bd7710707e..fd7e391519e944fc7c5227027bcd8aa84b0aa9ec 100644 (file)
 /* Control flags for format_procedure_extended */
 #define FORMAT_PROC_INVALID_AS_NULL    0x01    /* NULL if undefined */
 #define FORMAT_PROC_FORCE_QUALIFY      0x02    /* force qualification */
-extern char *format_procedure_extended(Oid procedure_oid, bits16 flags);
+extern char *format_procedure_extended(Oid procedure_oid, uint16 flags);
 
 /* Control flags for format_operator_extended */
 #define FORMAT_OPERATOR_INVALID_AS_NULL        0x01    /* NULL if undefined */
 #define FORMAT_OPERATOR_FORCE_QUALIFY  0x02    /* force qualification */
-extern char *format_operator_extended(Oid operator_oid, bits16 flags);
+extern char *format_operator_extended(Oid operator_oid, uint16 flags);
 
 extern List *stringToQualifiedNameList(const char *string, Node *escontext);
 extern char *format_procedure(Oid procedure_oid);
index 908b2708ed497980ff41600bab418738cb17a952..059e6474f3bb10532e95d1c602b19d1626271a00 100644 (file)
@@ -27,7 +27,7 @@ typedef struct PlannedStmt PlannedStmt;
 extern char *pg_get_indexdef_string(Oid indexrelid);
 extern char *pg_get_indexdef_columns(Oid indexrelid, bool pretty);
 extern char *pg_get_indexdef_columns_extended(Oid indexrelid,
-                                                                                         bits16 flags);
+                                                                                         uint16 flags);
 extern char *pg_get_querydef(Query *query, bool pretty);
 
 extern char *pg_get_partkeydef_columns(Oid relid, bool pretty);
index 20cb14d75b0c752627953df9e346f7c0c49114ea..8e2b981e1f62d7c2cacce70f4bbf6229c4eb7076 100644 (file)
@@ -20,7 +20,7 @@
 #include "fmgr.h"
 
 /*
- * Modeled on varlena from c.h, but data type is bits8.
+ * Modeled on varlena from c.h, but data type is uint8.
  *
  * Caution: if bit_len is not a multiple of BITS_PER_BYTE, the low-order
  * bits of the last byte of bit_dat[] are unused and MUST be zeroes.
@@ -31,7 +31,7 @@ typedef struct
 {
        int32           vl_len_;                /* varlena header (do not touch directly!) */
        int32           bit_len;                /* number of valid bits */
-       bits8           bit_dat[FLEXIBLE_ARRAY_MEMBER]; /* bit string, most sig. byte
+       uint8           bit_dat[FLEXIBLE_ARRAY_MEMBER]; /* bit string, most sig. byte
                                                                                                 * first */
 } VarBit;
 
@@ -82,7 +82,7 @@ VarBitPGetDatum(const VarBit *X)
  */
 #define VARBITMAXLEN           (INT_MAX - BITS_PER_BYTE + 1)
 /* pointer beyond the end of the bit string (like end() in STL containers) */
-#define VARBITEND(PTR)         (((bits8 *) (PTR)) + VARSIZE(PTR))
+#define VARBITEND(PTR)         (((uint8 *) (PTR)) + VARSIZE(PTR))
 /* Mask that will cover exactly one byte, i.e. BITS_PER_BYTE bits */
 #define BITMASK 0xFF
 
index 44055de6aeb6d266303e93bee896f97f3ab636b6..92d55bf9f423e17e5ce7e501a4d6609023b0e43d 100644 (file)
@@ -35,7 +35,7 @@ static PyObject *PLyUnicode_FromScalar(PLyDatumToOb *arg, Datum d);
 static PyObject *PLyObject_FromTransform(PLyDatumToOb *arg, Datum d);
 static PyObject *PLyList_FromArray(PLyDatumToOb *arg, Datum d);
 static PyObject *PLyList_FromArray_recurse(PLyDatumToOb *elm, int *dims, int ndim, int dim,
-                                                                                  char **dataptr_p, bits8 **bitmap_p, int *bitmask_p);
+                                                                                  char **dataptr_p, uint8 **bitmap_p, int *bitmask_p);
 static PyObject *PLyDict_FromComposite(PLyDatumToOb *arg, Datum d);
 static PyObject *PLyDict_FromTuple(PLyDatumToOb *arg, HeapTuple tuple, TupleDesc desc, bool include_generated);
 
@@ -671,7 +671,7 @@ PLyList_FromArray(PLyDatumToOb *arg, Datum d)
        int                     ndim;
        int                *dims;
        char       *dataptr;
-       bits8      *bitmap;
+       uint8      *bitmap;
        int                     bitmask;
 
        if (ARR_NDIM(array) == 0)
@@ -705,7 +705,7 @@ PLyList_FromArray(PLyDatumToOb *arg, Datum d)
 
 static PyObject *
 PLyList_FromArray_recurse(PLyDatumToOb *elm, int *dims, int ndim, int dim,
-                                                 char **dataptr_p, bits8 **bitmap_p, int *bitmask_p)
+                                                 char **dataptr_p, uint8 **bitmap_p, int *bitmask_p)
 {
        int                     i;
        PyObject   *list;
@@ -733,7 +733,7 @@ PLyList_FromArray_recurse(PLyDatumToOb *elm, int *dims, int ndim, int dim,
                 * for this slice.
                 */
                char       *dataptr = *dataptr_p;
-               bits8      *bitmap = *bitmap_p;
+               uint8      *bitmap = *bitmap_p;
                int                     bitmask = *bitmask_p;
                uint8           typalignby = typalign_to_alignby(elm->typalign);
 
index 49b130f1306687d5b9bf2ca2bd68e766efe53cfa..7b11c38c41790127352d52e37d0604930901e77b 100644 (file)
@@ -133,7 +133,7 @@ pg_popcount_portable(const char *buf, int bytes)
  *             Returns the number of 1-bits in buf after applying the mask to each byte
  */
 uint64
-pg_popcount_masked_portable(const char *buf, int bytes, bits8 mask)
+pg_popcount_masked_portable(const char *buf, int bytes, uint8 mask)
 {
        uint64          popcnt = 0;
 
@@ -186,7 +186,7 @@ pg_popcount_optimized(const char *buf, int bytes)
  *             Returns the number of 1-bits in buf after applying the mask to each byte
  */
 uint64
-pg_popcount_masked_optimized(const char *buf, int bytes, bits8 mask)
+pg_popcount_masked_optimized(const char *buf, int bytes, uint8 mask)
 {
        return pg_popcount_masked_portable(buf, bytes, mask);
 }
index b0f10ae07a4e346860deef3a55debb793d83cdc2..3969a42523ca02a55419b5496eabddccb7cd76f9 100644 (file)
@@ -35,7 +35,7 @@
  * versions.
  */
 static uint64 pg_popcount_neon(const char *buf, int bytes);
-static uint64 pg_popcount_masked_neon(const char *buf, int bytes, bits8 mask);
+static uint64 pg_popcount_masked_neon(const char *buf, int bytes, uint8 mask);
 
 #ifdef USE_SVE_POPCNT_WITH_RUNTIME_CHECK
 
@@ -43,7 +43,7 @@ static uint64 pg_popcount_masked_neon(const char *buf, int bytes, bits8 mask);
  * These are the SVE implementations of the popcount functions.
  */
 static uint64 pg_popcount_sve(const char *buf, int bytes);
-static uint64 pg_popcount_masked_sve(const char *buf, int bytes, bits8 mask);
+static uint64 pg_popcount_masked_sve(const char *buf, int bytes, uint8 mask);
 
 /*
  * The function pointers are initially set to "choose" functions.  These
@@ -52,9 +52,9 @@ static uint64 pg_popcount_masked_sve(const char *buf, int bytes, bits8 mask);
  * caller's request.
  */
 static uint64 pg_popcount_choose(const char *buf, int bytes);
-static uint64 pg_popcount_masked_choose(const char *buf, int bytes, bits8 mask);
+static uint64 pg_popcount_masked_choose(const char *buf, int bytes, uint8 mask);
 uint64         (*pg_popcount_optimized) (const char *buf, int bytes) = pg_popcount_choose;
-uint64         (*pg_popcount_masked_optimized) (const char *buf, int bytes, bits8 mask) = pg_popcount_masked_choose;
+uint64         (*pg_popcount_masked_optimized) (const char *buf, int bytes, uint8 mask) = pg_popcount_masked_choose;
 
 static inline bool
 pg_popcount_sve_available(void)
@@ -94,7 +94,7 @@ pg_popcount_choose(const char *buf, int bytes)
 }
 
 static uint64
-pg_popcount_masked_choose(const char *buf, int bytes, bits8 mask)
+pg_popcount_masked_choose(const char *buf, int bytes, uint8 mask)
 {
        choose_popcount_functions();
        return pg_popcount_masked_optimized(buf, bytes, mask);
@@ -190,7 +190,7 @@ pg_popcount_sve(const char *buf, int bytes)
  */
 pg_attribute_target("arch=armv8-a+sve")
 static uint64
-pg_popcount_masked_sve(const char *buf, int bytes, bits8 mask)
+pg_popcount_masked_sve(const char *buf, int bytes, uint8 mask)
 {
        svbool_t        pred = svptrue_b64();
        svuint64_t      accum1 = svdup_u64(0),
@@ -284,7 +284,7 @@ pg_popcount_optimized(const char *buf, int bytes)
 }
 
 uint64
-pg_popcount_masked_optimized(const char *buf, int bytes, bits8 mask)
+pg_popcount_masked_optimized(const char *buf, int bytes, uint8 mask)
 {
        return pg_popcount_masked_neon(buf, bytes, mask);
 }
@@ -386,7 +386,7 @@ pg_popcount_neon(const char *buf, int bytes)
  *             Returns number of 1 bits in buf after applying the mask to each byte
  */
 static uint64
-pg_popcount_masked_neon(const char *buf, int bytes, bits8 mask)
+pg_popcount_masked_neon(const char *buf, int bytes, uint8 mask)
 {
        uint8x16_t      vec,
                                maskv = vdupq_n_u8(mask);
index a99613f18189392e3804049fa2d505152690f55c..91579e6b56967419d04f33a90eb05bf3b0e22646 100644 (file)
  * follow than "popcnt" for these names.
  */
 static uint64 pg_popcount_sse42(const char *buf, int bytes);
-static uint64 pg_popcount_masked_sse42(const char *buf, int bytes, bits8 mask);
+static uint64 pg_popcount_masked_sse42(const char *buf, int bytes, uint8 mask);
 
 /*
  * These are the AVX-512 implementations of the popcount functions.
  */
 #ifdef USE_AVX512_POPCNT_WITH_RUNTIME_CHECK
 static uint64 pg_popcount_avx512(const char *buf, int bytes);
-static uint64 pg_popcount_masked_avx512(const char *buf, int bytes, bits8 mask);
+static uint64 pg_popcount_masked_avx512(const char *buf, int bytes, uint8 mask);
 #endif                                                 /* USE_AVX512_POPCNT_WITH_RUNTIME_CHECK */
 
 /*
@@ -47,9 +47,9 @@ static uint64 pg_popcount_masked_avx512(const char *buf, int bytes, bits8 mask);
  * caller's request.
  */
 static uint64 pg_popcount_choose(const char *buf, int bytes);
-static uint64 pg_popcount_masked_choose(const char *buf, int bytes, bits8 mask);
+static uint64 pg_popcount_masked_choose(const char *buf, int bytes, uint8 mask);
 uint64         (*pg_popcount_optimized) (const char *buf, int bytes) = pg_popcount_choose;
-uint64         (*pg_popcount_masked_optimized) (const char *buf, int bytes, bits8 mask) = pg_popcount_masked_choose;
+uint64         (*pg_popcount_masked_optimized) (const char *buf, int bytes, uint8 mask) = pg_popcount_masked_choose;
 
 
 #ifdef USE_AVX512_POPCNT_WITH_RUNTIME_CHECK
@@ -104,7 +104,7 @@ pg_popcount_choose(const char *buf, int bytes)
 }
 
 static uint64
-pg_popcount_masked_choose(const char *buf, int bytes, bits8 mask)
+pg_popcount_masked_choose(const char *buf, int bytes, uint8 mask)
 {
        choose_popcount_functions();
        return pg_popcount_masked(buf, bytes, mask);
@@ -174,7 +174,7 @@ pg_popcount_avx512(const char *buf, int bytes)
  */
 pg_attribute_target("avx512vpopcntdq,avx512bw")
 static uint64
-pg_popcount_masked_avx512(const char *buf, int bytes, bits8 mask)
+pg_popcount_masked_avx512(const char *buf, int bytes, uint8 mask)
 {
        __m512i         val,
                                vmasked,
@@ -280,7 +280,7 @@ pg_popcount_sse42(const char *buf, int bytes)
  */
 pg_attribute_no_sanitize_alignment()
 static uint64
-pg_popcount_masked_sse42(const char *buf, int bytes, bits8 mask)
+pg_popcount_masked_sse42(const char *buf, int bytes, uint8 mask)
 {
        uint64          popcnt = 0;
        uint64          maskv = ~UINT64CONST(0) / 0xFF * mask;
index b89954279c06d86b2a7633860ea1cb98efd4109b..f65f3e98600df9a82430cb27ee6ff74cf3bd9c24 100644 (file)
@@ -141,7 +141,7 @@ worker_spi_main(Datum main_arg)
        Oid                     dboid;
        Oid                     roleoid;
        char       *p;
-       bits32          flags = 0;
+       uint32          flags = 0;
 
        table = palloc_object(worktable);
        sprintf(name, "schema%d", index);
@@ -154,7 +154,7 @@ worker_spi_main(Datum main_arg)
        p += sizeof(Oid);
        memcpy(&roleoid, p, sizeof(Oid));
        p += sizeof(Oid);
-       memcpy(&flags, p, sizeof(bits32));
+       memcpy(&flags, p, sizeof(uint32));
 
        /* Establish signal handlers before unblocking signals. */
        pqsignal(SIGHUP, SignalHandlerForConfigReload);
@@ -400,7 +400,7 @@ worker_spi_launch(PG_FUNCTION_ARGS)
        BgwHandleStatus status;
        pid_t           pid;
        char       *p;
-       bits32          flags = 0;
+       uint32          flags = 0;
        ArrayType  *arr = PG_GETARG_ARRAYTYPE_P(3);
        Size            ndim;
        int                     nelems;
@@ -472,7 +472,7 @@ worker_spi_launch(PG_FUNCTION_ARGS)
        p += sizeof(Oid);
        memcpy(p, &roleoid, sizeof(Oid));
        p += sizeof(Oid);
-       memcpy(p, &flags, sizeof(bits32));
+       memcpy(p, &flags, sizeof(uint32));
 
        if (!RegisterDynamicBackgroundWorker(&worker, &handle))
                PG_RETURN_NULL();
index 801ab8094ed9d53ab289f7b1be8c190a7769076d..69a71db1496516ebbbcb7d51b57be9cc5162aea1 100644 (file)
@@ -3591,9 +3591,6 @@ bh_node_type
 binaryheap
 binaryheap_comparator
 bitmapword
-bits16
-bits32
-bits8
 blockreftable_hash
 blockreftable_iterator
 bloom_filter