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

Commit239d769

Browse files
committed
pgindent run for 9.0, second run
1 parent52783b2 commit239d769

File tree

127 files changed

+1497
-1411
lines changed

Some content is hidden

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

127 files changed

+1497
-1411
lines changed

‎contrib/dblink/dblink.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Darko Prenosil <Darko.Prenosil@finteh.hr>
99
* Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
1010
*
11-
* $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.98 2010/06/15 20:29:01 tgl Exp $
11+
* $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.99 2010/07/06 19:18:54 momjian Exp $
1212
* Copyright (c) 2001-2010, PostgreSQL Global Development Group
1313
* ALL RIGHTS RESERVED;
1414
*
@@ -1797,7 +1797,7 @@ get_sql_delete(Relation rel, int *pkattnums, int pknumatts, char **tgt_pkattvals
17971797
appendStringInfo(&buf," AND ");
17981798

17991799
appendStringInfoString(&buf,
1800-
quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum]->attname)));
1800+
quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum]->attname)));
18011801

18021802
if (tgt_pkattvals[i]!=NULL)
18031803
appendStringInfo(&buf," = %s",
@@ -1880,7 +1880,7 @@ get_sql_update(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals
18801880
appendStringInfo(&buf," AND ");
18811881

18821882
appendStringInfo(&buf,"%s",
1883-
quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum]->attname)));
1883+
quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum]->attname)));
18841884

18851885
val=tgt_pkattvals[i];
18861886

@@ -1976,8 +1976,8 @@ get_tuple_of_interest(Relation rel, int *pkattnums, int pknumatts, char **src_pk
19761976
* Build sql statement to look up tuple of interest, ie, the one matching
19771977
* src_pkattvals. We used to use "SELECT *" here, but it's simpler to
19781978
* generate a result tuple that matches the table's physical structure,
1979-
* with NULLs for any dropped columns.Otherwise we have to deal with
1980-
*twodifferent tupdescs and everything's very confusing.
1979+
* with NULLs for any dropped columns.Otherwise we have to deal with two
1980+
* different tupdescs and everything's very confusing.
19811981
*/
19821982
appendStringInfoString(&buf,"SELECT ");
19831983

@@ -1990,7 +1990,7 @@ get_tuple_of_interest(Relation rel, int *pkattnums, int pknumatts, char **src_pk
19901990
appendStringInfoString(&buf,"NULL");
19911991
else
19921992
appendStringInfoString(&buf,
1993-
quote_ident_cstr(NameStr(tupdesc->attrs[i]->attname)));
1993+
quote_ident_cstr(NameStr(tupdesc->attrs[i]->attname)));
19941994
}
19951995

19961996
appendStringInfo(&buf," FROM %s WHERE ",relname);
@@ -2003,7 +2003,7 @@ get_tuple_of_interest(Relation rel, int *pkattnums, int pknumatts, char **src_pk
20032003
appendStringInfo(&buf," AND ");
20042004

20052005
appendStringInfoString(&buf,
2006-
quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum]->attname)));
2006+
quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum]->attname)));
20072007

20082008
if (src_pkattvals[i]!=NULL)
20092009
appendStringInfo(&buf," = %s",
@@ -2417,9 +2417,9 @@ validate_pkattnums(Relation rel,
24172417
/* Validate attnums and convert to internal form */
24182418
for (i=0;i<pknumatts_arg;i++)
24192419
{
2420-
intpkattnum=pkattnums_arg->values[i];
2421-
intlnum;
2422-
intj;
2420+
intpkattnum=pkattnums_arg->values[i];
2421+
intlnum;
2422+
intj;
24232423

24242424
/* Can throw error immediately if out of range */
24252425
if (pkattnum <=0||pkattnum>natts)

‎contrib/fuzzystrmatch/dmetaphone.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* This is a port of the Double Metaphone algorithm for use in PostgreSQL.
33
*
4-
* $PostgreSQL: pgsql/contrib/fuzzystrmatch/dmetaphone.c,v 1.14 2010/04/05 02:46:20 adunstan Exp $
4+
* $PostgreSQL: pgsql/contrib/fuzzystrmatch/dmetaphone.c,v 1.15 2010/07/06 19:18:55 momjian Exp $
55
*
66
* Double Metaphone computes 2 "sounds like" strings - a primary and an
77
* alternate. In most cases they are the same, but for foreign names
@@ -461,7 +461,7 @@ DoubleMetaphone(char *str, char **codes)
461461
current+=1;
462462
break;
463463

464-
case'\xc7':/* C with cedilla */
464+
case'\xc7':/* C with cedilla */
465465
MetaphAdd(primary,"S");
466466
MetaphAdd(secondary,"S");
467467
current+=1;
@@ -1037,7 +1037,7 @@ DoubleMetaphone(char *str, char **codes)
10371037
MetaphAdd(secondary,"N");
10381038
break;
10391039

1040-
case'\xd1':/* N with tilde */
1040+
case'\xd1':/* N with tilde */
10411041
current+=1;
10421042
MetaphAdd(primary,"N");
10431043
MetaphAdd(secondary,"N");

‎contrib/pg_archivecleanup/pg_archivecleanup.c

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $PostgreSQL: pgsql/contrib/pg_archivecleanup/pg_archivecleanup.c,v 1.2 2010/06/17 17:31:27 tgl Exp $
2+
* $PostgreSQL: pgsql/contrib/pg_archivecleanup/pg_archivecleanup.c,v 1.3 2010/07/06 19:18:55 momjian Exp $
33
*
44
* pg_archivecleanup.c
55
*
@@ -40,8 +40,9 @@ booldebug = false;/* are we debugging? */
4040
char*archiveLocation;/* where to find the archive? */
4141
char*restartWALFileName;/* the file from which we can restart restore */
4242
charWALFilePath[MAXPGPATH];/* the file path including archive */
43-
charexclusiveCleanupFileName[MAXPGPATH];/* the oldest file we want to
44-
* remain in archive */
43+
charexclusiveCleanupFileName[MAXPGPATH];/* the oldest file we
44+
* want to remain in
45+
* archive */
4546

4647

4748
/* =====================================================================
@@ -68,14 +69,14 @@ charexclusiveCleanupFileName[MAXPGPATH];/* the oldest file we want to
6869
/*
6970
*Initialize allows customized commands into the archive cleanup program.
7071
*
71-
*You may wish to add code to check for tape libraries, etc..
72+
*You may wish to add code to check for tape libraries, etc..
7273
*/
7374
staticvoid
7475
Initialize(void)
7576
{
7677
/*
77-
* This code assumes that archiveLocation is a directory, so we use
78-
*statto test if it's accessible.
78+
* This code assumes that archiveLocation is a directory, so we use stat
79+
* to test if it's accessible.
7980
*/
8081
structstatstat_buf;
8182

@@ -100,22 +101,21 @@ CleanupPriorWALFiles(void)
100101
while ((xlde=readdir(xldir))!=NULL)
101102
{
102103
/*
103-
* We ignore the timeline part of the XLOG segment identifiers
104-
*indeciding whether a segment is still needed. This
105-
*ensures thatwe won't prematurely remove a segment from a
106-
*parent timeline.We could probably be a little more
107-
*proactive about removingsegments of non-parent timelines,
108-
*but that would be a whole lotmore complicated.
104+
* We ignore the timeline part of the XLOG segment identifiers in
105+
* deciding whether a segment is still needed.This ensures that
106+
* we won't prematurely remove a segment from a parent timeline.
107+
* We could probably be a little more proactive about removing
108+
* segments of non-parent timelines, but that would be a whole lot
109+
* more complicated.
109110
*
110-
* We use the alphanumeric sorting property of the filenames
111-
* to decide which ones are earlier than the
112-
* exclusiveCleanupFileName file. Note that this means files
113-
* are not removed in the order they were originally written,
114-
* in case this worries you.
111+
* We use the alphanumeric sorting property of the filenames to
112+
* decide which ones are earlier than the exclusiveCleanupFileName
113+
* file. Note that this means files are not removed in the order
114+
* they were originally written, in case this worries you.
115115
*/
116116
if (strlen(xlde->d_name)==XLOG_DATA_FNAME_LEN&&
117-
strspn(xlde->d_name,"0123456789ABCDEF")==XLOG_DATA_FNAME_LEN&&
118-
strcmp(xlde->d_name+8,exclusiveCleanupFileName+8)<0)
117+
strspn(xlde->d_name,"0123456789ABCDEF")==XLOG_DATA_FNAME_LEN&&
118+
strcmp(xlde->d_name+8,exclusiveCleanupFileName+8)<0)
119119
{
120120
#ifdefWIN32
121121
snprintf(WALFilePath,MAXPGPATH,"%s\\%s",archiveLocation,xlde->d_name);
@@ -152,13 +152,13 @@ CleanupPriorWALFiles(void)
152152
staticvoid
153153
SetWALFileNameForCleanup(void)
154154
{
155-
boolfnameOK= false;
155+
boolfnameOK= false;
156156

157157
/*
158-
* If restartWALFileName is a WAL file name then just use it directly.
159-
*IfrestartWALFileName is a .backup filename, make sure we use
160-
*the prefixof the filename, otherwise we will remove wrong files
161-
*since000000010000000000000010.00000020.backup is after
158+
* If restartWALFileName is a WAL file name then just use it directly. If
159+
* restartWALFileName is a .backup filename, make sure we use the prefix
160+
* of the filename, otherwise we will remove wrong files since
161+
* 000000010000000000000010.00000020.backup is after
162162
* 000000010000000000000010.
163163
*/
164164
if (strlen(restartWALFileName)==XLOG_DATA_FNAME_LEN&&
@@ -169,17 +169,20 @@ SetWALFileNameForCleanup(void)
169169
}
170170
elseif (strlen(restartWALFileName)==XLOG_BACKUP_FNAME_LEN)
171171
{
172-
intargs;
172+
intargs;
173173
uint32tli=1,
174174
log=0,
175175
seg=0,
176176
offset=0;
177+
177178
args=sscanf(restartWALFileName,"%08X%08X%08X.%08X.backup",&tli,&log,&seg,&offset);
178179
if (args==4)
179180
{
180181
fnameOK= true;
182+
181183
/*
182-
* Use just the prefix of the filename, ignore everything after first period
184+
* Use just the prefix of the filename, ignore everything after
185+
* first period
183186
*/
184187
XLogFileName(exclusiveCleanupFileName,tli,log,seg);
185188
}
@@ -205,12 +208,12 @@ usage(void)
205208
printf("Usage:\n");
206209
printf(" %s [OPTION]... ARCHIVELOCATION OLDESTKEPTWALFILE\n",progname);
207210
printf("\n"
208-
"for use as an archive_cleanup_command in the recovery.conf when standby_mode = on:\n"
211+
"for use as an archive_cleanup_command in the recovery.conf when standby_mode = on:\n"
209212
" archive_cleanup_command = 'pg_archivecleanup [OPTION]... ARCHIVELOCATION %%r'\n"
210213
"e.g.\n"
211214
" archive_cleanup_command = 'pg_archivecleanup /mnt/server/archiverdir %%r'\n");
212215
printf("\n"
213-
"or for use as a standalone archive cleaner:\n"
216+
"or for use as a standalone archive cleaner:\n"
214217
"e.g.\n"
215218
" pg_archivecleanup /mnt/server/archiverdir 000000010000000000000010.00000020.backup\n");
216219
printf("\nOptions:\n");
@@ -258,9 +261,10 @@ main(int argc, char **argv)
258261

259262
/*
260263
* We will go to the archiveLocation to check restartWALFileName.
261-
* restartWALFileName may not exist anymore, which would not be an error, so
262-
* we separate the archiveLocation and restartWALFileName so we can check
263-
* separately whether archiveLocation exists, if not that is an error
264+
* restartWALFileName may not exist anymore, which would not be an error,
265+
* so we separate the archiveLocation and restartWALFileName so we can
266+
* check separately whether archiveLocation exists, if not that is an
267+
* error
264268
*/
265269
if (optind<argc)
266270
{

‎contrib/pg_upgrade/check.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*server checks and output routines
55
*
66
*Copyright (c) 2010, PostgreSQL Global Development Group
7-
*$PostgreSQL: pgsql/contrib/pg_upgrade/check.c,v 1.10 2010/07/03 16:33:14 momjian Exp $
7+
*$PostgreSQL: pgsql/contrib/pg_upgrade/check.c,v 1.11 2010/07/06 19:18:55 momjian Exp $
88
*/
99

1010
#include"pg_upgrade.h"
@@ -152,8 +152,8 @@ issue_warnings(migratorContext *ctx, char *sequence_script_file_name)
152152
{
153153
prep_status(ctx,"Adjusting sequences");
154154
exec_prog(ctx, true,
155-
SYSTEMQUOTE"\"%s/psql\" --set ON_ERROR_STOP=on --port %d "
156-
"--username \"%s\" -f \"%s\" --dbname template1 >> \"%s\""
155+
SYSTEMQUOTE"\"%s/psql\" --set ON_ERROR_STOP=on --port %d "
156+
"--username \"%s\" -f \"%s\" --dbname template1 >> \"%s\""
157157
SYSTEMQUOTE,
158158
ctx->new.bindir,ctx->new.port,ctx->user,
159159
sequence_script_file_name,ctx->logfile);
@@ -217,7 +217,7 @@ check_cluster_versions(migratorContext *ctx)
217217
/* Only current PG version is supported as a target */
218218
if (GET_MAJOR_VERSION(ctx->new.major_version)!=GET_MAJOR_VERSION(PG_VERSION_NUM))
219219
pg_log(ctx,PG_FATAL,"This utility can only upgrade to PostgreSQL version %s.\n",
220-
PG_MAJORVERSION);
220+
PG_MAJORVERSION);
221221

222222
/*
223223
* We can't allow downgrading because we use the target pg_dumpall, and
@@ -375,7 +375,7 @@ check_new_db_is_empty(migratorContext *ctx)
375375
*/
376376
void
377377
create_script_for_old_cluster_deletion(migratorContext*ctx,
378-
char**deletion_script_file_name)
378+
char**deletion_script_file_name)
379379
{
380380
FILE*script=NULL;
381381
inttblnum;
@@ -389,7 +389,7 @@ create_script_for_old_cluster_deletion(migratorContext *ctx,
389389

390390
if ((script=fopen(*deletion_script_file_name,"w"))==NULL)
391391
pg_log(ctx,PG_FATAL,"Could not create necessary file: %s\n",
392-
*deletion_script_file_name);
392+
*deletion_script_file_name);
393393

394394
#ifndefWIN32
395395
/* add shebang header */
@@ -420,6 +420,7 @@ create_script_for_old_cluster_deletion(migratorContext *ctx,
420420
}
421421
}
422422
else
423+
423424
/*
424425
* Simply delete the tablespace directory, which might be ".old"
425426
* or a version-specific subdirectory.
@@ -433,7 +434,7 @@ create_script_for_old_cluster_deletion(migratorContext *ctx,
433434
#ifndefWIN32
434435
if (chmod(*deletion_script_file_name,S_IRWXU)!=0)
435436
pg_log(ctx,PG_FATAL,"Could not add execute permission to file: %s\n",
436-
*deletion_script_file_name);
437+
*deletion_script_file_name);
437438
#endif
438439

439440
check_ok(ctx);

‎contrib/pg_upgrade/controldata.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*controldata functions
55
*
66
*Copyright (c) 2010, PostgreSQL Global Development Group
7-
*$PostgreSQL: pgsql/contrib/pg_upgrade/controldata.c,v 1.8 2010/07/03 16:33:14 momjian Exp $
7+
*$PostgreSQL: pgsql/contrib/pg_upgrade/controldata.c,v 1.9 2010/07/06 19:18:55 momjian Exp $
88
*/
99

1010
#include"pg_upgrade.h"
@@ -93,6 +93,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
9393
fputs(bufin,ctx->debug_fd);
9494

9595
#ifdefWIN32
96+
9697
/*
9798
* Due to an installer bug, LANG=C doesn't work for PG 8.3.3, but does
9899
* work 8.2.6 and 8.3.7, so check for non-ASCII output and suggest a

‎contrib/pg_upgrade/dump.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*dump functions
55
*
66
*Copyright (c) 2010, PostgreSQL Global Development Group
7-
*$PostgreSQL: pgsql/contrib/pg_upgrade/dump.c,v 1.6 2010/07/03 16:33:14 momjian Exp $
7+
*$PostgreSQL: pgsql/contrib/pg_upgrade/dump.c,v 1.7 2010/07/06 19:18:55 momjian Exp $
88
*/
99

1010
#include"pg_upgrade.h"
@@ -24,7 +24,7 @@ generate_old_dump(migratorContext *ctx)
2424
exec_prog(ctx, true,
2525
SYSTEMQUOTE"\"%s/pg_dumpall\" --port %d --username \"%s\" "
2626
"--schema-only --binary-upgrade > \"%s/"ALL_DUMP_FILE"\""
27-
SYSTEMQUOTE,ctx->new.bindir,ctx->old.port,ctx->user,ctx->cwd);
27+
SYSTEMQUOTE,ctx->new.bindir,ctx->old.port,ctx->user,ctx->cwd);
2828
check_ok(ctx);
2929
}
3030

‎contrib/pg_upgrade/exec.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*execution functions
55
*
66
*Copyright (c) 2010, PostgreSQL Global Development Group
7-
*$PostgreSQL: pgsql/contrib/pg_upgrade/exec.c,v 1.7 2010/07/03 16:33:14 momjian Exp $
7+
*$PostgreSQL: pgsql/contrib/pg_upgrade/exec.c,v 1.8 2010/07/06 19:18:55 momjian Exp $
88
*/
99

1010
#include"pg_upgrade.h"
@@ -14,7 +14,7 @@
1414

1515

1616
staticvoidcheckBinDir(migratorContext*ctx,ClusterInfo*cluster);
17-
staticintcheck_exec(migratorContext*ctx,constchar*dir,constchar*cmdName);
17+
staticintcheck_exec(migratorContext*ctx,constchar*dir,constchar*cmdName);
1818
staticconstchar*validate_exec(constchar*path);
1919
staticintcheck_data_dir(migratorContext*ctx,constchar*pg_data);
2020

@@ -311,5 +311,3 @@ check_data_dir(migratorContext *ctx, const char *pg_data)
311311

312312
return (fail) ?-1 :0;
313313
}
314-
315-

‎contrib/pg_upgrade/file.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*file system operations
55
*
66
*Copyright (c) 2010, PostgreSQL Global Development Group
7-
*$PostgreSQL: pgsql/contrib/pg_upgrade/file.c,v 1.12 2010/07/03 16:33:14 momjian Exp $
7+
*$PostgreSQL: pgsql/contrib/pg_upgrade/file.c,v 1.13 2010/07/06 19:18:55 momjian Exp $
88
*/
99

1010
#include"pg_upgrade.h"
@@ -226,7 +226,7 @@ copy_file(const char *srcfile, const char *dstfile, bool force)
226226
*/
227227
int
228228
pg_scandir(migratorContext*ctx,constchar*dirname,
229-
structdirent***namelist,
229+
structdirent***namelist,
230230
int (*selector) (conststructdirent*))
231231
{
232232
#ifndefHAVE_SCANDIR
@@ -235,13 +235,14 @@ pg_scandir(migratorContext *ctx, const char *dirname,
235235
/*
236236
* scandir() is originally from BSD 4.3, which had the third argument as
237237
* non-const. Linux and other C libraries have updated it to use a const.
238-
* http://unix.derkeiler.com/Mailing-Lists/FreeBSD/questions/2005-12/msg00214.html
238+
* http://unix.derkeiler.com/Mailing-Lists/FreeBSD/questions/2005-12/msg002
239+
* 14.html
239240
*
240241
* Here we try to guess which libc's need const, and which don't. The net
241242
* goal here is to try to suppress a compiler warning due to a prototype
242243
* mismatch of const usage. Ideally we would do this via autoconf, but
243-
* autoconf doesn't have a suitable builtin test and it seems overkill
244-
*toadd one just to avoid a warning.
244+
* autoconf doesn't have a suitable builtin test and it seems overkill to
245+
* add one just to avoid a warning.
245246
*/
246247
#elif defined(__FreeBSD__)|| defined(__bsdi__)|| defined(__darwin__)|| defined(__OpenBSD__)
247248
/* no const */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp