From 52ed3748aaedb8ae0689d32e07be21791f1f9e7a Mon Sep 17 00:00:00 2001
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: Mon, 9 Mar 2020 16:23:20 -0300
Subject: [PATCH v12 5/5] pgindent stuff

---
 src/backend/utils/adt/multirangetypes.c | 32 ++++++-------
 src/include/utils/multirangetypes.h     | 64 ++++++++++++-------------
 src/tools/pgindent/typedefs.list        |  3 ++
 3 files changed, 51 insertions(+), 48 deletions(-)

diff --git a/src/backend/utils/adt/multirangetypes.c b/src/backend/utils/adt/multirangetypes.c
index e58ab5baf3..5542265819 100644
--- a/src/backend/utils/adt/multirangetypes.c
+++ b/src/backend/utils/adt/multirangetypes.c
@@ -576,7 +576,7 @@ multirange_canonicalize(TypeCacheEntry *rangetyp, int32 input_range_count,
  * short varlena header.
  */
 void
-multirange_deserialize(MultirangeType * multirange,
+multirange_deserialize(MultirangeType *multirange,
 					   int32 *range_count, RangeType ***ranges)
 {
 	RangeType  *r;
@@ -717,7 +717,7 @@ multirange_constructor1(PG_FUNCTION_ARGS)
 	Oid			rngtypid;
 	TypeCacheEntry *typcache;
 	TypeCacheEntry *rangetyp;
-	RangeType *range;
+	RangeType  *range;
 
 	typcache = multirange_get_typcache(fcinfo, mltrngtypid);
 	rangetyp = typcache->rngtype;
@@ -836,8 +836,8 @@ multirange_minus(PG_FUNCTION_ARGS)
 
 MultirangeType *
 multirange_minus_internal(Oid mltrngtypoid, TypeCacheEntry *rangetyp,
-						 int32 range_count1, RangeType **ranges1,
-						 int32 range_count2, RangeType **ranges2)
+						  int32 range_count1, RangeType **ranges1,
+						  int32 range_count2, RangeType **ranges2)
 {
 	RangeType  *r1;
 	RangeType  *r2;
@@ -1302,7 +1302,7 @@ elem_contained_by_multirange(PG_FUNCTION_ARGS)
  * Test whether multirange mr contains a specific element value.
  */
 bool
-multirange_contains_elem_internal(TypeCacheEntry *typcache, MultirangeType * mr, Datum val)
+multirange_contains_elem_internal(TypeCacheEntry *typcache, MultirangeType *mr, Datum val)
 {
 	TypeCacheEntry *rangetyp;
 	int32		range_count;
@@ -1356,7 +1356,7 @@ range_contained_by_multirange(PG_FUNCTION_ARGS)
  * Test whether multirange mr contains a specific range r.
  */
 bool
-multirange_contains_range_internal(TypeCacheEntry *typcache, MultirangeType * mr, RangeType *r)
+multirange_contains_range_internal(TypeCacheEntry *typcache, MultirangeType *mr, RangeType *r)
 {
 	TypeCacheEntry *rangetyp;
 	int32		range_count;
@@ -1390,7 +1390,7 @@ multirange_contains_range_internal(TypeCacheEntry *typcache, MultirangeType * mr
 
 /* equality (internal version) */
 bool
-multirange_eq_internal(TypeCacheEntry *typcache, MultirangeType * mr1, MultirangeType * mr2)
+multirange_eq_internal(TypeCacheEntry *typcache, MultirangeType *mr1, MultirangeType *mr2)
 {
 	int32		range_count_1;
 	int32		range_count_2;
@@ -1437,7 +1437,7 @@ multirange_eq(PG_FUNCTION_ARGS)
 
 /* inequality (internal version) */
 bool
-multirange_ne_internal(TypeCacheEntry *typcache, MultirangeType * mr1, MultirangeType * mr2)
+multirange_ne_internal(TypeCacheEntry *typcache, MultirangeType *mr1, MultirangeType *mr2)
 {
 	return (!multirange_eq_internal(typcache, mr1, mr2));
 }
@@ -1493,7 +1493,7 @@ multirange_overlaps_multirange(PG_FUNCTION_ARGS)
 }
 
 bool
-range_overlaps_multirange_internal(TypeCacheEntry *typcache, RangeType *r, MultirangeType * mr)
+range_overlaps_multirange_internal(TypeCacheEntry *typcache, RangeType *r, MultirangeType *mr)
 {
 	TypeCacheEntry *rangetyp;
 	int32		range_count;
@@ -1529,8 +1529,8 @@ range_overlaps_multirange_internal(TypeCacheEntry *typcache, RangeType *r, Multi
 }
 
 bool
-multirange_overlaps_multirange_internal(TypeCacheEntry *typcache, MultirangeType * mr1,
-										MultirangeType * mr2)
+multirange_overlaps_multirange_internal(TypeCacheEntry *typcache, MultirangeType *mr1,
+										MultirangeType *mr2)
 {
 	TypeCacheEntry *rangetyp;
 	int32		range_count1;
@@ -1744,7 +1744,7 @@ multirange_contained_by_multirange(PG_FUNCTION_ARGS)
  */
 bool
 multirange_contains_multirange_internal(TypeCacheEntry *typcache,
-										MultirangeType * mr1, MultirangeType * mr2)
+										MultirangeType *mr1, MultirangeType *mr2)
 {
 	TypeCacheEntry *rangetyp;
 	int32		range_count1;
@@ -1883,7 +1883,7 @@ multirange_after_multirange(PG_FUNCTION_ARGS)
 /* strictly left of? (internal version) */
 bool
 range_before_multirange_internal(TypeCacheEntry *typcache, RangeType *r,
-								 MultirangeType * mr)
+								 MultirangeType *mr)
 {
 	int32		range_count;
 	RangeType **ranges;
@@ -1897,8 +1897,8 @@ range_before_multirange_internal(TypeCacheEntry *typcache, RangeType *r,
 }
 
 bool
-multirange_before_multirange_internal(TypeCacheEntry *typcache, MultirangeType * mr1,
-									  MultirangeType * mr2)
+multirange_before_multirange_internal(TypeCacheEntry *typcache, MultirangeType *mr1,
+									  MultirangeType *mr2)
 {
 	int32		range_count1;
 	int32		range_count2;
@@ -1918,7 +1918,7 @@ multirange_before_multirange_internal(TypeCacheEntry *typcache, MultirangeType *
 /* strictly right of? (internal version) */
 bool
 range_after_multirange_internal(TypeCacheEntry *typcache, RangeType *r,
-								MultirangeType * mr)
+								MultirangeType *mr)
 {
 	int32		range_count;
 	RangeType **ranges;
diff --git a/src/include/utils/multirangetypes.h b/src/include/utils/multirangetypes.h
index 98a8878ca0..469444776c 100644
--- a/src/include/utils/multirangetypes.h
+++ b/src/include/utils/multirangetypes.h
@@ -34,7 +34,7 @@ typedef struct
 	 * because even their base types can be varlena. So we can't really index
 	 * into this list.
 	 */
-}			MultirangeType;
+} MultirangeType;
 
 /* Use this macro in preference to fetching multirangetypid field directly */
 #define MultirangeTypeGetOid(mr)	((mr)->multirangetypid)
@@ -55,49 +55,49 @@ typedef struct
  */
 
 /* internal versions of the above */
-extern bool multirange_eq_internal(TypeCacheEntry *typcache, MultirangeType * mr1,
-								   MultirangeType * mr2);
-extern bool multirange_ne_internal(TypeCacheEntry *typcache, MultirangeType * mr1,
-								   MultirangeType * mr2);
-extern bool multirange_contains_elem_internal(TypeCacheEntry *typcache, MultirangeType * mr,
+extern bool multirange_eq_internal(TypeCacheEntry *typcache, MultirangeType *mr1,
+								   MultirangeType *mr2);
+extern bool multirange_ne_internal(TypeCacheEntry *typcache, MultirangeType *mr1,
+								   MultirangeType *mr2);
+extern bool multirange_contains_elem_internal(TypeCacheEntry *typcache, MultirangeType *mr,
 											  Datum elem);
-extern bool multirange_contains_range_internal(TypeCacheEntry *typcache, MultirangeType * mr,
+extern bool multirange_contains_range_internal(TypeCacheEntry *typcache, MultirangeType *mr,
 											   RangeType *r);
 extern bool multirange_contains_multirange_internal(TypeCacheEntry *typcache,
-													MultirangeType * mr1,
-													MultirangeType * mr2);
+													MultirangeType *mr1,
+													MultirangeType *mr2);
 extern bool range_overlaps_multirange_internal(TypeCacheEntry *typcache, RangeType *r,
-											   MultirangeType * mr);
+											   MultirangeType *mr);
 extern bool multirange_overlaps_multirange_internal(TypeCacheEntry *typcache,
-													MultirangeType * mr1,
-													MultirangeType * mr2);
+													MultirangeType *mr1,
+													MultirangeType *mr2);
 extern bool range_before_multirange_internal(TypeCacheEntry *typcache, RangeType *r,
-											 MultirangeType * mr);
+											 MultirangeType *mr);
 extern bool range_after_multirange_internal(TypeCacheEntry *typcache, RangeType *r,
-											MultirangeType * mr);
+											MultirangeType *mr);
 extern bool multirange_before_multirange_internal(TypeCacheEntry *typcache,
-												  MultirangeType * mr1,
-												  MultirangeType * mr2);
-extern MultirangeType * multirange_minus_internal(Oid mltrngtypoid,
-												  TypeCacheEntry *rangetyp,
-												  int32 range_count1,
-												  RangeType **ranges1,
-												  int32 range_count2,
-												  RangeType **ranges2);
-extern MultirangeType * multirange_intersect_internal(Oid mltrngtypoid,
-													  TypeCacheEntry *rangetyp,
-													  int32 range_count1,
-													  RangeType **ranges1,
-													  int32 range_count2,
-													  RangeType **ranges2);
+												  MultirangeType *mr1,
+												  MultirangeType *mr2);
+extern MultirangeType *multirange_minus_internal(Oid mltrngtypoid,
+												 TypeCacheEntry *rangetyp,
+												 int32 range_count1,
+												 RangeType **ranges1,
+												 int32 range_count2,
+												 RangeType **ranges2);
+extern MultirangeType *multirange_intersect_internal(Oid mltrngtypoid,
+													 TypeCacheEntry *rangetyp,
+													 int32 range_count1,
+													 RangeType **ranges1,
+													 int32 range_count2,
+													 RangeType **ranges2);
 
 /* assorted support functions */
 extern TypeCacheEntry *multirange_get_typcache(FunctionCallInfo fcinfo,
 											   Oid mltrngtypid);
-extern void multirange_deserialize(MultirangeType * range,
+extern void multirange_deserialize(MultirangeType *range,
 								   int32 *range_count, RangeType ***ranges);
-extern MultirangeType * make_multirange(Oid mltrngtypoid,
-										TypeCacheEntry *typcache, int32 range_count, RangeType **ranges);
-extern MultirangeType * make_empty_multirange(Oid mltrngtypoid, TypeCacheEntry *rangetyp);
+extern MultirangeType *make_multirange(Oid mltrngtypoid,
+									   TypeCacheEntry *typcache, int32 range_count, RangeType **ranges);
+extern MultirangeType *make_empty_multirange(Oid mltrngtypoid, TypeCacheEntry *rangetyp);
 
 #endif							/* MULTIRANGETYPES_H */
diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list
index e216de9570..c23ce28af1 100644
--- a/src/tools/pgindent/typedefs.list
+++ b/src/tools/pgindent/typedefs.list
@@ -1354,6 +1354,9 @@ MultiXactMember
 MultiXactOffset
 MultiXactStateData
 MultiXactStatus
+MultirangeIOData
+MultirangeParseState
+MultirangeType
 MyData
 NDBOX
 NODE
-- 
2.20.1

