Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6560407

Browse files
committed
Pgindent run before 9.1 beta2.
1 parent adf43b2 commit 6560407

Some content is hidden

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

92 files changed

+644
-620
lines changed

contrib/btree_gist/btree_utils_var.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ typedef struct
3333

3434
/* Methods */
3535

36-
bool (*f_gt) (const void *, const void *, Oid); /* greater than */
37-
bool (*f_ge) (const void *, const void *, Oid); /* greater equal */
38-
bool (*f_eq) (const void *, const void *, Oid); /* equal */
39-
bool (*f_le) (const void *, const void *, Oid); /* less equal */
40-
bool (*f_lt) (const void *, const void *, Oid); /* less than */
41-
int32 (*f_cmp) (const void *, const void *, Oid); /* compare */
36+
bool (*f_gt) (const void *, const void *, Oid); /* greater than */
37+
bool (*f_ge) (const void *, const void *, Oid); /* greater equal */
38+
bool (*f_eq) (const void *, const void *, Oid); /* equal */
39+
bool (*f_le) (const void *, const void *, Oid); /* less equal */
40+
bool (*f_lt) (const void *, const void *, Oid); /* less than */
41+
int32 (*f_cmp) (const void *, const void *, Oid); /* compare */
4242
GBT_VARKEY *(*f_l2n) (GBT_VARKEY *); /* convert leaf to node */
4343
} gbtree_vinfo;
4444

contrib/pg_standby/pg_standby.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ usage(void)
533533
"Main intended use as restore_command in recovery.conf:\n"
534534
" restore_command = 'pg_standby [OPTION]... ARCHIVELOCATION %%f %%p %%r'\n"
535535
"e.g.\n"
536-
" restore_command = 'pg_standby /mnt/server/archiverdir %%f %%p %%r'\n");
536+
" restore_command = 'pg_standby /mnt/server/archiverdir %%f %%p %%r'\n");
537537
printf("\nReport bugs to <pgsql-bugs@postgresql.org>.\n");
538538
}
539539

contrib/pg_upgrade/check.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ check_new_cluster_is_empty(void)
362362
/* pg_largeobject and its index should be skipped */
363363
if (strcmp(rel_arr->rels[relnum].nspname, "pg_catalog") != 0)
364364
pg_log(PG_FATAL, "New cluster database \"%s\" is not empty\n",
365-
new_cluster.dbarr.dbs[dbnum].db_name);
365+
new_cluster.dbarr.dbs[dbnum].db_name);
366366
}
367367
}
368368

@@ -381,17 +381,18 @@ check_new_cluster_is_empty(void)
381381
static void
382382
check_old_cluster_has_new_cluster_dbs(void)
383383
{
384-
int old_dbnum, new_dbnum;
384+
int old_dbnum,
385+
new_dbnum;
385386

386387
for (new_dbnum = 0; new_dbnum < new_cluster.dbarr.ndbs; new_dbnum++)
387388
{
388389
for (old_dbnum = 0; old_dbnum < old_cluster.dbarr.ndbs; old_dbnum++)
389390
if (strcmp(old_cluster.dbarr.dbs[old_dbnum].db_name,
390-
new_cluster.dbarr.dbs[new_dbnum].db_name) == 0)
391+
new_cluster.dbarr.dbs[new_dbnum].db_name) == 0)
391392
break;
392393
if (old_dbnum == old_cluster.dbarr.ndbs)
393394
pg_log(PG_FATAL, "New cluster database \"%s\" does not exist in the old cluster\n",
394-
new_cluster.dbarr.dbs[new_dbnum].db_name);
395+
new_cluster.dbarr.dbs[new_dbnum].db_name);
395396
}
396397
}
397398

@@ -495,7 +496,7 @@ check_is_super_user(ClusterInfo *cluster)
495496

496497
if (PQntuples(res) != 1 || strcmp(PQgetvalue(res, 0, 0), "t") != 0)
497498
pg_log(PG_FATAL, "database user \"%s\" is not a superuser\n",
498-
os_info.user);
499+
os_info.user);
499500

500501
PQclear(res);
501502

contrib/pg_upgrade/controldata.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ get_control_data(ClusterInfo *cluster, bool live_check)
9090
pg_putenv("LC_TIME", NULL);
9191
pg_putenv("LANG",
9292
#ifndef WIN32
93-
NULL);
93+
NULL);
9494
#else
9595
/* On Windows the default locale cannot be English, so force it */
96-
"en");
96+
"en");
9797
#endif
9898
pg_putenv("LANGUAGE", NULL);
9999
pg_putenv("LC_ALL", NULL);

contrib/pg_upgrade/exec.c

+12-9
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,17 @@ verify_directories(void)
9999

100100
if (access(".", R_OK | W_OK
101101
#ifndef WIN32
102+
102103
/*
103-
* Do a directory execute check only on Unix because execute permission
104-
* on NTFS means "can execute scripts", which we don't care about.
105-
* Also, X_OK is not defined in the Windows API.
104+
* Do a directory execute check only on Unix because execute permission on
105+
* NTFS means "can execute scripts", which we don't care about. Also, X_OK
106+
* is not defined in the Windows API.
106107
*/
107-
| X_OK
108+
| X_OK
108109
#endif
109-
) != 0)
110+
) != 0)
110111
pg_log(PG_FATAL,
111-
"You must have read and write access in the current directory.\n");
112+
"You must have read and write access in the current directory.\n");
112113

113114
check_bin_dir(&old_cluster);
114115
check_data_dir(old_cluster.pgdata);
@@ -132,16 +133,18 @@ check_data_dir(const char *pg_data)
132133
{
133134
char subDirName[MAXPGPATH];
134135
int subdirnum;
136+
135137
/* start check with top-most directory */
136138
const char *requiredSubdirs[] = {"", "base", "global", "pg_clog",
137139
"pg_multixact", "pg_subtrans", "pg_tblspc", "pg_twophase",
138-
"pg_xlog"};
140+
"pg_xlog"};
139141

140142
for (subdirnum = 0;
141143
subdirnum < sizeof(requiredSubdirs) / sizeof(requiredSubdirs[0]);
142144
++subdirnum)
143145
{
144146
struct stat statBuf;
147+
145148
snprintf(subDirName, sizeof(subDirName), "%s/%s", pg_data,
146149
requiredSubdirs[subdirnum]);
147150

@@ -173,8 +176,8 @@ check_bin_dir(ClusterInfo *cluster)
173176
report_status(PG_FATAL, "check for %s failed: %s\n",
174177
cluster->bindir, getErrorText(errno));
175178
else if (!S_ISDIR(statBuf.st_mode))
176-
report_status(PG_FATAL, "%s is not a directory\n",
177-
cluster->bindir);
179+
report_status(PG_FATAL, "%s is not a directory\n",
180+
cluster->bindir);
178181

179182
validate_exec(cluster->bindir, "postgres");
180183
validate_exec(cluster->bindir, "pg_ctl");

contrib/pg_upgrade/option.c

+1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ parseCommandLine(int argc, char *argv[])
158158
case 'u':
159159
pg_free(os_info.user);
160160
os_info.user = pg_strdup(optarg);
161+
161162
/*
162163
* Push the user name into the environment so pre-9.1
163164
* pg_ctl/libpq uses it.

contrib/pg_upgrade/pg_upgrade.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ void *pg_malloc(int size);
378378
void pg_free(void *ptr);
379379
const char *getErrorText(int errNum);
380380
unsigned int str2uint(const char *str);
381-
void pg_putenv(const char *var, const char *val);
381+
void pg_putenv(const char *var, const char *val);
382382

383383

384384
/* version.c */

contrib/pg_upgrade/server.c

+20-17
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ get_db_conn(ClusterInfo *cluster, const char *db_name)
5252
char conn_opts[MAXPGPATH];
5353

5454
snprintf(conn_opts, sizeof(conn_opts),
55-
"dbname = '%s' user = '%s' port = %d", db_name, os_info.user,
56-
cluster->port);
55+
"dbname = '%s' user = '%s' port = %d", db_name, os_info.user,
56+
cluster->port);
5757

5858
return PQconnectdb(conn_opts);
5959
}
@@ -146,16 +146,18 @@ start_postmaster(ClusterInfo *cluster)
146146
PGconn *conn;
147147
bool exit_hook_registered = false;
148148
int pg_ctl_return = 0;
149+
149150
#ifndef WIN32
150-
char *output_filename = log_opts.filename;
151+
char *output_filename = log_opts.filename;
151152
#else
153+
152154
/*
153155
* On Win32, we can't send both pg_upgrade output and pg_ctl output to the
154156
* same file because we get the error: "The process cannot access the file
155157
* because it is being used by another process." so we have to send all
156158
* other output to 'nul'.
157159
*/
158-
char *output_filename = DEVNULL;
160+
char *output_filename = DEVNULL;
159161
#endif
160162

161163
if (!exit_hook_registered)
@@ -180,13 +182,13 @@ start_postmaster(ClusterInfo *cluster)
180182
"-o \"-p %d %s\" start >> \"%s\" 2>&1" SYSTEMQUOTE,
181183
cluster->bindir, output_filename, cluster->pgdata, cluster->port,
182184
(cluster->controldata.cat_ver >=
183-
BINARY_UPGRADE_SERVER_FLAG_CAT_VER) ? "-b" :
184-
"-c autovacuum=off -c autovacuum_freeze_max_age=2000000000",
185+
BINARY_UPGRADE_SERVER_FLAG_CAT_VER) ? "-b" :
186+
"-c autovacuum=off -c autovacuum_freeze_max_age=2000000000",
185187
log_opts.filename);
186188

187189
/*
188-
* Don't throw an error right away, let connecting throw the error
189-
* because it might supply a reason for the failure.
190+
* Don't throw an error right away, let connecting throw the error because
191+
* it might supply a reason for the failure.
190192
*/
191193
pg_ctl_return = exec_prog(false, "%s", cmd);
192194

@@ -196,7 +198,7 @@ start_postmaster(ClusterInfo *cluster)
196198
{
197199
pg_log(PG_REPORT, "\nconnection to database failed: %s\n",
198200
PQerrorMessage(conn));
199-
if (conn)
201+
if (conn)
200202
PQfinish(conn);
201203
pg_log(PG_FATAL, "unable to connect to %s postmaster started with the command: %s\n",
202204
CLUSTER_NAME(cluster), cmd);
@@ -206,8 +208,8 @@ start_postmaster(ClusterInfo *cluster)
206208
/* If the connection didn't fail, fail now */
207209
if (pg_ctl_return != 0)
208210
pg_log(PG_FATAL, "pg_ctl failed to start the %s server\n",
209-
CLUSTER_NAME(cluster));
210-
211+
CLUSTER_NAME(cluster));
212+
211213
os_info.running_cluster = cluster;
212214
}
213215

@@ -218,11 +220,12 @@ stop_postmaster(bool fast)
218220
char cmd[MAXPGPATH];
219221
const char *bindir;
220222
const char *datadir;
223+
221224
#ifndef WIN32
222-
char *output_filename = log_opts.filename;
225+
char *output_filename = log_opts.filename;
223226
#else
224227
/* See comment in start_postmaster() about why win32 output is ignored. */
225-
char *output_filename = DEVNULL;
228+
char *output_filename = DEVNULL;
226229
#endif
227230

228231
if (os_info.running_cluster == &old_cluster)
@@ -268,17 +271,17 @@ check_pghost_envvar(void)
268271
for (option = start; option->keyword != NULL; option++)
269272
{
270273
if (option->envvar && (strcmp(option->envvar, "PGHOST") == 0 ||
271-
strcmp(option->envvar, "PGHOSTADDR") == 0))
274+
strcmp(option->envvar, "PGHOSTADDR") == 0))
272275
{
273276
const char *value = getenv(option->envvar);
274277

275278
if (value && strlen(value) > 0 &&
276-
/* check for 'local' host values */
279+
/* check for 'local' host values */
277280
(strcmp(value, "localhost") != 0 && strcmp(value, "127.0.0.1") != 0 &&
278281
strcmp(value, "::1") != 0 && value[0] != '/'))
279282
pg_log(PG_FATAL,
280-
"libpq environment variable %s has a non-local server value: %s\n",
281-
option->envvar, value);
283+
"libpq environment variable %s has a non-local server value: %s\n",
284+
option->envvar, value);
282285
}
283286
}
284287

contrib/pg_upgrade/util.c

-1
Original file line numberDiff line numberDiff line change
@@ -281,4 +281,3 @@ pg_putenv(const char *var, const char *val)
281281
#endif
282282
}
283283
}
284-

src/backend/access/gin/ginget.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ callConsistentFn(GinState *ginstate, GinScanKey key)
5656
key->recheckCurItem = true;
5757

5858
return DatumGetBool(FunctionCall8Coll(&ginstate->consistentFn[key->attnum - 1],
59-
ginstate->supportCollation[key->attnum - 1],
59+
ginstate->supportCollation[key->attnum - 1],
6060
PointerGetDatum(key->entryRes),
6161
UInt16GetDatum(key->strategy),
6262
key->query,
6363
UInt32GetDatum(key->nuserentries),
6464
PointerGetDatum(key->extra_data),
65-
PointerGetDatum(&key->recheckCurItem),
65+
PointerGetDatum(&key->recheckCurItem),
6666
PointerGetDatum(key->queryValues),
67-
PointerGetDatum(key->queryCategories)));
67+
PointerGetDatum(key->queryCategories)));
6868
}
6969

7070
/*
@@ -252,7 +252,7 @@ collectMatchBitmap(GinBtreeData *btree, GinBtreeStack *stack,
252252
*----------
253253
*/
254254
cmp = DatumGetInt32(FunctionCall4Coll(&btree->ginstate->comparePartialFn[attnum - 1],
255-
btree->ginstate->supportCollation[attnum - 1],
255+
btree->ginstate->supportCollation[attnum - 1],
256256
scanEntry->queryKey,
257257
idatum,
258258
UInt16GetDatum(scanEntry->strategy),
@@ -1178,10 +1178,10 @@ matchPartialInPendingList(GinState *ginstate, Page page,
11781178
*----------
11791179
*/
11801180
cmp = DatumGetInt32(FunctionCall4Coll(&ginstate->comparePartialFn[entry->attnum - 1],
1181-
ginstate->supportCollation[entry->attnum - 1],
1181+
ginstate->supportCollation[entry->attnum - 1],
11821182
entry->queryKey,
11831183
datum[off - 1],
1184-
UInt16GetDatum(entry->strategy),
1184+
UInt16GetDatum(entry->strategy),
11851185
PointerGetDatum(entry->extra_data)));
11861186
if (cmp == 0)
11871187
return true;

src/backend/access/gin/ginscan.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,11 @@ ginNewScanKey(IndexScanDesc scan)
306306
/* OK to call the extractQueryFn */
307307
queryValues = (Datum *)
308308
DatumGetPointer(FunctionCall7Coll(&so->ginstate.extractQueryFn[skey->sk_attno - 1],
309-
so->ginstate.supportCollation[skey->sk_attno - 1],
309+
so->ginstate.supportCollation[skey->sk_attno - 1],
310310
skey->sk_argument,
311311
PointerGetDatum(&nQueryValues),
312-
UInt16GetDatum(skey->sk_strategy),
313-
PointerGetDatum(&partial_matches),
312+
UInt16GetDatum(skey->sk_strategy),
313+
PointerGetDatum(&partial_matches),
314314
PointerGetDatum(&extra_data),
315315
PointerGetDatum(&nullFlags),
316316
PointerGetDatum(&searchMode)));

src/backend/access/gin/ginutil.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ initGinState(GinState *state, Relation index)
9494
* type for a noncollatable indexed data type (for instance, hstore
9595
* uses text index entries). If there's no index collation then
9696
* specify default collation in case the support functions need
97-
* collation. This is harmless if the support functions don't
98-
* care about collation, so we just do it unconditionally. (We could
97+
* collation. This is harmless if the support functions don't care
98+
* about collation, so we just do it unconditionally. (We could
9999
* alternatively call get_typcollation, but that seems like expensive
100100
* overkill --- there aren't going to be any cases where a GIN storage
101101
* type has a nondefault collation.)
@@ -293,7 +293,7 @@ ginCompareEntries(GinState *ginstate, OffsetNumber attnum,
293293

294294
/* both not null, so safe to call the compareFn */
295295
return DatumGetInt32(FunctionCall2Coll(&ginstate->compareFn[attnum - 1],
296-
ginstate->supportCollation[attnum - 1],
296+
ginstate->supportCollation[attnum - 1],
297297
a, b));
298298
}
299299

@@ -400,7 +400,7 @@ ginExtractEntries(GinState *ginstate, OffsetNumber attnum,
400400
nullFlags = NULL; /* in case extractValue doesn't set it */
401401
entries = (Datum *)
402402
DatumGetPointer(FunctionCall3Coll(&ginstate->extractValueFn[attnum - 1],
403-
ginstate->supportCollation[attnum - 1],
403+
ginstate->supportCollation[attnum - 1],
404404
value,
405405
PointerGetDatum(nentries),
406406
PointerGetDatum(&nullFlags)));

src/backend/access/gist/gist.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ initGISTstate(GISTSTATE *giststate, Relation index)
13991399
/*
14001400
* If the index column has a specified collation, we should honor that
14011401
* while doing comparisons. However, we may have a collatable storage
1402-
* type for a noncollatable indexed data type. If there's no index
1402+
* type for a noncollatable indexed data type. If there's no index
14031403
* collation then specify default collation in case the support
14041404
* functions need collation. This is harmless if the support
14051405
* functions don't care about collation, so we just do it

src/backend/access/gist/gistutil.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ gistdentryinit(GISTSTATE *giststate, int nkey, GISTENTRY *e,
448448
gistentryinit(*e, k, r, pg, o, l);
449449
dep = (GISTENTRY *)
450450
DatumGetPointer(FunctionCall1Coll(&giststate->decompressFn[nkey],
451-
giststate->supportCollation[nkey],
451+
giststate->supportCollation[nkey],
452452
PointerGetDatum(e)));
453453
/* decompressFn may just return the given pointer */
454454
if (dep != e)
@@ -475,7 +475,7 @@ gistcentryinit(GISTSTATE *giststate, int nkey,
475475
gistentryinit(*e, k, r, pg, o, l);
476476
cep = (GISTENTRY *)
477477
DatumGetPointer(FunctionCall1Coll(&giststate->compressFn[nkey],
478-
giststate->supportCollation[nkey],
478+
giststate->supportCollation[nkey],
479479
PointerGetDatum(e)));
480480
/* compressFn may just return the given pointer */
481481
if (cep != e)

src/backend/access/index/indexam.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
*
8181
* Note: the ReindexIsProcessingIndex() check in RELATION_CHECKS is there
8282
* to check that we don't try to scan or do retail insertions into an index
83-
* that is currently being rebuilt or pending rebuild. This helps to catch
83+
* that is currently being rebuilt or pending rebuild. This helps to catch
8484
* things that don't work when reindexing system catalogs. The assertion
8585
* doesn't prevent the actual rebuild because we don't use RELATION_CHECKS
8686
* when calling the index AM's ambuild routine, and there is no reason for

src/backend/access/nbtree/nbtsort.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ _bt_load(BTWriteState *wstate, BTSpool *btspool, BTSpool *btspool2)
738738
{
739739
compare =
740740
DatumGetInt32(FunctionCall2Coll(&entry->sk_func,
741-
entry->sk_collation,
741+
entry->sk_collation,
742742
attrDatum1,
743743
attrDatum2));
744744

0 commit comments

Comments
 (0)