Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc7b8998

Browse files
committed
Phase 2 of pgindent updates.
Change pg_bsd_indent to follow upstream rules for placement of commentsto the right of code, and remove pgindent hack that caused commentsfollowing #endif to not obey the general rule.Commite3860ff wasn't actually usingthe published version of pg_bsd_indent, but a hacked-up version thattried to minimize the amount of movement of comments to the right ofcode. The situation of interest is where such a comment has to bemoved to the right of its default placement at column 33 because there'scode there. BSD indent has always moved right in units of tab stopsin such cases --- but in the previous incarnation, indent was workingin 8-space tab stops, while now it knows we use 4-space tabs. So thenet result is that in about half the cases, such comments are placedone tab stop left of before. This is better all around: it leavesmore room on the line for comment text, and it means that in suchcases the comment uniformly starts at the next 4-space tab stop afterthe code, rather than sometimes one and sometimes two tabs after.Also, ensure that comments following #endif are indented the sameas comments following other preprocessor commands such as #else.That inconsistency turns out to have been self-inflicted damagefrom a poorly-thought-through post-indent "fixup" in pgindent.This patch is much less interesting than the first round of indentchanges, but also bulkier, so I thought it best to separate the effects.Discussion:https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.orgDiscussion:https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
1 parentf669c09 commitc7b8998

File tree

1,107 files changed

+3435
-3516
lines changed

Some content is hidden

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

1,107 files changed

+3435
-3516
lines changed

‎contrib/bloom/bloom.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ typedef BloomPageOpaqueData *BloomPageOpaque;
7575

7676
/* Preserved page numbers */
7777
#defineBLOOM_METAPAGE_BLKNO(0)
78-
#defineBLOOM_HEAD_BLKNO(1)/* first data page */
78+
#defineBLOOM_HEAD_BLKNO(1)/* first data page */
7979

8080
/*
8181
* We store Bloom signatures as arrays of uint16 words.
@@ -101,8 +101,8 @@ typedef struct BloomOptions
101101
{
102102
int32vl_len_;/* varlena header (do not touch directly!) */
103103
intbloomLength;/* length of signature in words (not bits!) */
104-
intbitSize[INDEX_MAX_KEYS];/* # of bits generated for
105-
* each index key */
104+
intbitSize[INDEX_MAX_KEYS];/* # of bits generated for each
105+
* index key */
106106
}BloomOptions;
107107

108108
/*

‎contrib/btree_gist/btree_utils_num.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ typedef struct
4242

4343
/* Methods */
4444

45-
bool(*f_gt) (constvoid*,constvoid*,FmgrInfo*);/* greater than */
46-
bool(*f_ge) (constvoid*,constvoid*,FmgrInfo*);/* greater or equal */
47-
bool(*f_eq) (constvoid*,constvoid*,FmgrInfo*);/* equal */
48-
bool(*f_le) (constvoid*,constvoid*,FmgrInfo*);/* less or equal */
49-
bool(*f_lt) (constvoid*,constvoid*,FmgrInfo*);/* less than */
50-
int(*f_cmp) (constvoid*,constvoid*,FmgrInfo*);/* key compare function */
51-
float8(*f_dist) (constvoid*,constvoid*,FmgrInfo*);/* key distance function */
45+
bool(*f_gt) (constvoid*,constvoid*,FmgrInfo*);/* greater than */
46+
bool(*f_ge) (constvoid*,constvoid*,FmgrInfo*);/* greater or equal */
47+
bool(*f_eq) (constvoid*,constvoid*,FmgrInfo*);/* equal */
48+
bool(*f_le) (constvoid*,constvoid*,FmgrInfo*);/* less or equal */
49+
bool(*f_lt) (constvoid*,constvoid*,FmgrInfo*);/* less than */
50+
int(*f_cmp) (constvoid*,constvoid*,FmgrInfo*);/* key compare function */
51+
float8(*f_dist) (constvoid*,constvoid*,FmgrInfo*);/* key distance function */
5252
}gbtree_ninfo;
5353

5454

‎contrib/btree_gist/btree_utils_var.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ gbt_var_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v,
488488

489489
cur= (char*)DatumGetPointer(entryvec->vector[i].key);
490490
ro=gbt_var_key_readable((GBT_VARKEY*)cur);
491-
if (ro.lower==ro.upper)/* leaf */
491+
if (ro.lower==ro.upper)/* leaf */
492492
{
493493
sv[svcntr]=gbt_var_leaf2node((GBT_VARKEY*)cur,tinfo,flinfo);
494494
arr[i].t=sv[svcntr];

‎contrib/btree_gist/btree_utils_var.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ typedef struct
4040
bool(*f_le) (constvoid*,constvoid*,Oid,FmgrInfo*);/* less equal */
4141
bool(*f_lt) (constvoid*,constvoid*,Oid,FmgrInfo*);/* less than */
4242
int32(*f_cmp) (constvoid*,constvoid*,Oid,FmgrInfo*);/* compare */
43-
GBT_VARKEY*(*f_l2n) (GBT_VARKEY*,FmgrInfo*flinfo);/* convert leaf to node */
43+
GBT_VARKEY*(*f_l2n) (GBT_VARKEY*,FmgrInfo*flinfo);/* convert leaf to node */
4444
}gbtree_vinfo;
4545

4646

‎contrib/btree_gist/btree_uuid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ static double
171171
uuid_2_double(constpg_uuid_t*u)
172172
{
173173
uint64uu[2];
174-
constdoubletwo64=18446744073709551616.0;/* 2^64 */
174+
constdoubletwo64=18446744073709551616.0;/* 2^64 */
175175

176176
/* Source data may not be suitably aligned, so copy */
177177
memcpy(uu,u->data,UUID_LEN);

‎contrib/cube/cubedata.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ typedef struct NDBOX
5454
#definePG_RETURN_NDBOX(x)PG_RETURN_POINTER(x)
5555

5656
/* GiST operator strategy numbers */
57-
#defineCubeKNNDistanceCoord15/* ~> */
58-
#defineCubeKNNDistanceTaxicab16/* <#> */
59-
#defineCubeKNNDistanceEuclid17/* <-> */
60-
#defineCubeKNNDistanceChebyshev18/* <=> */
57+
#defineCubeKNNDistanceCoord15/* ~> */
58+
#defineCubeKNNDistanceTaxicab16/* <#> */
59+
#defineCubeKNNDistanceEuclid17/* <-> */
60+
#defineCubeKNNDistanceChebyshev18/* <=> */
6161

6262
/* in cubescan.l */
6363
externintcube_yylex(void);

‎contrib/dblink/dblink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ typedef struct remoteConn
6767
{
6868
PGconn*conn;/* Hold the remote connection */
6969
intopenCursorCount;/* The number of open cursors */
70-
boolnewXactForCursor;/* Opened a transaction for a cursor */
70+
boolnewXactForCursor;/* Opened a transaction for a cursor */
7171
}remoteConn;
7272

7373
typedefstructstoreInfo
@@ -1098,7 +1098,7 @@ storeQueryResult(volatile storeInfo *sinfo, PGconn *conn, const char *sql)
10981098
if (!PQsendQuery(conn,sql))
10991099
elog(ERROR,"could not send query: %s",pchomp(PQerrorMessage(conn)));
11001100

1101-
if (!PQsetSingleRowMode(conn))/* shouldn't fail */
1101+
if (!PQsetSingleRowMode(conn))/* shouldn't fail */
11021102
elog(ERROR,"failed to set single-row mode for dblink query");
11031103

11041104
for (;;)

‎contrib/file_fdw/file_fdw.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,13 +544,13 @@ fileGetForeignPaths(PlannerInfo *root,
544544
*/
545545
add_path(baserel, (Path*)
546546
create_foreignscan_path(root,baserel,
547-
NULL,/* default pathtarget */
547+
NULL,/* default pathtarget */
548548
baserel->rows,
549549
startup_cost,
550550
total_cost,
551-
NIL,/* no pathkeys */
552-
NULL,/* no outer rel either */
553-
NULL,/* no extra plan */
551+
NIL,/* no pathkeys */
552+
NULL,/* no outer rel either */
553+
NULL,/* no extra plan */
554554
coptions));
555555

556556
/*

‎contrib/fuzzystrmatch/dmetaphone.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ The remaining code is authored by Andrew Dunstan <amdunstan@ncshp.org> and
111111
#include<string.h>
112112
#include<stdarg.h>
113113

114-
#endif/* DMETAPHONE_MAIN */
114+
#endif/* DMETAPHONE_MAIN */
115115

116116
#include<assert.h>
117117
#include<ctype.h>
@@ -197,7 +197,7 @@ dmetaphone_alt(PG_FUNCTION_ARGS)
197197
* in a case like this.
198198
*/
199199

200-
#defineMETA_FREE(x) ((void)true)/* pfree((x)) */
200+
#defineMETA_FREE(x) ((void)true)/* pfree((x)) */
201201
#else/* not defined DMETAPHONE_MAIN */
202202

203203
/* use the standard malloc library when not running in PostgreSQL */
@@ -209,7 +209,7 @@ dmetaphone_alt(PG_FUNCTION_ARGS)
209209
(v = (t*)realloc((v),((n)*sizeof(t))))
210210

211211
#defineMETA_FREE(x) free((x))
212-
#endif/* defined DMETAPHONE_MAIN */
212+
#endif/* defined DMETAPHONE_MAIN */
213213

214214

215215

@@ -977,7 +977,7 @@ DoubleMetaphone(char *str, char **codes)
977977
}
978978
}
979979

980-
if (GetAt(original,current+1)=='J')/* it could happen! */
980+
if (GetAt(original,current+1)=='J')/* it could happen! */
981981
current+=2;
982982
else
983983
current+=1;

‎contrib/hstore/hstore.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ extern Pairs *hstoreArrayToPairs(ArrayType *a, int *npairs);
181181
#defineHStoreExistsStrategyNumber9
182182
#defineHStoreExistsAnyStrategyNumber10
183183
#defineHStoreExistsAllStrategyNumber11
184-
#defineHStoreOldContainsStrategyNumber 13/* backwards compatibility */
184+
#defineHStoreOldContainsStrategyNumber 13/* backwards compatibility */
185185

186186
/*
187187
* defining HSTORE_POLLUTE_NAMESPACE=0 will prevent use of old function names;
@@ -202,4 +202,4 @@ extern Pairs *hstoreArrayToPairs(ArrayType *a, int *npairs);
202202
extern int no_such_variable
203203
#endif
204204

205-
#endif/* __HSTORE_H__ */
205+
#endif/* __HSTORE_H__ */

‎contrib/hstore/hstore_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ hstore_from_record(PG_FUNCTION_ARGS)
829829
my_extra->ncolumns=ncolumns;
830830
}
831831

832-
Assert(ncolumns <=MaxTupleAttributeNumber);/* thus, no overflow */
832+
Assert(ncolumns <=MaxTupleAttributeNumber);/* thus, no overflow */
833833
pairs=palloc(ncolumns*sizeof(Pairs));
834834

835835
if (rec)

‎contrib/intarray/_int.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,4 @@ intcompDESC(const void *a, const void *b);
173173
(direction) ? compASC : compDESC ); \
174174
} while(0)
175175

176-
#endif/* ___INT_H__ */
176+
#endif/* ___INT_H__ */

‎contrib/intarray/_int_tool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ internal_size(int *a, int len)
282282

283283
for (i=0;i<len;i+=2)
284284
{
285-
if (!i||a[i]!=a[i-1])/* do not count repeated range */
285+
if (!i||a[i]!=a[i-1])/* do not count repeated range */
286286
size+=a[i+1]-a[i]+1;
287287
}
288288

‎contrib/isn/isn.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ check_table(const char *(*TABLE)[2], const unsigned TABLE_index[10][2])
131131
elog(DEBUG1,"index %d is invalid",j);
132132
return false;
133133
}
134-
#endif/* ISN_DEBUG */
134+
#endif/* ISN_DEBUG */
135135

136136
/*----------------------------------------------------------
137137
* Formatting and conversion routines.
@@ -699,11 +699,11 @@ string2ean(const char *str, bool errorOK, ean13 *result,
699699
/* recognize and validate the number: */
700700
while (*aux2&&length <=13)
701701
{
702-
last= (*(aux2+1)=='!'||*(aux2+1)=='\0');/* is the last character */
702+
last= (*(aux2+1)=='!'||*(aux2+1)=='\0');/* is the last character */
703703
digit= (isdigit((unsignedchar)*aux2)!=0);/* is current character
704704
* a digit? */
705-
if (*aux2=='?'&&last)/* automagically calculate check digit
706-
* if it's '?' */
705+
if (*aux2=='?'&&last)/* automagically calculate check digit if
706+
* it's '?' */
707707
magic=digit= true;
708708
if (length==0&& (*aux2=='M'||*aux2=='m'))
709709
{
@@ -832,8 +832,8 @@ string2ean(const char *str, bool errorOK, ean13 *result,
832832
gotoeanwrongtype;
833833
break;
834834
caseISMN:
835-
memcpy(buf,"9790",4);/* this isn't for sure yet, for now
836-
* ISMN it's only 9790 */
835+
memcpy(buf,"9790",4);/* this isn't for sure yet, for now ISMN
836+
* it's only 9790 */
837837
valid= (valid&& ((rcheck=checkdig(buf,13))==check||magic));
838838
break;
839839
caseISBN:
@@ -1123,7 +1123,7 @@ accept_weak_input(PG_FUNCTION_ARGS)
11231123
g_weak=PG_GETARG_BOOL(0);
11241124
#else
11251125
/* function has no effect */
1126-
#endif/* ISN_WEAK_MODE */
1126+
#endif/* ISN_WEAK_MODE */
11271127
PG_RETURN_BOOL(g_weak);
11281128
}
11291129

‎contrib/isn/isn.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ typedef uint64 ean13;
3232

3333
externvoidinitialize(void);
3434

35-
#endif/* ISN_H */
35+
#endif/* ISN_H */

‎contrib/lo/lo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ lo_manage(PG_FUNCTION_ARGS)
3232
HeapTuplenewtuple;/* The new value for tuple*/
3333
HeapTupletrigtuple;/* The original value of tuple*/
3434

35-
if (!CALLED_AS_TRIGGER(fcinfo))/* internal error */
35+
if (!CALLED_AS_TRIGGER(fcinfo))/* internal error */
3636
elog(ERROR,"%s: not fired by trigger manager",
3737
trigdata->tg_trigger->tgname);
3838

39-
if (!TRIGGER_FIRED_FOR_ROW(trigdata->tg_event))/* internal error */
39+
if (!TRIGGER_FIRED_FOR_ROW(trigdata->tg_event))/* internal error */
4040
elog(ERROR,"%s: must be fired for row",
4141
trigdata->tg_trigger->tgname);
4242

‎contrib/ltree/ltree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ typedef struct
125125
#defineOPR3
126126
#defineOPEN4
127127
#defineCLOSE5
128-
#defineVALTRUE6/* for stop words */
128+
#defineVALTRUE6/* for stop words */
129129
#defineVALFALSE7
130130

131131

‎contrib/ltree/ltree_gist.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ ltree_picksplit(PG_FUNCTION_ARGS)
302302
for (j=FirstOffsetNumber;j <=maxoff;j=OffsetNumberNext(j))
303303
{
304304
array[j].index=j;
305-
lu=GETENTRY(entryvec,j);/* use as tmp val */
305+
lu=GETENTRY(entryvec,j);/* use as tmp val */
306306
array[j].r=LTG_GETLNODE(lu);
307307
}
308308

@@ -312,7 +312,7 @@ ltree_picksplit(PG_FUNCTION_ARGS)
312312
lu_l=lu_r=ru_l=ru_r=NULL;
313313
for (j=FirstOffsetNumber;j <=maxoff;j=OffsetNumberNext(j))
314314
{
315-
lu=GETENTRY(entryvec,array[j].index);/* use as tmp val */
315+
lu=GETENTRY(entryvec,array[j].index);/* use as tmp val */
316316
if (j <= (maxoff-FirstOffsetNumber+1) /2)
317317
{
318318
v->spl_left[v->spl_nleft]=array[j].index;

‎contrib/pageinspect/pageinspect.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
/* in rawpage.c */
1919
externPageget_page_from_raw(bytea*raw_page);
2020

21-
#endif/* _PAGEINSPECT_H_ */
21+
#endif/* _PAGEINSPECT_H_ */

‎contrib/pg_buffercache/pg_buffercache_pages.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pg_buffercache_pages(PG_FUNCTION_ARGS)
6666
FuncCallContext*funcctx;
6767
Datumresult;
6868
MemoryContextoldcontext;
69-
BufferCachePagesContext*fctx;/* User function context. */
69+
BufferCachePagesContext*fctx;/* User function context. */
7070
TupleDesctupledesc;
7171
TupleDescexpected_tupledesc;
7272
HeapTupletuple;

‎contrib/pg_standby/pg_standby.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ intmaxwaittime = 0;/* how long are we prepared to wait for? */
4444
intkeepfiles=0;/* number of WAL files to keep, 0 keep all */
4545
intmaxretries=3;/* number of retries on restore command */
4646
booldebug= false;/* are we debugging? */
47-
boolneed_cleanup= false;/* do we need to remove files from
48-
* archive? */
47+
boolneed_cleanup= false;/* do we need to remove files from
48+
* archive? */
4949

5050
#ifndefWIN32
5151
staticvolatilesig_atomic_tsignaled= false;
@@ -59,8 +59,8 @@ char *restartWALFileName; /* the file from which we can restart restore */
5959
char*priorWALFileName;/* the file we need to get from archive */
6060
charWALFilePath[MAXPGPATH*2];/* the file path including archive */
6161
charrestoreCommand[MAXPGPATH];/* run this to restore */
62-
charexclusiveCleanupFileName[MAXFNAMELEN];/* the file we need to
63-
* get from archive */
62+
charexclusiveCleanupFileName[MAXFNAMELEN];/* the file we need to get
63+
* from archive */
6464

6565
/*
6666
* Two types of failover are supported (smart and fast failover).
@@ -582,7 +582,7 @@ main(int argc, char **argv)
582582
* There's no way to trigger failover via signal on Windows.
583583
*/
584584
(void)pqsignal(SIGUSR1,sighandler);
585-
(void)pqsignal(SIGINT,sighandler);/* deprecated, use SIGUSR1 */
585+
(void)pqsignal(SIGINT,sighandler);/* deprecated, use SIGUSR1 */
586586
(void)pqsignal(SIGQUIT,sigquit_handler);
587587
#endif
588588

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp