Skip to content

Commit 4bc424b

Browse files
committed
pgindent run for 9.6
1 parent 9164dee commit 4bc424b

File tree

252 files changed

+2666
-2554
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+2666
-2554
lines changed

contrib/auto_explain/auto_explain.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,16 @@ _PG_init(void)
165165

166166
DefineCustomRealVariable("auto_explain.sample_rate",
167167
"Fraction of queries to process.",
168-
NULL,
169-
&auto_explain_sample_rate,
170-
1.0,
171-
0.0,
172-
1.0,
173-
PGC_SUSET,
174-
0,
175-
NULL,
176-
NULL,
177-
NULL);
168+
NULL,
169+
&auto_explain_sample_rate,
170+
1.0,
171+
0.0,
172+
1.0,
173+
PGC_SUSET,
174+
0,
175+
NULL,
176+
NULL,
177+
NULL);
178178

179179
EmitWarningsOnPlaceholders("auto_explain");
180180

@@ -209,12 +209,12 @@ static void
209209
explain_ExecutorStart(QueryDesc *queryDesc, int eflags)
210210
{
211211
/*
212-
* For rate sampling, randomly choose top-level statement. Either
213-
* all nested statements will be explained or none will.
212+
* For rate sampling, randomly choose top-level statement. Either all
213+
* nested statements will be explained or none will.
214214
*/
215215
if (auto_explain_log_min_duration >= 0 && nesting_level == 0)
216216
current_query_sampled = (random() < auto_explain_sample_rate *
217-
MAX_RANDOM_VALUE);
217+
MAX_RANDOM_VALUE);
218218

219219
if (auto_explain_enabled() && current_query_sampled)
220220
{

contrib/bloom/blinsert.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ PG_MODULE_MAGIC;
3333
typedef struct
3434
{
3535
BloomState blstate; /* bloom index state */
36-
MemoryContext tmpCtx; /* temporary memory context reset after
37-
* each tuple */
36+
MemoryContext tmpCtx; /* temporary memory context reset after each
37+
* tuple */
3838
char data[BLCKSZ]; /* cached page */
3939
int64 count; /* number of tuples in cached page */
40-
} BloomBuildState;
40+
} BloomBuildState;
4141

4242
/*
4343
* Flush page cached in BloomBuildState.
@@ -140,8 +140,8 @@ blbuild(Relation heap, Relation index, IndexInfo *indexInfo)
140140
bloomBuildCallback, (void *) &buildstate);
141141

142142
/*
143-
* There are could be some items in cached page. Flush this page
144-
* if needed.
143+
* There are could be some items in cached page. Flush this page if
144+
* needed.
145145
*/
146146
if (buildstate.count > 0)
147147
flushCachedPage(index, &buildstate);

contrib/bloom/bloom.h

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,13 @@
3131
/* Opaque for bloom pages */
3232
typedef struct BloomPageOpaqueData
3333
{
34-
OffsetNumber maxoff; /* number of index tuples on page */
35-
uint16 flags; /* see bit definitions below */
36-
uint16 unused; /* placeholder to force maxaligning of size
37-
* of BloomPageOpaqueData and to place
38-
* bloom_page_id exactly at the end of page
39-
*/
40-
uint16 bloom_page_id; /* for identification of BLOOM indexes */
41-
} BloomPageOpaqueData;
34+
OffsetNumber maxoff; /* number of index tuples on page */
35+
uint16 flags; /* see bit definitions below */
36+
uint16 unused; /* placeholder to force maxaligning of size of
37+
* BloomPageOpaqueData and to place
38+
* bloom_page_id exactly at the end of page */
39+
uint16 bloom_page_id; /* for identification of BLOOM indexes */
40+
} BloomPageOpaqueData;
4241

4342
typedef BloomPageOpaqueData *BloomPageOpaque;
4443

@@ -102,9 +101,9 @@ typedef struct BloomOptions
102101
{
103102
int32 vl_len_; /* varlena header (do not touch directly!) */
104103
int bloomLength; /* length of signature in words (not bits!) */
105-
int bitSize[INDEX_MAX_KEYS]; /* # of bits generated for each
106-
* index key */
107-
} BloomOptions;
104+
int bitSize[INDEX_MAX_KEYS]; /* # of bits generated for
105+
* each index key */
106+
} BloomOptions;
108107

