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

Commite3860ff

Browse files
committed
Initial pgindent run with pg_bsd_indent version 2.0.
The new indent version includes numerous fixes thanks to Piotr Stefaniak.The main changes visible in this commit are:* Nicer formatting of function-pointer declarations.* No longer unexpectedly removes spaces in expressions using casts, sizeof, or offsetof.* No longer wants to add a space in "struct structname *varname", as well as some similar cases for const- or volatile-qualified pointers.* Declarations using PG_USED_FOR_ASSERTS_ONLY are formatted more nicely.* Fixes bug where comments following declarations were sometimes placed with no space separating them from the code.* Fixes some odd decisions for comments following case labels.* Fixes some cases where comments following code were indented to less than the expected column 33.On the less good side, it now tends to put more whitespace around typedefnames that are not listed in typedefs.list. This might encourage us toput more effort into typedef name collection; it's not really a bug inindent itself.There are more changes coming after this round, having to do with commentindentation and alignment of lines appearing within parentheses. I wantedto limit the size of the diffs to something that could be reviewed withoutone's eyes completely glazing over, so it seemed better to split up thechanges as much as practical.Discussion:https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.orgDiscussion:https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
1 parent8ff6d4e commite3860ff

File tree

379 files changed

+1726
-1708
lines changed

Some content is hidden

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

379 files changed

+1726
-1708
lines changed

‎contrib/bloom/blutils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ _PG_init(void)
7575
bl_relopt_tab[i+1].optname=MemoryContextStrdup(TopMemoryContext,
7676
buf);
7777
bl_relopt_tab[i+1].opttype=RELOPT_TYPE_INT;
78-
bl_relopt_tab[i+1].offset= offsetof(BloomOptions,bitSize[0])+sizeof(int)*i;
78+
bl_relopt_tab[i+1].offset= offsetof(BloomOptions,bitSize[0])+sizeof(int)*i;
7979
}
8080
}
8181

‎contrib/btree_gist/btree_utils_var.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ gbt_var_key_readable(const GBT_VARKEY *k)
7272
* Create a leaf-entry to store in the index, from a single Datum.
7373
*/
7474
staticGBT_VARKEY*
75-
gbt_var_key_from_datum(conststructvarlena*u)
75+
gbt_var_key_from_datum(conststructvarlena*u)
7676
{
7777
int32lowersize=VARSIZE(u);
7878
GBT_VARKEY*r;

‎contrib/dblink/dblink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ dblink_conn_not_avail(const char *conname)
179179

180180
staticvoid
181181
dblink_get_conn(char*conname_or_str,
182-
PGconn*volatile*conn_p,char**conname_p,volatilebool*freeconn_p)
182+
PGconn*volatile*conn_p,char**conname_p,volatilebool*freeconn_p)
183183
{
184184
remoteConn*rconn=getConnectionByName(conname_or_str);
185185
PGconn*conn;
@@ -723,7 +723,7 @@ dblink_record_internal(FunctionCallInfo fcinfo, bool is_async)
723723
/* shouldn't happen */
724724
elog(ERROR,"wrong number of arguments");
725725
}
726-
else/* is_async */
726+
else/* is_async */
727727
{
728728
/* get async result */
729729
conname=text_to_cstring(PG_GETARG_TEXT_PP(0));

‎contrib/fuzzystrmatch/fuzzystrmatch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ _metaphone(char *word,/* IN */
389389
/*-- Allocate memory for our phoned_phrase --*/
390390
if (max_phonemes==0)
391391
{/* Assume largest possible */
392-
*phoned_word=palloc(sizeof(char)*strlen(word)+1);
392+
*phoned_word=palloc(sizeof(char)*strlen(word)+1);
393393
}
394394
else
395395
{
@@ -722,7 +722,7 @@ _metaphone(char *word,/* IN */
722722
End_Phoned_Word;
723723

724724
return (META_SUCCESS);
725-
}/* END metaphone */
725+
}/* END metaphone */
726726

727727

728728
/*

‎contrib/intarray/_int_gin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ ginint4_queryextract(PG_FUNCTION_ARGS)
9393
caseRTOldContainsStrategyNumber:
9494
if (*nentries>0)
9595
*searchMode=GIN_SEARCH_MODE_DEFAULT;
96-
else/* everything contains the empty set */
96+
else/* everything contains the empty set */
9797
*searchMode=GIN_SEARCH_MODE_ALL;
9898
break;
9999
default:

‎contrib/ltree/lquery_op.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static struct
147147
{
148148
boolmuse;
149149
uint32high_pos;
150-
}SomeStack=
150+
}SomeStack=
151151

152152
{
153153
false,0,

‎contrib/oid2name/oid2name.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ voidsql_exec_dumpalltbspc(PGconn *, struct options *);
5757

5858
/* function to parse command line options and check for some usage errors. */
5959
void
60-
get_opts(intargc,char**argv,structoptions*my_opts)
60+
get_opts(intargc,char**argv,structoptions*my_opts)
6161
{
6262
intc;
6363
constchar*progname;
@@ -260,7 +260,7 @@ get_comma_elts(eary *eary)
260260

261261
/* establish connection with database. */
262262
PGconn*
263-
sql_conn(structoptions*my_opts)
263+
sql_conn(structoptions*my_opts)
264264
{
265265
PGconn*conn;
266266
boolhave_password= false;
@@ -411,7 +411,7 @@ sql_exec(PGconn *conn, const char *todo, bool quiet)
411411
* Dump all databases. There are no system objects to worry about.
412412
*/
413413
void
414-
sql_exec_dumpalldbs(PGconn*conn,structoptions*opts)
414+
sql_exec_dumpalldbs(PGconn*conn,structoptions*opts)
415415
{
416416
chartodo[1024];
417417

@@ -428,7 +428,7 @@ sql_exec_dumpalldbs(PGconn *conn, struct options * opts)
428428
* Dump all tables, indexes and sequences in the current database.
429429
*/
430430
void
431-
sql_exec_dumpalltables(PGconn*conn,structoptions*opts)
431+
sql_exec_dumpalltables(PGconn*conn,structoptions*opts)
432432
{
433433
chartodo[1024];
434434
char*addfields=",c.oid AS \"Oid\", nspname AS \"Schema\", spcname as \"Tablespace\" ";
@@ -460,7 +460,7 @@ sql_exec_dumpalltables(PGconn *conn, struct options * opts)
460460
* given objects in the current database.
461461
*/
462462
void
463-
sql_exec_searchtables(PGconn*conn,structoptions*opts)
463+
sql_exec_searchtables(PGconn*conn,structoptions*opts)
464464
{
465465
char*todo;
466466
char*qualifiers,
@@ -516,7 +516,7 @@ sql_exec_searchtables(PGconn *conn, struct options * opts)
516516
CppAsString2(RELKIND_SEQUENCE)","
517517
CppAsString2(RELKIND_TOASTVALUE)") AND\n"
518518
"t.oid = CASE\n"
519-
"WHEN reltablespace <> 0 THEN reltablespace\n"
519+
"WHEN reltablespace <> 0 THEN reltablespace\n"
520520
"ELSE dattablespace\n"
521521
"END AND\n"
522522
" (%s)\n"
@@ -530,7 +530,7 @@ sql_exec_searchtables(PGconn *conn, struct options * opts)
530530
}
531531

532532
void
533-
sql_exec_dumpalltbspc(PGconn*conn,structoptions*opts)
533+
sql_exec_dumpalltbspc(PGconn*conn,structoptions*opts)
534534
{
535535
chartodo[1024];
536536

‎contrib/pg_stat_statements/pg_stat_statements.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ typedef enum
250250
PGSS_TRACK_NONE,/* track no statements */
251251
PGSS_TRACK_TOP,/* only top level statements */
252252
PGSS_TRACK_ALL/* all statements, including nested ones */
253-
}PGSSTrackLevel;
253+
}PGSSTrackLevel;
254254

255255
staticconststructconfig_enum_entrytrack_options[]=
256256
{

‎contrib/pg_trgm/trgm_op.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ generate_trgm(char *str, int slen)
325325

326326
protect_out_of_mem(slen);
327327

328-
trg= (TRGM*)palloc(TRGMHDRSIZE+sizeof(trgm)* (slen /2+1)*3);
328+
trg= (TRGM*)palloc(TRGMHDRSIZE+sizeof(trgm)* (slen /2+1)*3);
329329
trg->flag=ARRKEY;
330330

331331
len=generate_trgm_only(GETARR(trg),str,slen);
@@ -572,8 +572,8 @@ calc_word_similarity(char *str1, int slen1, char *str2, int slen2,
572572
protect_out_of_mem(slen1+slen2);
573573

574574
/* Make positional trigrams */
575-
trg1= (trgm*)palloc(sizeof(trgm)* (slen1 /2+1)*3);
576-
trg2= (trgm*)palloc(sizeof(trgm)* (slen2 /2+1)*3);
575+
trg1= (trgm*)palloc(sizeof(trgm)* (slen1 /2+1)*3);
576+
trg2= (trgm*)palloc(sizeof(trgm)* (slen2 /2+1)*3);
577577

578578
len1=generate_trgm_only(trg1,str1,slen1);
579579
len2=generate_trgm_only(trg2,str2,slen2);
@@ -806,7 +806,7 @@ generate_wildcard_trgm(const char *str, int slen)
806806

807807
protect_out_of_mem(slen);
808808

809-
trg= (TRGM*)palloc(TRGMHDRSIZE+sizeof(trgm)* (slen /2+1)*3);
809+
trg= (TRGM*)palloc(TRGMHDRSIZE+sizeof(trgm)* (slen /2+1)*3);
810810
trg->flag=ARRKEY;
811811
SET_VARSIZE(trg,TRGMHDRSIZE);
812812

‎contrib/pg_visibility/pg_visibility.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ collect_visibility_data(Oid relid, bool include_pd)
481481
check_relation_relkind(rel);
482482

483483
nblocks=RelationGetNumberOfBlocks(rel);
484-
info=palloc0(offsetof(vbits,bits)+nblocks);
484+
info=palloc0(offsetof(vbits,bits)+nblocks);
485485
info->next=0;
486486
info->count=nblocks;
487487

‎contrib/pgcrypto/imath.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ mp_int_sqr(mp_int a, mp_int c)
908908
CHECK(a!=NULL&&c!=NULL);
909909

910910
/* Get a temporary buffer big enough to hold the result */
911-
osize= (mp_size)4*((MP_USED(a)+1) /2);
911+
osize= (mp_size)4*((MP_USED(a)+1) /2);
912912

913913
if (a==c)
914914
{
@@ -1613,8 +1613,8 @@ mp_int_gcd(mp_int a, mp_int b, mp_int c)
16131613

16141614
CLEANUP:
16151615
mp_int_clear(&v);
1616-
V:mp_int_clear(&u);
1617-
U:mp_int_clear(&t);
1616+
V:mp_int_clear(&u);
1617+
U:mp_int_clear(&t);
16181618

16191619
returnres;
16201620
}
@@ -3512,7 +3512,7 @@ s_outlen(mp_int z, mp_size r)
35123512
doubleraw;
35133513

35143514
bits=mp_int_count_bits(z);
3515-
raw= (double)bits*s_log2[r];
3515+
raw= (double)bits*s_log2[r];
35163516

35173517
return (int) (raw+0.999999);
35183518
}

‎contrib/pgcrypto/imath.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ typedef struct mpz
6161
mp_sizeused;
6262
mp_signsign;
6363
}mpz_t ,
64+
6465
*mp_int;
6566

6667
#defineMP_DIGITS(Z) ((Z)->digits)
@@ -117,9 +118,9 @@ mp_resultmp_int_mul_value(mp_int a, int value, mp_int c);
117118
mp_resultmp_int_mul_pow2(mp_inta,intp2,mp_intc);
118119
mp_resultmp_int_sqr(mp_inta,mp_intc);/* c = a * a */
119120

120-
mp_resultmp_int_div(mp_inta,mp_intb,/* q = a / b */
121+
mp_resultmp_int_div(mp_inta,mp_intb,/* q = a / b */
121122
mp_intq,mp_intr);/* r = a % b */
122-
mp_resultmp_int_div_value(mp_inta,intvalue,/* q = a / value */
123+
mp_resultmp_int_div_value(mp_inta,intvalue,/* q = a / value */
123124
mp_intq,int*r);/* r = a % value */
124125
mp_resultmp_int_div_pow2(mp_inta,intp2,/* q = a / 2^p2 */
125126
mp_intq,mp_intr);/* r = q % 2^p2 */

‎contrib/pgcrypto/internal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ rj_init(PX_Cipher *c, const uint8 *key, unsigned klen, const uint8 *iv)
318318
}
319319

320320
staticint
321-
rj_real_init(structint_ctx*cx,intdir)
321+
rj_real_init(structint_ctx*cx,intdir)
322322
{
323323
aes_set_key(&cx->ctx.rj,cx->keybuf,cx->keylen*8,dir);
324324
return0;

‎contrib/pgcrypto/mbuf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct PushFilterOps
5151
* copied (in-place) returns 0 on error
5252
*/
5353
int(*push) (PushFilter*next,void*priv,
54-
constuint8*src,intlen);
54+
constuint8*src,intlen);
5555
int(*flush) (PushFilter*next,void*priv);
5656
void(*free) (void*priv);
5757
};
@@ -69,7 +69,7 @@ struct PullFilterOps
6969
* use buf as work area if NULL in-place copy
7070
*/
7171
int(*pull) (void*priv,PullFilter*src,intlen,
72-
uint8**data_p,uint8*buf,intbuflen);
72+
uint8**data_p,uint8*buf,intbuflen);
7373
void(*free) (void*priv);
7474
};
7575

‎contrib/pgcrypto/pgp-decrypt.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ mdcbuf_init(void **priv_p, void *arg, PullFilter *src)
460460
}
461461

462462
staticint
463-
mdcbuf_finish(structMDCBufData*st)
463+
mdcbuf_finish(structMDCBufData*st)
464464
{
465465
uint8hash[20];
466466
intres;
@@ -485,7 +485,7 @@ mdcbuf_finish(struct MDCBufData * st)
485485
}
486486

487487
staticvoid
488-
mdcbuf_load_data(structMDCBufData*st,uint8*src,intlen)
488+
mdcbuf_load_data(structMDCBufData*st,uint8*src,intlen)
489489
{
490490
uint8*dst=st->pos+st->avail;
491491

@@ -495,14 +495,14 @@ mdcbuf_load_data(struct MDCBufData * st, uint8 *src, int len)
495495
}
496496

497497
staticvoid
498-
mdcbuf_load_mdc(structMDCBufData*st,uint8*src,intlen)
498+
mdcbuf_load_mdc(structMDCBufData*st,uint8*src,intlen)
499499
{
500500
memmove(st->mdc_buf+st->mdc_avail,src,len);
501501
st->mdc_avail+=len;
502502
}
503503

504504
staticint
505-
mdcbuf_refill(structMDCBufData*st,PullFilter*src)
505+
mdcbuf_refill(structMDCBufData*st,PullFilter*src)
506506
{
507507
uint8*data;
508508
intres;

‎contrib/pgcrypto/pgp-pgsql.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ struct debug_expect
132132
};
133133

134134
staticvoid
135-
fill_expect(structdebug_expect*ex,inttext_mode)
135+
fill_expect(structdebug_expect*ex,inttext_mode)
136136
{
137137
ex->debug=0;
138138
ex->expect=0;
@@ -157,7 +157,7 @@ fill_expect(struct debug_expect * ex, int text_mode)
157157
} while (0)
158158

159159
staticvoid
160-
check_expect(PGP_Context*ctx,structdebug_expect*ex)
160+
check_expect(PGP_Context*ctx,structdebug_expect*ex)
161161
{
162162
EX_CHECK(cipher_algo);
163163
EX_CHECK(s2k_mode);
@@ -179,7 +179,7 @@ show_debug(const char *msg)
179179

180180
staticint
181181
set_arg(PGP_Context*ctx,char*key,char*val,
182-
structdebug_expect*ex)
182+
structdebug_expect*ex)
183183
{
184184
intres=0;
185185

@@ -317,7 +317,7 @@ downcase_convert(const uint8 *s, int len)
317317

318318
staticint
319319
parse_args(PGP_Context*ctx,uint8*args,intarg_len,
320-
structdebug_expect*ex)
320+
structdebug_expect*ex)
321321
{
322322
char*str=downcase_convert(args,arg_len);
323323
char*key,
@@ -362,7 +362,7 @@ create_mbuf_from_vardata(text *data)
362362

363363
staticvoid
364364
init_work(PGP_Context**ctx_p,intis_text,
365-
text*args,structdebug_expect*ex)
365+
text*args,structdebug_expect*ex)
366366
{
367367
interr=pgp_init(ctx_p);
368368

‎contrib/pgcrypto/px-crypt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ struct px_crypt_algo
7474
char*id;
7575
unsignedid_len;
7676
char*(*crypt) (constchar*psw,constchar*salt,
77-
char*buf,unsignedlen);
77+
char*buf,unsignedlen);
7878
};
7979

8080
staticconststructpx_crypt_algo
@@ -115,7 +115,7 @@ struct generator
115115
{
116116
char*name;
117117
char*(*gen) (unsigned longcount,constchar*input,intsize,
118-
char*output,intoutput_size);
118+
char*output,intoutput_size);
119119
intinput_len;
120120
intdef_rounds;
121121
intmin_rounds;

‎contrib/pgcrypto/px.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ struct px_cipher
169169
structpx_combo
170170
{
171171
int(*init) (PX_Combo*cx,constuint8*key,unsignedklen,
172-
constuint8*iv,unsignedivlen);
172+
constuint8*iv,unsignedivlen);
173173
int(*encrypt) (PX_Combo*cx,constuint8*data,unsigneddlen,
174-
uint8*res,unsigned*rlen);
174+
uint8*res,unsigned*rlen);
175175
int(*decrypt) (PX_Combo*cx,constuint8*data,unsigneddlen,
176-
uint8*res,unsigned*rlen);
176+
uint8*res,unsigned*rlen);
177177
unsigned(*encrypt_len) (PX_Combo*cx,unsigneddlen);
178178
unsigned(*decrypt_len) (PX_Combo*cx,unsigneddlen);
179179
void(*free) (PX_Combo*cx);

‎contrib/pgcrypto/rijndael.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ typedef struct _rijndael_ctx
4444
/* These are all based on 32 bit unsigned values and will therefore */
4545
/* require endian conversions for big-endian architectures*/
4646

47-
rijndael_ctx*
48-
rijndael_set_key(rijndael_ctx*,constu4byte*,constu4byte,int);
47+
rijndael_ctx*rijndael_set_key(rijndael_ctx*,constu4byte*,constu4byte,int);
4948
voidrijndael_encrypt(rijndael_ctx*,constu4byte*,u4byte*);
5049
voidrijndael_decrypt(rijndael_ctx*,constu4byte*,u4byte*);
5150

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp