1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-25 20:23:07 +03:00

pgindent run for release 9.3

This is the first run of the Perl-based pgindent script.  Also update
pgindent instructions.
This commit is contained in:
Bruce Momjian
2013-05-29 16:58:43 -04:00
parent 07ab261ef3
commit 9af4159fce
367 changed files with 4222 additions and 3829 deletions

View File

@@ -163,7 +163,7 @@ typedef struct avw_dbase
Oid adw_datid;
char *adw_name;
TransactionId adw_frozenxid;
MultiXactId adw_frozenmulti;
MultiXactId adw_frozenmulti;
PgStat_StatDBEntry *adw_entry;
} avw_dbase;
@@ -220,7 +220,7 @@ typedef struct WorkerInfoData
int wi_cost_delay;
int wi_cost_limit;
int wi_cost_limit_base;
} WorkerInfoData;
} WorkerInfoData;
typedef struct WorkerInfoData *WorkerInfo;
@@ -880,7 +880,7 @@ rebuild_database_list(Oid newdb)
int score;
int nelems;
HTAB *dbhash;
dlist_iter iter;
dlist_iter iter;
/* use fresh stats */
autovac_refresh_stats();
@@ -949,8 +949,8 @@ rebuild_database_list(Oid newdb)
PgStat_StatDBEntry *entry;
/*
* skip databases with no stat entries -- in particular, this gets
* rid of dropped databases
* skip databases with no stat entries -- in particular, this gets rid
* of dropped databases
*/
entry = pgstat_fetch_stat_dbentry(avdb->adl_datid);
if (entry == NULL)
@@ -1162,7 +1162,7 @@ do_start_worker(void)
foreach(cell, dblist)
{
avw_dbase *tmp = lfirst(cell);
dlist_iter iter;
dlist_iter iter;
/* Check to see if this one is at risk of wraparound */
if (TransactionIdPrecedes(tmp->adw_frozenxid, xidForceLimit))
@@ -1296,12 +1296,12 @@ static void
launch_worker(TimestampTz now)
{
Oid dbid;
dlist_iter iter;
dlist_iter iter;
dbid = do_start_worker();
if (OidIsValid(dbid))
{
bool found = false;
bool found = false;
/*
* Walk the database list and update the corresponding entry. If the
@@ -1776,7 +1776,7 @@ autovac_balance_cost(void)
cost_total = 0.0;
dlist_foreach(iter, &AutoVacuumShmem->av_runningWorkers)
{
WorkerInfo worker = dlist_container(WorkerInfoData, wi_links, iter.cur);
WorkerInfo worker = dlist_container(WorkerInfoData, wi_links, iter.cur);
if (worker->wi_proc != NULL &&
worker->wi_cost_limit_base > 0 && worker->wi_cost_delay > 0)
@@ -1794,7 +1794,7 @@ autovac_balance_cost(void)
cost_avail = (double) vac_cost_limit / vac_cost_delay;
dlist_foreach(iter, &AutoVacuumShmem->av_runningWorkers)
{
WorkerInfo worker = dlist_container(WorkerInfoData, wi_links, iter.cur);
WorkerInfo worker = dlist_container(WorkerInfoData, wi_links, iter.cur);
if (worker->wi_proc != NULL &&
worker->wi_cost_limit_base > 0 && worker->wi_cost_delay > 0)
@@ -2631,7 +2631,7 @@ relation_needs_vacanalyze(Oid relid,
/* freeze parameters */
int freeze_max_age;
TransactionId xidForceLimit;
MultiXactId multiForceLimit;
MultiXactId multiForceLimit;
AssertArg(classForm != NULL);
AssertArg(OidIsValid(relid));

View File

@@ -107,7 +107,7 @@
*/
typedef struct
{
RelFileNode rnode;
RelFileNode rnode;
ForkNumber forknum;
BlockNumber segno; /* see md.c for special values */
/* might add a real request-type field later; not needed yet */
@@ -930,8 +930,8 @@ CheckpointerShmemInit(void)
{
/*
* First time through, so initialize. Note that we zero the whole
* requests array; this is so that CompactCheckpointerRequestQueue
* can assume that any pad bytes in the request structs are zeroes.
* requests array; this is so that CompactCheckpointerRequestQueue can
* assume that any pad bytes in the request structs are zeroes.
*/
MemSet(CheckpointerShmem, 0, size);
SpinLockInit(&CheckpointerShmem->ckpt_lck);

View File

@@ -101,10 +101,10 @@ fork_process(void)
#endif /* LINUX_OOM_SCORE_ADJ */
/*
* Older Linux kernels have oom_adj not oom_score_adj. This works
* similarly except with a different scale of adjustment values.
* If it's necessary to build Postgres to work with either API,
* you can define both LINUX_OOM_SCORE_ADJ and LINUX_OOM_ADJ.
* Older Linux kernels have oom_adj not oom_score_adj. This works
* similarly except with a different scale of adjustment values. If
* it's necessary to build Postgres to work with either API, you can
* define both LINUX_OOM_SCORE_ADJ and LINUX_OOM_ADJ.
*/
#ifdef LINUX_OOM_ADJ
{

View File

@@ -246,7 +246,7 @@ PgArchiverMain(int argc, char *argv[])
elog(FATAL, "setsid() failed: %m");
#endif
InitializeLatchSupport(); /* needed for latch waits */
InitializeLatchSupport(); /* needed for latch waits */
InitLatch(&mainloop_latch); /* initialize latch used in main loop */

View File

@@ -2586,7 +2586,7 @@ pgstat_report_activity(BackendState state, const char *cmd_str)
{
/*
* track_activities is disabled, but we last reported a
* non-disabled state. As our final update, change the state and
* non-disabled state. As our final update, change the state and
* clear fields we will not be updating anymore.
*/
beentry->st_changecount++;
@@ -4401,9 +4401,9 @@ pgstat_recv_inquiry(PgStat_MsgInquiry *msg, int len)
* request's cutoff time, update it; otherwise there's nothing to do.
*
* Note that if a request is found, we return early and skip the below
* check for clock skew. This is okay, since the only way for a DB request
* to be present in the list is that we have been here since the last write
* round.
* check for clock skew. This is okay, since the only way for a DB
* request to be present in the list is that we have been here since the
* last write round.
*/
slist_foreach(iter, &last_statrequests)
{

View File

@@ -183,7 +183,7 @@ static Backend *ShmemBackendArray;
* List of background workers.
*
* A worker that requests a database connection during registration will have
* rw_backend set, and will be present in BackendList. Note: do not rely on
* rw_backend set, and will be present in BackendList. Note: do not rely on
* rw_backend being non-NULL for shmem-connected workers!
*/
typedef struct RegisteredBgWorker
@@ -197,7 +197,7 @@ typedef struct RegisteredBgWorker
int rw_cookie;
#endif
slist_node rw_lnode; /* list link */
} RegisteredBgWorker;
} RegisteredBgWorker;
static slist_head BackgroundWorkerList = SLIST_STATIC_INIT(BackgroundWorkerList);
@@ -207,8 +207,10 @@ BackgroundWorker *MyBgworkerEntry = NULL;
/* The socket number we are listening for connections on */
int PostPortNumber;
/* The directory names for Unix socket(s) */
char *Unix_socket_directories;
/* The TCP listen address(es) */
char *ListenAddresses;
@@ -446,7 +448,7 @@ typedef struct
HANDLE procHandle;
DWORD procId;
} win32_deadchild_waitinfo;
#endif /* WIN32 */
#endif /* WIN32 */
static pid_t backend_forkexec(Port *port);
static pid_t internal_forkexec(int argc, char *argv[], Port *port);
@@ -1022,7 +1024,7 @@ PostmasterMain(int argc, char *argv[])
/* syntax error in list */
ereport(FATAL,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("invalid list syntax for \"unix_socket_directories\"")));
errmsg("invalid list syntax for \"unix_socket_directories\"")));
}
foreach(l, elemlist)
@@ -1212,8 +1214,8 @@ PostmasterMain(int argc, char *argv[])
/*
* We can start up without the IDENT file, although it means that you
* cannot log in using any of the authentication methods that need a
* user name mapping. load_ident() already logged the details of
* error to the log.
* user name mapping. load_ident() already logged the details of error
* to the log.
*/
}
@@ -1414,7 +1416,7 @@ checkDataDir(void)
* we don't actually sleep so that they are quickly serviced.
*/
static void
DetermineSleepTime(struct timeval *timeout)
DetermineSleepTime(struct timeval * timeout)
{
TimestampTz next_wakeup = 0;
@@ -2969,7 +2971,7 @@ HandleChildCrash(int pid, int exitstatus, const char *procname)
rw = slist_container(RegisteredBgWorker, rw_lnode, siter.cur);
if (rw->rw_pid == 0)
continue; /* not running */
continue; /* not running */
if (rw->rw_pid == pid)
{
/*
@@ -3819,9 +3821,9 @@ BackendInitialize(Port *port)
remote_host[0] = '\0';
remote_port[0] = '\0';
if ((ret = pg_getnameinfo_all(&port->raddr.addr, port->raddr.salen,
remote_host, sizeof(remote_host),
remote_port, sizeof(remote_port),
(log_hostname ? 0 : NI_NUMERICHOST) | NI_NUMERICSERV)) != 0)
remote_host, sizeof(remote_host),
remote_port, sizeof(remote_port),
(log_hostname ? 0 : NI_NUMERICHOST) | NI_NUMERICSERV)) != 0)
ereport(WARNING,
(errmsg_internal("pg_getnameinfo_all() failed: %s",
gai_strerror(ret))));
@@ -4503,7 +4505,7 @@ SubPostmasterMain(int argc, char *argv[])
/* Attach process to shared data structures */
CreateSharedMemoryAndSemaphores(false, 0);
AuxiliaryProcessMain(argc - 2, argv + 2); /* does not return */
AuxiliaryProcessMain(argc - 2, argv + 2); /* does not return */
}
if (strcmp(argv[1], "--forkavlauncher") == 0)
{
@@ -4519,7 +4521,7 @@ SubPostmasterMain(int argc, char *argv[])
/* Attach process to shared data structures */
CreateSharedMemoryAndSemaphores(false, 0);
AutoVacLauncherMain(argc - 2, argv + 2); /* does not return */
AutoVacLauncherMain(argc - 2, argv + 2); /* does not return */
}
if (strcmp(argv[1], "--forkavworker") == 0)
{
@@ -4535,7 +4537,7 @@ SubPostmasterMain(int argc, char *argv[])
/* Attach process to shared data structures */
CreateSharedMemoryAndSemaphores(false, 0);
AutoVacWorkerMain(argc - 2, argv + 2); /* does not return */
AutoVacWorkerMain(argc - 2, argv + 2); /* does not return */
}
if (strncmp(argv[1], "--forkbgworker=", 15) == 0)
{
@@ -4564,7 +4566,7 @@ SubPostmasterMain(int argc, char *argv[])
/* Do not want to attach to shared memory */
PgArchiverMain(argc, argv); /* does not return */
PgArchiverMain(argc, argv); /* does not return */
}
if (strcmp(argv[1], "--forkcol") == 0)
{
@@ -4573,7 +4575,7 @@ SubPostmasterMain(int argc, char *argv[])
/* Do not want to attach to shared memory */
PgstatCollectorMain(argc, argv); /* does not return */
PgstatCollectorMain(argc, argv); /* does not return */
}
if (strcmp(argv[1], "--forklog") == 0)
{
@@ -4582,7 +4584,7 @@ SubPostmasterMain(int argc, char *argv[])
/* Do not want to attach to shared memory */
SysLoggerMain(argc, argv); /* does not return */
SysLoggerMain(argc, argv); /* does not return */
}
abort(); /* shouldn't get here */
@@ -5214,11 +5216,11 @@ RegisterBackgroundWorker(BackgroundWorker *worker)
}
/*
* Enforce maximum number of workers. Note this is overly restrictive:
* we could allow more non-shmem-connected workers, because these don't
* count towards the MAX_BACKENDS limit elsewhere. This doesn't really
* matter for practical purposes; several million processes would need to
* run on a single server.
* Enforce maximum number of workers. Note this is overly restrictive: we
* could allow more non-shmem-connected workers, because these don't count
* towards the MAX_BACKENDS limit elsewhere. This doesn't really matter
* for practical purposes; several million processes would need to run on
* a single server.
*/
if (++numworkers > maxworkers)
{
@@ -6156,7 +6158,7 @@ ShmemBackendArrayRemove(Backend *bn)
#ifdef WIN32
/*
* Subset implementation of waitpid() for Windows. We assume pid is -1
* Subset implementation of waitpid() for Windows. We assume pid is -1
* (that is, check all child processes) and options is WNOHANG (don't wait).
*/
static pid_t

View File

@@ -252,7 +252,7 @@ SysLoggerMain(int argc, char *argv[])
elog(FATAL, "setsid() failed: %m");
#endif
InitializeLatchSupport(); /* needed for latch waits */
InitializeLatchSupport(); /* needed for latch waits */
/* Initialize private latch for use by signal handlers */
InitLatch(&sysLoggerLatch);
@@ -583,8 +583,8 @@ SysLogger_Start(void)
/*
* The initial logfile is created right in the postmaster, to verify that
* the Log_directory is writable. We save the reference time so that
* the syslogger child process can recompute this file name.
* the Log_directory is writable. We save the reference time so that the
* syslogger child process can recompute this file name.
*
* It might look a bit strange to re-do this during a syslogger restart,
* but we must do so since the postmaster closed syslogFile after the