109108
/*
110109
* FreeBlockNumberArray - array of block numbers sized so that metadata fill
@@ -125,7 +124,7 @@ typedef struct BloomMetaPageData
125124
uint16 nEnd;
126125
BloomOptions opts;
127126
FreeBlockNumberArray notFullPage;
128-
} BloomMetaPageData;
127+
} BloomMetaPageData;
129128

130129
/* Magic number to distinguish bloom pages among anothers */
131130
#define BLOOM_MAGICK_NUMBER (0xDBAC0DED)
@@ -146,7 +145,7 @@ typedef struct BloomState
146145
* precompute it
147146
*/
148147
Size sizeOfBloomTuple;
149-
} BloomState;
148+
} BloomState;
150149

151150
#define BloomPageGetFreeSpace(state, page) \
152151
(BLCKSZ - MAXALIGN(SizeOfPageHeaderData) \
@@ -160,30 +159,30 @@ typedef struct BloomTuple
160159
{
161160
ItemPointerData heapPtr;
162161
BloomSignatureWord sign[FLEXIBLE_ARRAY_MEMBER];
163-
} BloomTuple;
162+
} BloomTuple;
164163

165164
#define BLOOMTUPLEHDRSZ offsetof(BloomTuple, sign)
166165

167166
/* Opaque data structure for bloom index scan */
168167
typedef struct BloomScanOpaqueData
169168
{
170-
BloomSignatureWord *sign; /* Scan signature */
169+
BloomSignatureWord *sign; /* Scan signature */
171170
BloomState state;
172-
} BloomScanOpaqueData;
171+
} BloomScanOpaqueData;
173172

174173
typedef BloomScanOpaqueData *BloomScanOpaque;
175174

176175
/* blutils.c */
177176
extern void _PG_init(void);
178177
extern Datum blhandler(PG_FUNCTION_ARGS);
179-
extern void initBloomState(BloomState * state, Relation index);
178+
extern void initBloomState(BloomState *state, Relation index);
180179
extern void BloomFillMetapage(Relation index, Page metaPage);
181180
extern void BloomInitMetapage(Relation index);
182181
extern void BloomInitPage(Page page, uint16 flags);
183182
extern Buffer BloomNewBuffer(Relation index);
184-
extern void signValue(BloomState * state, BloomSignatureWord * sign, Datum value, int attno);
185-
extern BloomTuple *BloomFormTuple(BloomState * state, ItemPointer iptr, Datum *values, bool *isnull);
186-
extern bool BloomPageAddItem(BloomState * state, Page page, BloomTuple * tuple);
183+
extern void signValue(BloomState *state, BloomSignatureWord *sign, Datum value, int attno);
184+
extern BloomTuple *BloomFormTuple(BloomState *state, ItemPointer iptr, Datum *values, bool *isnull);
185+
extern bool BloomPageAddItem(BloomState *state, Page page, BloomTuple *tuple);
187186

188187
/* blvalidate.c */
189188
extern bool blvalidate(Oid opclassoid);

contrib/bloom/blutils.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ PG_FUNCTION_INFO_V1(blhandler);
3737

3838
/* Kind of relation options for bloom index */
3939
static relopt_kind bl_relopt_kind;
40+
4041
/* parse table for fillRelOptions */
4142
static relopt_parse_elt bl_relopt_tab[INDEX_MAX_KEYS + 1];
4243

@@ -215,7 +216,9 @@ myRand(void)
215216
* October 1988, p. 1195.
216217
*----------
217218
*/
218-
int32 hi, lo, x;
219+
int32 hi,
220+
lo,
221+
x;
219222

220223
/* Must be in [1, 0x7ffffffe] range at this point. */
221224
hi = next / 127773;

contrib/bloom/blvacuum.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ blbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
7878
/* Iterate over the tuples */
7979
itup = itupPtr = BloomPageGetTuple(&state, page, FirstOffsetNumber);
8080
itupEnd = BloomPageGetTuple(&state, page,
81-
OffsetNumberNext(BloomPageGetMaxOffset(page)));
81+
OffsetNumberNext(BloomPageGetMaxOffset(page)));
8282
while (itup < itupEnd)
8383
{
8484
/* Do we have to delete this tuple? */
@@ -106,11 +106,11 @@ blbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats,
106106
}
107107

108108
Assert(itupPtr == BloomPageGetTuple(&state, page,
109-
OffsetNumberNext(BloomPageGetMaxOffset(page))));
109+
OffsetNumberNext(BloomPageGetMaxOffset(page))));
110110

