pgsql: Remove Item type - Mailing list pgsql-committers

From Peter Eisentraut
Subject pgsql: Remove Item type
Date
Msg-id E1vDJOR-003j6f-0A@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Remove Item type

This type is just char * underneath, it provides no real value, no
type safety, and just makes the code one level more mysterious.  It is
more idiomatic to refer to blobs of memory by a combination of void *
and size_t, so change it to that.

Also, since this type hides the pointerness, we can't apply qualifiers
to what is pointed to, which requires some unconstify nonsense.  This
change allows fixing that.

Extension code that uses the Item type can change its code to use
void * to be backward compatible.

Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Peter Geoghegan <pg@bowt.ie>
Discussion: https://www.postgresql.org/message-id/flat/c75cccf5-5709-407b-a36a-2ae6570be766@eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/76acf4b722faa2a552f62034b793c2797909f91b

Modified Files
--------------
src/backend/access/brin/brin_pageops.c  |  8 +++---
src/backend/access/brin/brin_xlog.c     |  4 +--
src/backend/access/gin/ginentrypage.c   |  8 +++---
src/backend/access/gin/ginfast.c        |  4 +--
src/backend/access/gin/ginvacuum.c      |  2 +-
src/backend/access/gin/ginxlog.c        |  7 +++--
src/backend/access/gist/gist.c          |  5 ++--
src/backend/access/gist/gistbuild.c     |  2 +-
src/backend/access/gist/gistutil.c      |  2 +-
src/backend/access/gist/gistxlog.c      |  4 +--
src/backend/access/hash/hash_xlog.c     |  7 +++--
src/backend/access/hash/hashinsert.c    | 12 +++------
src/backend/access/heap/heapam_xlog.c   |  7 +++--
src/backend/access/heap/hio.c           |  4 +--
src/backend/access/heap/rewriteheap.c   |  3 +--
src/backend/access/nbtree/nbtdedup.c    |  9 +++----
src/backend/access/nbtree/nbtinsert.c   | 18 +++++--------
src/backend/access/nbtree/nbtpage.c     |  9 +++----
src/backend/access/nbtree/nbtsort.c     |  6 ++---
src/backend/access/nbtree/nbtxlog.c     | 48 ++++++++++++---------------------
src/backend/access/spgist/spgdoinsert.c | 36 +++++++++++--------------
src/backend/access/spgist/spgutils.c    |  2 +-
src/backend/access/spgist/spgxlog.c     | 32 +++++++++-------------
src/backend/commands/sequence.c         |  6 ++---
src/backend/storage/page/bufpage.c      |  4 +--
src/include/access/spgist_private.h     |  2 +-
src/include/storage/bufpage.h           |  9 +++----
src/include/storage/item.h              | 19 -------------
src/tools/pgindent/typedefs.list        |  1 -
29 files changed, 102 insertions(+), 178 deletions(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: pgsql: Remove meaninglist restrict qualifiers
Next
From: Dean Rasheed
Date:
Subject: pgsql: Add new RLS tests to test policies applied by command type.