pgsql: Introduce convenience macros to hide JsonbContainer header acces

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Introduce convenience macros to hide JsonbContainer header acces
Date: 2017-01-25 18:28:43
Message-ID: E1cWSJH-0005VF-Ux@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Introduce convenience macros to hide JsonbContainer header accesses better.

This improves readability a bit and may make future improvements easier.

In passing, make sure that the JB_ROOT_IS_XXX macros deliver boolean (0/1)
results; the previous coding was a bug hazard, though no actual bugs are
known.

Nikita Glukhov, extended a bit by me

Discussion: https://postgr.es/m/9e21a39c-c1d7-b9b5-44a0-c5345a5029f6@postgrespro.ru

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/f7c62462402972b13d10e43f104ca0c0fecb6d08

Modified Files
--------------
src/backend/utils/adt/jsonb_util.c | 14 +++++++-------
src/backend/utils/adt/jsonfuncs.c | 4 ++--
src/include/utils/jsonb.h | 16 +++++++++++-----
3 files changed, 20 insertions(+), 14 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2017-01-25 19:40:56 pgsql: Fix typo: pg_statistics -> pg_statistic
Previous Message Peter Eisentraut 2017-01-25 17:49:22 pgsql: doc: Fix typo