111111
/*
112-
* Add page to notFullPage list if we will not mark page as deleted and
113-
* there is a free space on it
112+
* Add page to notFullPage list if we will not mark page as deleted
113+
* and there is a free space on it
114114
*/
115115
if (BloomPageGetMaxOffset(page) != 0 &&
116116
BloomPageGetFreeSpace(&state, page) > state.sizeOfBloomTuple &&

contrib/file_fdw/file_fdw.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static bool fileAnalyzeForeignTable(Relation relation,
132132
AcquireSampleRowsFunc *func,
133133
BlockNumber *totalpages);
134134
static bool fileIsForeignScanParallelSafe(PlannerInfo *root, RelOptInfo *rel,
135-
RangeTblEntry *rte);
135+
RangeTblEntry *rte);
136136

137137
/*
138138
* Helper functions
@@ -767,12 +767,12 @@ fileAnalyzeForeignTable(Relation relation,
767767

768768
/*
769769
* fileIsForeignScanParallelSafe
770-
* Reading a file in a parallel worker should work just the same as
771-
* reading it in the leader, so mark scans safe.
770+
* Reading a file in a parallel worker should work just the same as
771+
* reading it in the leader, so mark scans safe.
772772
*/
773773
static bool
774774
fileIsForeignScanParallelSafe(PlannerInfo *root, RelOptInfo *rel,
775-
RangeTblEntry *rte)
775+
RangeTblEntry *rte)
776776
{
777777
return true;
778778
}

contrib/isn/isn.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,9 @@ ean2ISBN(char *isn)
444444
unsigned check;
445445

446446
/*
447-
* The number should come in this format: 978-0-000-00000-0
448-
* or may be an ISBN-13 number, 979-..., which does not have a short
449-
* representation. Do the short output version if possible.
447+
* The number should come in this format: 978-0-000-00000-0 or may be an
448+
* ISBN-13 number, 979-..., which does not have a short representation. Do
449+
* the short output version if possible.
450450
*/
451451
if (strncmp("978-", isn, 4) == 0)
452452
{

contrib/pageinspect/heapfuncs.c

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ text_to_bits(char *str, int len)
8282
else
8383
ereport(ERROR,
8484
(errcode(ERRCODE_DATA_CORRUPTED),
85-
errmsg("illegal character '%c' in t_bits string", str[off])));
85+
errmsg("illegal character '%c' in t_bits string", str[off])));
8686

8787
if (off % 8 == 7)
8888
bits[off / 8] = byte;
@@ -192,9 +192,9 @@ heap_page_items(PG_FUNCTION_ARGS)
192192
lp_offset == MAXALIGN(lp_offset) &&
193193
lp_offset + lp_len <= raw_page_size)
194194
{
195-
HeapTupleHeader tuphdr;
196-
bytea *tuple_data_bytea;
197-
int tuple_data_len;
195+
HeapTupleHeader tuphdr;
196+
bytea *tuple_data_bytea;
197+
int tuple_data_len;
198198

199199
/* Extract information from the tuple header */
200200

@@ -214,7 +214,7 @@ heap_page_items(PG_FUNCTION_ARGS)
214214
tuple_data_bytea = (bytea *) palloc(tuple_data_len + VARHDRSZ);
215215
SET_VARSIZE(tuple_data_bytea, tuple_data_len + VARHDRSZ);
216216
memcpy(VARDATA(tuple_data_bytea), (char *) tuphdr + tuphdr->t_hoff,
217-
tuple_data_len);
217+
tuple_data_len);
218218
values[13] = PointerGetDatum(tuple_data_bytea);
219219

220220
/*
@@ -284,16 +284,16 @@ heap_page_items(PG_FUNCTION_ARGS)
284284
*/
285285
static Datum
286286
tuple_data_split_internal(Oid relid, char *tupdata,
287-
uint16 tupdata_len, uint16 t_infomask,
288-
uint16 t_infomask2, bits8 *t_bits,
289-
bool do_detoast)
287+
uint16 tupdata_len, uint16 t_infomask,
288+
uint16 t_infomask2, bits8 *t_bits,
289+
bool do_detoast)
290290
{
291-
ArrayBuildState *raw_attrs;
292-
int nattrs;
293-
int i;
294-
int off = 0;
295-
Relation rel;
296-
TupleDesc tupdesc;
291+
ArrayBuildState *raw_attrs;
292+
int nattrs;
293+
int i;
294+
int off = 0;
295+
Relation rel;
296+
TupleDesc tupdesc;
297297

298298
/* Get tuple descriptor from relation OID */
299299
rel = relation_open(relid, NoLock);
@@ -310,30 +310,31 @@ tuple_data_split_internal(Oid relid, char *tupdata,
310310

311311
for (i = 0; i < nattrs; i++)
312312
{
313-
Form_pg_attribute attr;
314-
bool is_null;
315-
bytea *attr_data = NULL;
313+
Form_pg_attribute attr;
314+
bool is_null;
315+
bytea *attr_data = NULL;
316316

317317
attr = tupdesc->attrs[i];
318318
is_null = (t_infomask & HEAP_HASNULL) && att_isnull(i, t_bits);
319319

320320
/*
321-
* Tuple header can specify less attributes than tuple descriptor
322-
* as ALTER TABLE ADD COLUMN without DEFAULT keyword does not
323-
* actually change tuples in pages, so attributes with numbers greater
324-
* than (t_infomask2 & HEAP_NATTS_MASK) should be treated as NULL.
321+
* Tuple header can specify less attributes than tuple descriptor as
322+
* ALTER TABLE ADD COLUMN without DEFAULT keyword does not actually
323+
* change tuples in pages, so attributes with numbers greater than
324+
* (t_infomask2 & HEAP_NATTS_MASK) should be treated as NULL.
325325
*/
326326
if (i >= (t_infomask2 & HEAP_NATTS_MASK))
327327
is_null = true;
328328

329329
if (!is_null)
330330
{
331-
int len;
331+
int len;
332332

333333
if (attr->attlen == -1)
334334
{
335335
off = att_align_pointer(off, tupdesc->attrs[i]->attalign, -1,
336336
tupdata + off);
337+
337338
/*
338339
* As VARSIZE_ANY throws an exception if it can't properly
339340
* detect the type of external storage in macros VARTAG_SIZE,
@@ -343,8 +344,8 @@ tuple_data_split_internal(Oid relid, char *tupdata,
343344
!VARATT_IS_EXTERNAL_ONDISK(tupdata + off) &&
344345
!VARATT_IS_EXTERNAL_INDIRECT(tupdata + off))
345346
ereport(ERROR,
346-
(errcode(ERRCODE_DATA_CORRUPTED),
347-
errmsg("first byte of varlena attribute is incorrect for attribute %d", i)));
347+
(errcode(ERRCODE_DATA_CORRUPTED),
348+
errmsg("first byte of varlena attribute is incorrect for attribute %d", i)));
348349

349350
len = VARSIZE_ANY(tupdata + off);
350351
}
@@ -381,7 +382,7 @@ tuple_data_split_internal(Oid relid, char *tupdata,
381382
if (tupdata_len != off)
382383
ereport(ERROR,
383384
(errcode(ERRCODE_DATA_CORRUPTED),
384-
errmsg("end of tuple reached without looking at all its data")));
385+
errmsg("end of tuple reached without looking at all its data")));
385386

386387
return makeArrayResult(raw_attrs, CurrentMemoryContext);
387388
}
@@ -397,14 +398,14 @@ PG_FUNCTION_INFO_V1(tuple_data_split);
397398
Datum
398399
tuple_data_split(PG_FUNCTION_ARGS)
399400
{
400-
Oid relid;
401-
bytea *raw_data;
402-
uint16 t_infomask;
403-
uint16 t_infomask2;
404-
char *t_bits_str;
405-
bool do_detoast = false;
406-
bits8 *t_bits = NULL;
407-
Datum res;
401+
Oid relid;
402+
bytea *raw_data;
403+
uint16 t_infomask;
404+
uint16 t_infomask2;
405+
char *t_bits_str;
406+
bool do_detoast = false;
407+
bits8 *t_bits = NULL;
408+
Datum res;
408409

409410
relid = PG_GETARG_OID(0);
410411
raw_data = PG_ARGISNULL(1) ? NULL : PG_GETARG_BYTEA_P(1);
@@ -430,8 +431,8 @@ tuple_data_split(PG_FUNCTION_ARGS)
430431
*/
431432
if (t_infomask & HEAP_HASNULL)
432433
{
433-
int bits_str_len;
434-
int bits_len;
434+
int bits_str_len;
435+
int bits_len;
435436

436437
bits_len = (t_infomask2 & HEAP_NATTS_MASK) / 8 + 1;
437438
if (!t_bits_str)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy