diff options
Diffstat (limited to 'src/bin')
64 files changed, 181 insertions, 186 deletions
diff --git a/src/bin/initdb/findtimezone.c b/src/bin/initdb/findtimezone.c index edfeb52d546..96aa39021e8 100644 --- a/src/bin/initdb/findtimezone.c +++ b/src/bin/initdb/findtimezone.c @@ -279,7 +279,7 @@ score_timezone(const char *tzname, struct tztry *tt) if (pgtm->tm_zone == NULL) return -1; /* probably shouldn't happen */ memset(cbuf, 0, sizeof(cbuf)); - strftime(cbuf, sizeof(cbuf) - 1, "%Z", systm); /* zone abbr */ + strftime(cbuf, sizeof(cbuf) - 1, "%Z", systm); /* zone abbr */ if (strcmp(cbuf, pgtm->tm_zone) != 0) { #ifdef DEBUG_IDENTIFY_TIMEZONE @@ -1336,7 +1336,7 @@ identify_system_timezone(void) #endif return NULL; /* go to GMT */ } -#endif /* WIN32 */ +#endif /* WIN32 */ /* diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index bc8a8706c16..7fdaca868a1 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -1231,7 +1231,7 @@ setup_config(void) conflines = replace_token(conflines, "host replication all ::1", "#host replication all ::1"); -#endif /* HAVE_IPV6 */ +#endif /* HAVE_IPV6 */ /* Replace default authentication methods */ conflines = replace_token(conflines, @@ -2961,7 +2961,7 @@ main(int argc, char *argv[]) {"show", no_argument, NULL, 's'}, {"noclean", no_argument, NULL, 'n'}, /* for backwards compatibility */ {"no-clean", no_argument, NULL, 'n'}, - {"nosync", no_argument, NULL, 'N'}, /* for backwards compatibility */ + {"nosync", no_argument, NULL, 'N'}, /* for backwards compatibility */ {"no-sync", no_argument, NULL, 'N'}, {"sync-only", no_argument, NULL, 'S'}, {"waldir", required_argument, NULL, 'X'}, diff --git a/src/bin/pg_archivecleanup/pg_archivecleanup.c b/src/bin/pg_archivecleanup/pg_archivecleanup.c index 990fe47e03d..c5e344f3cf3 100644 --- a/src/bin/pg_archivecleanup/pg_archivecleanup.c +++ b/src/bin/pg_archivecleanup/pg_archivecleanup.c @@ -28,14 +28,13 @@ const char *progname; /* Options and defaults */ bool debug = false; /* are we debugging? */ bool dryrun = false; /* are we performing a dry-run operation? */ -char *additional_ext = NULL; /* Extension to remove from filenames */ +char *additional_ext = NULL; /* Extension to remove from filenames */ char *archiveLocation; /* where to find the archive? */ char *restartWALFileName; /* the file from which we can restart restore */ char WALFilePath[MAXPGPATH * 2]; /* the file path including archive */ -char exclusiveCleanupFileName[MAXFNAMELEN]; /* the oldest file we - * want to remain in - * archive */ +char exclusiveCleanupFileName[MAXFNAMELEN]; /* the oldest file we want + * to remain in archive */ /* ===================================================================== @@ -315,8 +314,8 @@ main(int argc, char **argv) dryrun = true; break; case 'x': - additional_ext = pg_strdup(optarg); /* Extension to remove - * from xlogfile names */ + additional_ext = pg_strdup(optarg); /* Extension to remove + * from xlogfile names */ break; default: fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname); diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index 54d27dc658a..2c4efd76457 100644 --- a/src/bin/pg_basebackup/pg_basebackup.c +++ b/src/bin/pg_basebackup/pg_basebackup.c @@ -87,7 +87,7 @@ static IncludeWal includewal = STREAM_WAL; static bool fastcheckpoint = false; static bool writerecoveryconf = false; static bool do_sync = true; -static int standby_message_timeout = 10 * 1000; /* 10 sec = default */ +static int standby_message_timeout = 10 * 1000; /* 10 sec = default */ static pg_time_t last_progress_report = 0; static int32 maxrate = 0; /* no limit by default */ static char *replication_slot = NULL; @@ -1398,7 +1398,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum) /* * Directory */ - filename[strlen(filename) - 1] = '\0'; /* Remove trailing slash */ + filename[strlen(filename) - 1] = '\0'; /* Remove trailing slash */ if (mkdir(filename, S_IRWXU) != 0) { /* @@ -1442,7 +1442,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum) * are, you can call it an undocumented feature that you * can map them too.) */ - filename[strlen(filename) - 1] = '\0'; /* Remove trailing slash */ + filename[strlen(filename) - 1] = '\0'; /* Remove trailing slash */ mapped_tblspc_path = get_tablespace_mapping(©buf[157]); if (symlink(mapped_tblspc_path, filename) != 0) @@ -2204,7 +2204,7 @@ main(int argc, char **argv) #ifdef HAVE_LIBZ compresslevel = Z_DEFAULT_COMPRESSION; #else - compresslevel = 1; /* will be rejected below */ + compresslevel = 1; /* will be rejected below */ #endif break; case 'Z': diff --git a/src/bin/pg_basebackup/pg_receivewal.c b/src/bin/pg_basebackup/pg_receivewal.c index 370d871660d..15caf32a764 100644 --- a/src/bin/pg_basebackup/pg_receivewal.c +++ b/src/bin/pg_basebackup/pg_receivewal.c @@ -35,7 +35,7 @@ static char *basedir = NULL; static int verbose = 0; static int compresslevel = 0; static int noloop = 0; -static int standby_message_timeout = 10 * 1000; /* 10 sec = default */ +static int standby_message_timeout = 10 * 1000; /* 10 sec = default */ static volatile bool time_to_abort = false; static bool do_create_slot = false; static bool slot_exists_ok = false; diff --git a/src/bin/pg_basebackup/pg_recvlogical.c b/src/bin/pg_basebackup/pg_recvlogical.c index 5f7412e9d55..fbe9fbb9a81 100644 --- a/src/bin/pg_basebackup/pg_recvlogical.c +++ b/src/bin/pg_basebackup/pg_recvlogical.c @@ -37,7 +37,7 @@ static char *outfile = NULL; static int verbose = 0; static int noloop = 0; -static int standby_message_timeout = 10 * 1000; /* 10 sec = default */ +static int standby_message_timeout = 10 * 1000; /* 10 sec = default */ static int fsync_interval = 10 * 1000; /* 10 sec = default */ static XLogRecPtr startpos = InvalidXLogRecPtr; static XLogRecPtr endpos = InvalidXLogRecPtr; @@ -142,13 +142,13 @@ sendFeedback(PGconn *conn, TimestampTz now, bool force, bool replyRequested) len += 1; fe_sendint64(output_written_lsn, &replybuf[len]); /* write */ len += 8; - fe_sendint64(output_fsync_lsn, &replybuf[len]); /* flush */ + fe_sendint64(output_fsync_lsn, &replybuf[len]); /* flush */ len += 8; fe_sendint64(InvalidXLogRecPtr, &replybuf[len]); /* apply */ len += 8; fe_sendint64(now, &replybuf[len]); /* sendTime */ len += 8; - replybuf[len] = replyRequested ? 1 : 0; /* replyRequested */ + replybuf[len] = replyRequested ? 1 : 0; /* replyRequested */ len += 1; startpos = output_written_lsn; diff --git a/src/bin/pg_basebackup/receivelog.c b/src/bin/pg_basebackup/receivelog.c index 52aa274bb89..0fe4df126d2 100644 --- a/src/bin/pg_basebackup/receivelog.c +++ b/src/bin/pg_basebackup/receivelog.c @@ -35,7 +35,7 @@ static char current_walfile_name[MAXPGPATH] = ""; static bool reportFlushPosition = false; static XLogRecPtr lastFlushPosition = InvalidXLogRecPtr; -static bool still_sending = true; /* feedback still needs to be sent? */ +static bool still_sending = true; /* feedback still needs to be sent? */ static PGresult *HandleCopyStream(PGconn *conn, StreamCtl *stream, XLogRecPtr *stoppos); @@ -330,18 +330,18 @@ sendFeedback(PGconn *conn, XLogRecPtr blockpos, TimestampTz now, bool replyReque replybuf[len] = 'r'; len += 1; - fe_sendint64(blockpos, &replybuf[len]); /* write */ + fe_sendint64(blockpos, &replybuf[len]); /* write */ len += 8; if (reportFlushPosition) - fe_sendint64(lastFlushPosition, &replybuf[len]); /* flush */ + fe_sendint64(lastFlushPosition, &replybuf[len]); /* flush */ else - fe_sendint64(InvalidXLogRecPtr, &replybuf[len]); /* flush */ + fe_sendint64(InvalidXLogRecPtr, &replybuf[len]); /* flush */ len += 8; fe_sendint64(InvalidXLogRecPtr, &replybuf[len]); /* apply */ len += 8; fe_sendint64(now, &replybuf[len]); /* sendTime */ len += 8; - replybuf[len] = replyRequested ? 1 : 0; /* replyRequested */ + replybuf[len] = replyRequested ? 1 : 0; /* replyRequested */ len += 1; if (PQputCopyData(conn, replybuf, len) <= 0 || PQflush(conn)) diff --git a/src/bin/pg_basebackup/receivelog.h b/src/bin/pg_basebackup/receivelog.h index 9a51d9a9c49..bb786ce289e 100644 --- a/src/bin/pg_basebackup/receivelog.h +++ b/src/bin/pg_basebackup/receivelog.h @@ -33,8 +33,7 @@ typedef struct StreamCtl TimeLineID timeline; /* Timeline to stream data from */ char *sysidentifier; /* Validate this system identifier and * timeline */ - int standby_message_timeout; /* Send status messages this - * often */ + int standby_message_timeout; /* Send status messages this often */ bool synchronous; /* Flush immediately WAL data on write */ bool mark_done; /* Mark segment as done in generated archive */ bool do_sync; /* Flush to disk to ensure consistent state of @@ -47,7 +46,7 @@ typedef struct StreamCtl WalWriteMethod *walmethod; /* How to write the WAL */ char *partial_suffix; /* Suffix appended to partially received files */ - char *replication_slot; /* Replication slot to use, or NULL */ + char *replication_slot; /* Replication slot to use, or NULL */ bool temp_slot; /* Create temporary replication slot */ } StreamCtl; @@ -57,4 +56,4 @@ extern bool CheckServerVersionForStreaming(PGconn *conn); extern bool ReceiveXlogStream(PGconn *conn, StreamCtl *stream); -#endif /* RECEIVELOG_H */ +#endif /* RECEIVELOG_H */ diff --git a/src/bin/pg_basebackup/streamutil.h b/src/bin/pg_basebackup/streamutil.h index 460dcb52675..6f6878679fc 100644 --- a/src/bin/pg_basebackup/streamutil.h +++ b/src/bin/pg_basebackup/streamutil.h @@ -48,4 +48,4 @@ extern bool feTimestampDifferenceExceeds(TimestampTz start_time, TimestampTz sto extern void fe_sendint64(int64 i, char *buf); extern int64 fe_recvint64(char *buf); -#endif /* STREAMUTIL_H */ +#endif /* STREAMUTIL_H */ diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c index 8387a0b0805..9e262dee8bf 100644 --- a/src/bin/pg_ctl/pg_ctl.c +++ b/src/bin/pg_ctl/pg_ctl.c @@ -83,7 +83,7 @@ static const char *progname; static char *log_file = NULL; static char *exec_path = NULL; static char *event_source = NULL; -static char *register_servicename = "PostgreSQL"; /* FIXME: + version ID? */ +static char *register_servicename = "PostgreSQL"; /* FIXME: + version ID? */ static char *register_username = NULL; static char *register_password = NULL; static char *argv0 = NULL; @@ -211,7 +211,7 @@ write_stderr(const char *fmt,...) */ if (pgwin32_is_service()) /* Running as a service */ { - char errbuf[2048]; /* Arbitrary size? */ + char errbuf[2048]; /* Arbitrary size? */ vsnprintf(errbuf, sizeof(errbuf), fmt, ap); @@ -500,7 +500,7 @@ start_postmaster(void) postmasterProcess = pi.hProcess; CloseHandle(pi.hThread); return pi.dwProcessId; /* Shell's PID, not postmaster's! */ -#endif /* WIN32 */ +#endif /* WIN32 */ } @@ -787,8 +787,7 @@ read_post_opts(void) */ if ((arg1 = strstr(optline, " \"")) != NULL) { - *arg1 = '\0'; /* terminate so we get only program - * name */ + *arg1 = '\0'; /* terminate so we get only program name */ post_opts = pg_strdup(arg1 + 1); /* point past whitespace */ } if (exec_path == NULL) @@ -1005,7 +1004,7 @@ do_stop(void) if ((pid = get_pgpid(false)) != 0) { print_msg("."); - pg_usleep(1000000); /* 1 sec */ + pg_usleep(1000000); /* 1 sec */ } else break; @@ -1095,7 +1094,7 @@ do_restart(void) if ((pid = get_pgpid(false)) != 0) { print_msg("."); - pg_usleep(1000000); /* 1 sec */ + pg_usleep(1000000); /* 1 sec */ } else break; @@ -1362,7 +1361,7 @@ IsWindowsXPOrGreater(void) osv.dwOSVersionInfoSize = sizeof(osv); /* Windows XP = Version 5.1 */ - return (!GetVersionEx(&osv) || /* could not get version */ + return (!GetVersionEx(&osv) || /* could not get version */ osv.dwMajorVersion > 5 || (osv.dwMajorVersion == 5 && osv.dwMinorVersion >= 1)); } @@ -1374,7 +1373,7 @@ IsWindows7OrGreater(void) osv.dwOSVersionInfoSize = sizeof(osv); /* Windows 7 = Version 6.0 */ - return (!GetVersionEx(&osv) || /* could not get version */ + return (!GetVersionEx(&osv) || /* could not get version */ osv.dwMajorVersion > 6 || (osv.dwMajorVersion == 6 && osv.dwMinorVersion >= 0)); } #endif @@ -1665,7 +1664,7 @@ pgwin32_ServiceMain(DWORD argc, LPTSTR *argv) break; } - case (WAIT_OBJECT_0 + 1): /* postmaster went down */ + case (WAIT_OBJECT_0 + 1): /* postmaster went down */ break; default: @@ -1917,7 +1916,7 @@ CreateRestrictedProcess(char *cmd, PROCESS_INFORMATION *processInfo, bool as_ser */ return r; } -#endif /* WIN32 */ +#endif /* WIN32 */ static void do_advice(void) diff --git a/src/bin/pg_dump/compress_io.c b/src/bin/pg_dump/compress_io.c index 631fa337e6d..025835a2e0d 100644 --- a/src/bin/pg_dump/compress_io.c +++ b/src/bin/pg_dump/compress_io.c @@ -388,7 +388,7 @@ ReadDataFromArchiveZlib(ArchiveHandle *AH, ReadFunc readF) free(out); free(zp); } -#endif /* HAVE_LIBZ */ +#endif /* HAVE_LIBZ */ /* diff --git a/src/bin/pg_dump/dumputils.c b/src/bin/pg_dump/dumputils.c index 79eac8c7cf6..04159bcfc6c 100644 --- a/src/bin/pg_dump/dumputils.c +++ b/src/bin/pg_dump/dumputils.c @@ -604,7 +604,7 @@ copyAclUserName(PQExpBuffer output, char *input) while (!(*input == '"' && *(input + 1) != '"')) { if (*input == '\0') - return input; /* really a syntax error... */ + return input; /* really a syntax error... */ /* * Quoting convention is to escape " as "". Keep this code in diff --git a/src/bin/pg_dump/dumputils.h b/src/bin/pg_dump/dumputils.h index d7eecdfb3cf..fe364dd8c45 100644 --- a/src/bin/pg_dump/dumputils.h +++ b/src/bin/pg_dump/dumputils.h @@ -56,4 +56,4 @@ extern void buildACLQueries(PQExpBuffer acl_subquery, PQExpBuffer racl_subquery, const char *acl_column, const char *acl_owner, const char *obj_kind, bool binary_upgrade); -#endif /* DUMPUTILS_H */ +#endif /* DUMPUTILS_H */ diff --git a/src/bin/pg_dump/parallel.c b/src/bin/pg_dump/parallel.c index feda575af85..4452436d0ed 100644 --- a/src/bin/pg_dump/parallel.c +++ b/src/bin/pg_dump/parallel.c @@ -91,7 +91,7 @@ struct ParallelSlot T_WorkerStatus workerStatus; /* see enum above */ /* These fields are valid if workerStatus == WRKR_WORKING: */ - ParallelCompletionPtr callback; /* function to call on completion */ + ParallelCompletionPtr callback; /* function to call on completion */ void *callback_data; /* passthrough data for it */ ArchiveHandle *AH; /* Archive data worker is using */ @@ -134,7 +134,7 @@ static int piperead(int s, char *buf, int len); #define piperead(a,b,c) read(a,b,c) #define pipewrite(a,b,c) write(a,b,c) -#endif /* WIN32 */ +#endif /* WIN32 */ /* * State info for archive_close_connection() shutdown callback. @@ -193,7 +193,7 @@ static DWORD tls_index; /* globally visible variables (needed by exit_nicely) */ bool parallel_init_done = false; DWORD mainThreadId; -#endif /* WIN32 */ +#endif /* WIN32 */ static const char *modulename = gettext_noop("parallel archiver"); @@ -335,7 +335,7 @@ getThreadLocalPQExpBuffer(void) return id_return; } -#endif /* WIN32 */ +#endif /* WIN32 */ /* * pg_dump and pg_restore call this to register the cleanup handler @@ -512,7 +512,7 @@ WaitForTerminatingWorkers(ParallelState *pstate) break; } } -#endif /* WIN32 */ +#endif /* WIN32 */ /* On all platforms, update workerStatus and te[] as well */ Assert(j < pstate->numWorkers); @@ -729,7 +729,7 @@ setup_cancel_handler(void) } } -#endif /* WIN32 */ +#endif /* WIN32 */ /* @@ -898,7 +898,7 @@ init_spawned_worker_win32(WorkerInfo *wi) _endthreadex(0); return 0; } -#endif /* WIN32 */ +#endif /* WIN32 */ /* * This function starts a parallel dump or restore by spawning off the worker @@ -1044,7 +1044,7 @@ ParallelBackupStart(ArchiveHandle *AH) closesocket(pipeMW[PIPE_READ]); /* close write end of Worker -> Master */ closesocket(pipeWM[PIPE_WRITE]); -#endif /* WIN32 */ +#endif /* WIN32 */ } /* @@ -1840,4 +1840,4 @@ piperead(int s, char *buf, int len) return ret; } -#endif /* WIN32 */ +#endif /* WIN32 */ diff --git a/src/bin/pg_dump/parallel.h b/src/bin/pg_dump/parallel.h index 27ae2eda73b..8d800bdf838 100644 --- a/src/bin/pg_dump/parallel.h +++ b/src/bin/pg_dump/parallel.h @@ -67,4 +67,4 @@ extern void ParallelBackupEnd(ArchiveHandle *AH, ParallelState *pstate); extern void set_archive_cancel_info(ArchiveHandle *AH, PGconn *conn); -#endif /* PG_DUMP_PARALLEL_H */ +#endif /* PG_DUMP_PARALLEL_H */ diff --git a/src/bin/pg_dump/pg_backup.h b/src/bin/pg_dump/pg_backup.h index 77da43c08a6..144068ac492 100644 --- a/src/bin/pg_dump/pg_backup.h +++ b/src/bin/pg_dump/pg_backup.h @@ -63,8 +63,8 @@ typedef struct _restoreOptions int createDB; /* Issue commands to create the database */ int noOwner; /* Don't try to match original object owner */ int noTablespace; /* Don't issue tablespace-related commands */ - int disable_triggers; /* disable triggers during data-only - * restore */ + int disable_triggers; /* disable triggers during data-only + * restore */ int use_setsessauth; /* Use SET SESSION AUTHORIZATION commands * instead of OWNER TO */ char *superuser; /* Username to use as superuser */ @@ -75,8 +75,8 @@ typedef struct _restoreOptions int column_inserts; int if_exists; int no_publications; /* Skip publication entries */ - int no_security_labels; /* Skip security label entries */ - int no_subscriptions; /* Skip subscription entries */ + int no_security_labels; /* Skip security label entries */ + int no_subscriptions; /* Skip subscription entries */ int strict_names; const char *filename; @@ -181,16 +181,15 @@ typedef struct Archive RestoreOptions *ropt; /* options, if restoring */ int verbose; - char *remoteVersionStr; /* server's version string */ + char *remoteVersionStr; /* server's version string */ int remoteVersion; /* same in numeric form */ bool isStandby; /* is server a standby node */ - int minRemoteVersion; /* allowable range */ + int minRemoteVersion; /* allowable range */ int maxRemoteVersion; int numWorkers; /* number of parallel processes */ - char *sync_snapshot_id; /* sync snapshot id for parallel - * operation */ + char *sync_snapshot_id; /* sync snapshot id for parallel operation */ /* info needed for string escaping */ int encoding; /* libpq code for client_encoding */ @@ -299,4 +298,4 @@ extern int archprintf(Archive *AH, const char *fmt,...) pg_attribute_printf(2, 3 #define appendStringLiteralAH(buf,str,AH) \ appendStringLiteral(buf, str, (AH)->encoding, (AH)->std_strings) -#endif /* PG_BACKUP_H */ +#endif /* PG_BACKUP_H */ diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c index 0161fc4231a..35ff958ebac 100644 --- a/src/bin/pg_dump/pg_backup_archiver.c +++ b/src/bin/pg_dump/pg_backup_archiver.c @@ -744,7 +744,7 @@ restore_toc_entry(ArchiveHandle *AH, TocEntry *te, bool is_parallel) defnDumped = false; - if ((reqs & REQ_SCHEMA) != 0) /* We want the schema */ + if ((reqs & REQ_SCHEMA) != 0) /* We want the schema */ { /* Show namespace if available */ if (te->namespace) @@ -2179,7 +2179,7 @@ _discoverArchiveFormat(ArchiveHandle *AH) AH->lookahead[AH->lookaheadLen++] = vmin; /* Check header version; varies from V1.0 */ - if (vmaj > 1 || (vmaj == 1 && vmin > 0)) /* Version > 1.0 */ + if (vmaj > 1 || (vmaj == 1 && vmin > 0)) /* Version > 1.0 */ { if ((byteread = fgetc(fh)) == EOF) READ_ERROR_EXIT(fh); @@ -3600,7 +3600,7 @@ WriteHead(ArchiveHandle *AH) { struct tm crtm; - (*AH->WriteBufPtr) (AH, "PGDMP", 5); /* Magic code */ + (*AH->WriteBufPtr) (AH, "PGDMP", 5); /* Magic code */ (*AH->WriteBytePtr) (AH, ARCHIVE_MAJOR(AH->version)); (*AH->WriteBytePtr) (AH, ARCHIVE_MINOR(AH->version)); (*AH->WriteBytePtr) (AH, ARCHIVE_REV(AH->version)); @@ -3648,7 +3648,7 @@ ReadHead(ArchiveHandle *AH) vmaj = (*AH->ReadBytePtr) (AH); vmin = (*AH->ReadBytePtr) (AH); - if (vmaj > 1 || (vmaj == 1 && vmin > 0)) /* Version > 1.0 */ + if (vmaj > 1 || (vmaj == 1 && vmin > 0)) /* Version > 1.0 */ vrev = (*AH->ReadBytePtr) (AH); else vrev = 0; diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h index 3ee75f0b6e7..61238591329 100644 --- a/src/bin/pg_dump/pg_backup_archiver.h +++ b/src/bin/pg_dump/pg_backup_archiver.h @@ -75,23 +75,23 @@ typedef z_stream *z_streamp; /* Historical version numbers (checked in code) */ #define K_VERS_1_0 MAKE_ARCHIVE_VERSION(1, 0, 0) -#define K_VERS_1_2 MAKE_ARCHIVE_VERSION(1, 2, 0) /* Allow No ZLIB */ -#define K_VERS_1_3 MAKE_ARCHIVE_VERSION(1, 3, 0) /* BLOBs */ -#define K_VERS_1_4 MAKE_ARCHIVE_VERSION(1, 4, 0) /* Date & name in header */ -#define K_VERS_1_5 MAKE_ARCHIVE_VERSION(1, 5, 0) /* Handle dependencies */ -#define K_VERS_1_6 MAKE_ARCHIVE_VERSION(1, 6, 0) /* Schema field in TOCs */ -#define K_VERS_1_7 MAKE_ARCHIVE_VERSION(1, 7, 0) /* File Offset size in - * header */ -#define K_VERS_1_8 MAKE_ARCHIVE_VERSION(1, 8, 0) /* change interpretation - * of ID numbers and - * dependencies */ -#define K_VERS_1_9 MAKE_ARCHIVE_VERSION(1, 9, 0) /* add default_with_oids - * tracking */ -#define K_VERS_1_10 MAKE_ARCHIVE_VERSION(1, 10, 0) /* add tablespace */ -#define K_VERS_1_11 MAKE_ARCHIVE_VERSION(1, 11, 0) /* add toc section - * indicator */ -#define K_VERS_1_12 MAKE_ARCHIVE_VERSION(1, 12, 0) /* add separate BLOB - * entries */ +#define K_VERS_1_2 MAKE_ARCHIVE_VERSION(1, 2, 0) /* Allow No ZLIB */ +#define K_VERS_1_3 MAKE_ARCHIVE_VERSION(1, 3, 0) /* BLOBs */ +#define K_VERS_1_4 MAKE_ARCHIVE_VERSION(1, 4, 0) /* Date & name in header */ +#define K_VERS_1_5 MAKE_ARCHIVE_VERSION(1, 5, 0) /* Handle dependencies */ +#define K_VERS_1_6 MAKE_ARCHIVE_VERSION(1, 6, 0) /* Schema field in TOCs */ +#define K_VERS_1_7 MAKE_ARCHIVE_VERSION(1, 7, 0) /* File Offset size in + * header */ +#define K_VERS_1_8 MAKE_ARCHIVE_VERSION(1, 8, 0) /* change interpretation + * of ID numbers and + * dependencies */ +#define K_VERS_1_9 MAKE_ARCHIVE_VERSION(1, 9, 0) /* add default_with_oids + * tracking */ +#define K_VERS_1_10 MAKE_ARCHIVE_VERSION(1, 10, 0) /* add tablespace */ +#define K_VERS_1_11 MAKE_ARCHIVE_VERSION(1, 11, 0) /* add toc section + * indicator */ +#define K_VERS_1_12 MAKE_ARCHIVE_VERSION(1, 12, 0) /* add separate BLOB + * entries */ /* Current archive version number (the format we can output) */ #define K_VERS_MAJOR 1 @@ -217,8 +217,8 @@ struct _archiveHandle char *archiveRemoteVersion; /* When reading an archive, the * version of the dumped DB */ - char *archiveDumpVersion; /* When reading an archive, the - * version of the dumper */ + char *archiveDumpVersion; /* When reading an archive, the version of + * the dumper */ int debugLevel; /* Used for logging (currently only by * --verbose) */ @@ -242,25 +242,24 @@ struct _archiveHandle size_t lookaheadLen; /* Length of data in lookahead */ pgoff_t lookaheadPos; /* Current read position in lookahead buffer */ - ArchiveEntryPtrType ArchiveEntryPtr; /* Called for each metadata - * object */ - StartDataPtrType StartDataPtr; /* Called when table data is about to - * be dumped */ - WriteDataPtrType WriteDataPtr; /* Called to send some table data to - * the archive */ + ArchiveEntryPtrType ArchiveEntryPtr; /* Called for each metadata object */ + StartDataPtrType StartDataPtr; /* Called when table data is about to be + * dumped */ + WriteDataPtrType WriteDataPtr; /* Called to send some table data to the + * archive */ EndDataPtrType EndDataPtr; /* Called when table data dump is finished */ - WriteBytePtrType WriteBytePtr; /* Write a byte to output */ + WriteBytePtrType WriteBytePtr; /* Write a byte to output */ ReadBytePtrType ReadBytePtr; /* Read a byte from an archive */ WriteBufPtrType WriteBufPtr; /* Write a buffer of output to the archive */ ReadBufPtrType ReadBufPtr; /* Read a buffer of input from the archive */ ClosePtrType ClosePtr; /* Close the archive */ ReopenPtrType ReopenPtr; /* Reopen the archive */ - WriteExtraTocPtrType WriteExtraTocPtr; /* Write extra TOC entry data - * associated with the current - * archive format */ - ReadExtraTocPtrType ReadExtraTocPtr; /* Read extra info associated - * with archive format */ - PrintExtraTocPtrType PrintExtraTocPtr; /* Extra TOC info for format */ + WriteExtraTocPtrType WriteExtraTocPtr; /* Write extra TOC entry data + * associated with the current + * archive format */ + ReadExtraTocPtrType ReadExtraTocPtr; /* Read extra info associated with + * archive format */ + PrintExtraTocPtrType PrintExtraTocPtr; /* Extra TOC info for format */ PrintTocDataPtrType PrintTocDataPtr; StartBlobsPtrType StartBlobsPtr; @@ -275,7 +274,7 @@ struct _archiveHandle ClonePtrType ClonePtr; /* Clone format-specific fields */ DeClonePtrType DeClonePtr; /* Clean up cloned fields */ - CustomOutPtrType CustomOutPtr; /* Alternative script output routine */ + CustomOutPtrType CustomOutPtr; /* Alternative script output routine */ /* Stuff for direct DB connection */ char *archdbname; /* DB name *read* from archive */ diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index a2b320f3710..22ff8413d37 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -1193,7 +1193,7 @@ _tarPositionTo(ArchiveHandle *AH, const char *filename) th->targetFile, filename); /* Header doesn't match, so read to next header */ - len = ((th->fileLen + 511) & ~511); /* Padded length */ + len = ((th->fileLen + 511) & ~511); /* Padded length */ blks = len >> 9; /* # of 512 byte blocks */ for (i = 0; i < blks; i++) diff --git a/src/bin/pg_dump/pg_backup_utils.h b/src/bin/pg_dump/pg_backup_utils.h index 04b53f496e7..14661a11603 100644 --- a/src/bin/pg_dump/pg_backup_utils.h +++ b/src/bin/pg_dump/pg_backup_utils.h @@ -35,4 +35,4 @@ extern void exit_nicely(int code) pg_attribute_noreturn(); extern void exit_horribly(const char *modulename, const char *fmt,...) pg_attribute_printf(2, 3) pg_attribute_noreturn(); -#endif /* PG_BACKUP_UTILS_H */ +#endif /* PG_BACKUP_UTILS_H */ diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 1bec66ebbb6..e03fdebecb2 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -2103,8 +2103,8 @@ refreshMatViewData(Archive *fout, TableDataInfo *tdinfo) if (tdinfo->dobj.dump & DUMP_COMPONENT_DATA) ArchiveEntry(fout, - tdinfo->dobj.catId, /* catalog ID */ - tdinfo->dobj.dumpId, /* dump ID */ + tdinfo->dobj.catId, /* catalog ID */ + tdinfo->dobj.dumpId, /* dump ID */ tbinfo->dobj.name, /* Name */ tbinfo->dobj.namespace->dobj.name, /* Namespace */ NULL, /* Tablespace */ @@ -2116,7 +2116,7 @@ refreshMatViewData(Archive *fout, TableDataInfo *tdinfo) "", /* Del */ NULL, /* Copy */ tdinfo->dobj.dependencies, /* Deps */ - tdinfo->dobj.nDeps, /* # Deps */ + tdinfo->dobj.nDeps, /* # Deps */ NULL, /* Dumper */ NULL); /* Dumper Arg */ @@ -2610,7 +2610,7 @@ dumpDatabase(Archive *fout) dba, /* Owner */ false, /* with oids */ "DATABASE", /* Desc */ - SECTION_PRE_DATA, /* Section */ + SECTION_PRE_DATA, /* Section */ creaQry->data, /* Create */ delQry->data, /* Del */ NULL, /* Copy */ @@ -5211,8 +5211,8 @@ getAggregates(Archive *fout, int *numAggs) if (strlen(agginfo[i].aggfn.rolname) == 0) write_msg(NULL, "WARNING: owner of aggregate function \"%s\" appears to be invalid\n", agginfo[i].aggfn.dobj.name); - agginfo[i].aggfn.lang = InvalidOid; /* not currently interesting */ - agginfo[i].aggfn.prorettype = InvalidOid; /* not saved */ + agginfo[i].aggfn.lang = InvalidOid; /* not currently interesting */ + agginfo[i].aggfn.prorettype = InvalidOid; /* not saved */ agginfo[i].aggfn.proacl = pg_strdup(PQgetvalue(res, i, i_aggacl)); agginfo[i].aggfn.rproacl = pg_strdup(PQgetvalue(res, i, i_raggacl)); agginfo[i].aggfn.initproacl = pg_strdup(PQgetvalue(res, i, i_initaggacl)); @@ -6210,7 +6210,7 @@ getTables(Archive *fout, int *numTables) tblinfo[i].interesting = tblinfo[i].dobj.dump ? true : false; tblinfo[i].dummy_view = false; /* might get set during sort */ - tblinfo[i].postponed_def = false; /* might get set during sort */ + tblinfo[i].postponed_def = false; /* might get set during sort */ tblinfo[i].is_identity_sequence = (i_is_identity_sequence >= 0 && strcmp(PQgetvalue(res, i, i_is_identity_sequence), "t") == 0); @@ -11212,7 +11212,7 @@ dumpFunc(Archive *fout, FuncInfo *finfo) PQExpBuffer asPart; PGresult *res; char *funcsig; /* identity signature */ - char *funcfullsig = NULL; /* full signature */ + char *funcfullsig = NULL; /* full signature */ char *funcsig_tag; char *proretset; char *prosrc; @@ -13300,7 +13300,7 @@ dumpAgg(Archive *fout, AggInfo *agginfo) PQExpBuffer labelq; PQExpBuffer details; char *aggsig; /* identity signature */ - char *aggfullsig = NULL; /* full signature */ + char *aggfullsig = NULL; /* full signature */ char *aggsig_tag; PGresult *res; int i_aggtransfn; diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h index 4afffc0690d..e7593e6da7f 100644 --- a/src/bin/pg_dump/pg_dump.h +++ b/src/bin/pg_dump/pg_dump.h @@ -133,7 +133,7 @@ typedef struct _dumpableObject char *name; /* object name (should never be NULL) */ struct _namespaceInfo *namespace; /* containing namespace, or NULL */ DumpComponents dump; /* bitmask of components to dump */ - DumpComponents dump_contains; /* as above, but for contained objects */ + DumpComponents dump_contains; /* as above, but for contained objects */ bool ext_member; /* true if object is member of extension */ DumpId *dependencies; /* dumpIds of objects this one depends on */ int nDeps; /* number of valid dependencies */ @@ -271,7 +271,7 @@ typedef struct _tableInfo char *reltablespace; /* relation tablespace */ char *reloptions; /* options specified by WITH (...) */ char *checkoption; /* WITH CHECK OPTION, if any */ - char *toast_reloptions; /* WITH options for the TOAST table */ + char *toast_reloptions; /* WITH options for the TOAST table */ bool hasindex; /* does it have any indexes? */ bool hasrules; /* does it have any rules? */ bool hastriggers; /* does it have any triggers? */ @@ -317,7 +317,7 @@ typedef struct _tableInfo char **attfdwoptions; /* per-attribute fdw options */ bool *notnull; /* NOT NULL constraints on attributes */ bool *inhNotNull; /* true if NOT NULL is inherited */ - struct _attrDefInfo **attrdefs; /* DEFAULT expressions */ + struct _attrDefInfo **attrdefs; /* DEFAULT expressions */ struct _constraintInfo *checkexprs; /* CHECK constraints */ char *partkeydef; /* partition key definition */ char *partbound; /* partition bound definition */ @@ -328,9 +328,9 @@ typedef struct _tableInfo */ int numParents; /* number of (immediate) parent tables */ struct _tableInfo **parents; /* TableInfos of immediate parents */ - struct _tableDataInfo *dataObj; /* TableDataInfo, if dumping its data */ + struct _tableDataInfo *dataObj; /* TableDataInfo, if dumping its data */ int numTriggers; /* number of triggers for table */ - struct _triggerInfo *triggers; /* array of TriggerInfo structs */ + struct _triggerInfo *triggers; /* array of TriggerInfo structs */ } TableInfo; typedef struct _attrDefInfo @@ -712,4 +712,4 @@ extern void getPublicationTables(Archive *fout, TableInfo tblinfo[], int numTables); extern void getSubscriptions(Archive *fout); -#endif /* PG_DUMP_H */ +#endif /* PG_DUMP_H */ diff --git a/src/bin/pg_dump/pg_dump_sort.c b/src/bin/pg_dump/pg_dump_sort.c index d29723c171c..5044a767873 100644 --- a/src/bin/pg_dump/pg_dump_sort.c +++ b/src/bin/pg_dump/pg_dump_sort.c @@ -360,7 +360,7 @@ sortDumpableObjects(DumpableObject **objs, int numObjs, static bool TopoSort(DumpableObject **objs, int numObjs, - DumpableObject **ordering, /* output argument */ + DumpableObject **ordering, /* output argument */ int *nOrdering) /* output argument */ { DumpId maxDumpId = getMaxDumpId(); diff --git a/src/bin/pg_resetwal/pg_resetwal.c b/src/bin/pg_resetwal/pg_resetwal.c index 7f010675815..27c5309f63d 100644 --- a/src/bin/pg_resetwal/pg_resetwal.c +++ b/src/bin/pg_resetwal/pg_resetwal.c @@ -57,7 +57,7 @@ #include "pg_getopt.h" -static ControlFileData ControlFile; /* pg_control values */ +static ControlFileData ControlFile; /* pg_control values */ static XLogSegNo newXlogSegNo; /* new XLOG segment # */ static bool guessed = false; /* T if we had to guess at any values */ static const char *progname; @@ -834,7 +834,7 @@ static void RewriteControlFile(void) { int fd; - char buffer[PG_CONTROL_SIZE]; /* need not be aligned */ + char buffer[PG_CONTROL_SIZE]; /* need not be aligned */ /* * Adjust fields as needed to force an empty XLOG starting at diff --git a/src/bin/pg_rewind/copy_fetch.c b/src/bin/pg_rewind/copy_fetch.c index 347d4e4d4ca..f7ac5b30b5e 100644 --- a/src/bin/pg_rewind/copy_fetch.c +++ b/src/bin/pg_rewind/copy_fetch.c @@ -137,7 +137,7 @@ recurse_dir(const char *datadir, const char *parentpath, #else pg_fatal("\"%s\" is a symbolic link, but symbolic links are not supported on this platform\n", fullpath); -#endif /* HAVE_READLINK */ +#endif /* HAVE_READLINK */ } } diff --git a/src/bin/pg_rewind/datapagemap.h b/src/bin/pg_rewind/datapagemap.h index 15ebd68b273..db991c16dfc 100644 --- a/src/bin/pg_rewind/datapagemap.h +++ b/src/bin/pg_rewind/datapagemap.h @@ -27,4 +27,4 @@ extern datapagemap_iterator_t *datapagemap_iterate(datapagemap_t *map); extern bool datapagemap_next(datapagemap_iterator_t *iter, BlockNumber *blkno); extern void datapagemap_print(datapagemap_t *map); -#endif /* DATAPAGEMAP_H */ +#endif /* DATAPAGEMAP_H */ diff --git a/src/bin/pg_rewind/fetch.h b/src/bin/pg_rewind/fetch.h index ccb2dab3e9a..1e08f76b3e9 100644 --- a/src/bin/pg_rewind/fetch.h +++ b/src/bin/pg_rewind/fetch.h @@ -41,4 +41,4 @@ extern void copy_executeFileMap(filemap_t *map); typedef void (*process_file_callback_t) (const char *path, file_type_t type, size_t size, const char *link_target); extern void traverse_datadir(const char *datadir, process_file_callback_t callback); -#endif /* FETCH_H */ +#endif /* FETCH_H */ diff --git a/src/bin/pg_rewind/file_ops.h b/src/bin/pg_rewind/file_ops.h index d247f3dc656..f9aea52d6d9 100644 --- a/src/bin/pg_rewind/file_ops.h +++ b/src/bin/pg_rewind/file_ops.h @@ -21,4 +21,4 @@ extern void remove_target(file_entry_t *t); extern char *slurpFile(const char *datadir, const char *path, size_t *filesize); -#endif /* FILE_OPS_H */ +#endif /* FILE_OPS_H */ diff --git a/src/bin/pg_rewind/filemap.h b/src/bin/pg_rewind/filemap.h index 3431047bf7d..6c97fa74d1c 100644 --- a/src/bin/pg_rewind/filemap.h +++ b/src/bin/pg_rewind/filemap.h @@ -102,4 +102,4 @@ extern void process_block_change(ForkNumber forknum, RelFileNode rnode, BlockNumber blkno); extern void filemap_finalize(void); -#endif /* FILEMAP_H */ +#endif /* FILEMAP_H */ diff --git a/src/bin/pg_rewind/logging.h b/src/bin/pg_rewind/logging.h index c2f46891047..c6651940500 100644 --- a/src/bin/pg_rewind/logging.h +++ b/src/bin/pg_rewind/logging.h @@ -32,4 +32,4 @@ extern void pg_fatal(const char *fmt,...) pg_attribute_printf(1, 2) pg_attribute extern void progress_report(bool force); -#endif /* PG_REWIND_LOGGING_H */ +#endif /* PG_REWIND_LOGGING_H */ diff --git a/src/bin/pg_rewind/pg_rewind.c b/src/bin/pg_rewind/pg_rewind.c index 622dc6d1351..5526ff96c73 100644 --- a/src/bin/pg_rewind/pg_rewind.c +++ b/src/bin/pg_rewind/pg_rewind.c @@ -596,7 +596,7 @@ createBackupLabel(XLogRecPtr startpoint, TimeLineID starttli, XLogRecPtr checkpo pg_fatal("backup label buffer too small\n"); /* shouldn't happen */ /* TODO: move old file out of the way, if any. */ - open_target_file("backup_label", true); /* BACKUP_LABEL_FILE */ + open_target_file("backup_label", true); /* BACKUP_LABEL_FILE */ write_target_range(buf, 0, len); close_target_file(); } diff --git a/src/bin/pg_rewind/pg_rewind.h b/src/bin/pg_rewind/pg_rewind.h index 524478a72bb..31353dd3548 100644 --- a/src/bin/pg_rewind/pg_rewind.h +++ b/src/bin/pg_rewind/pg_rewind.h @@ -43,4 +43,4 @@ extern XLogRecPtr readOneRecord(const char *datadir, XLogRecPtr ptr, extern TimeLineHistoryEntry *rewind_parseTimeLineHistory(char *buffer, TimeLineID targetTLI, int *nentries); -#endif /* PG_REWIND_H */ +#endif /* PG_REWIND_H */ diff --git a/src/bin/pg_upgrade/file.c b/src/bin/pg_upgrade/file.c index 50897e7b7a2..eb925d1e0fc 100644 --- a/src/bin/pg_upgrade/file.c +++ b/src/bin/pg_upgrade/file.c @@ -89,7 +89,7 @@ copyFile(const char *src, const char *dst, schemaName, relName, src, dst, strerror(errno)); } -#endif /* WIN32 */ +#endif /* WIN32 */ } diff --git a/src/bin/pg_upgrade/pg_upgrade.h b/src/bin/pg_upgrade/pg_upgrade.h index e3a577a7823..c0beb5f4cb9 100644 --- a/src/bin/pg_upgrade/pg_upgrade.h +++ b/src/bin/pg_upgrade/pg_upgrade.h @@ -183,8 +183,8 @@ typedef struct { Oid db_oid; /* oid of the database */ char *db_name; /* database name */ - char db_tablespace[MAXPGPATH]; /* database default tablespace - * path */ + char db_tablespace[MAXPGPATH]; /* database default tablespace + * path */ char *db_collate; char *db_ctype; int db_encoding; @@ -272,7 +272,7 @@ typedef struct uint32 major_version; /* PG_VERSION of cluster */ char major_version_str[64]; /* string PG_VERSION of cluster */ uint32 bin_version; /* version returned from pg_ctl */ - const char *tablespace_suffix; /* directory specification */ + const char *tablespace_suffix; /* directory specification */ } ClusterInfo; diff --git a/src/bin/pg_waldump/pg_waldump.c b/src/bin/pg_waldump/pg_waldump.c index 2578d4b6920..f024a17f29a 100644 --- a/src/bin/pg_waldump/pg_waldump.c +++ b/src/bin/pg_waldump/pg_waldump.c @@ -132,7 +132,7 @@ split_path(const char *path, char **dir, char **fname) if (sep != NULL) { *dir = pg_strdup(path); - (*dir)[(sep - path) + 1] = '\0'; /* no strndup */ + (*dir)[(sep - path) + 1] = '\0'; /* no strndup */ *fname = pg_strdup(sep + 1); } /* local directory */ diff --git a/src/bin/pg_waldump/rmgrdesc.h b/src/bin/pg_waldump/rmgrdesc.h index 2fa60d90ad8..d5f6923e5ce 100644 --- a/src/bin/pg_waldump/rmgrdesc.h +++ b/src/bin/pg_waldump/rmgrdesc.h @@ -19,4 +19,4 @@ typedef struct RmgrDescData extern const RmgrDescData RmgrDescTable[]; -#endif /* RMGRDESC_H */ +#endif /* RMGRDESC_H */ diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index e420b37e39d..3bd33f2d520 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -29,7 +29,7 @@ #ifdef WIN32 #define FD_SETSIZE 1024 /* set before winsock2.h is included */ -#endif /* ! WIN32 */ +#endif /* ! WIN32 */ #include "postgres_fe.h" @@ -93,7 +93,7 @@ static int pthread_join(pthread_t th, void **thread_return); #define LOG_STEP_SECONDS 5 /* seconds between log messages */ #define DEFAULT_NXACTS 10 /* default nxacts */ -#define MIN_GAUSSIAN_PARAM 2.0 /* minimum parameter for gauss */ +#define MIN_GAUSSIAN_PARAM 2.0 /* minimum parameter for gauss */ int nxacts = 0; /* number of transactions per client */ int duration = 0; /* duration in seconds */ @@ -342,8 +342,8 @@ typedef struct pthread_t thread; /* thread handle */ CState *state; /* array of CState */ int nstate; /* length of state[] */ - unsigned short random_state[3]; /* separate randomness for each thread */ - int64 throttle_trigger; /* previous/next throttling (us) */ + unsigned short random_state[3]; /* separate randomness for each thread */ + int64 throttle_trigger; /* previous/next throttling (us) */ FILE *logfile; /* where to log, or NULL */ /* per thread collected stats */ @@ -605,7 +605,7 @@ strtoint64(const char *str) { int64 tmp = result * 10 + (*ptr++ - '0'); - if ((tmp / 10) != result) /* overflow? */ + if ((tmp / 10) != result) /* overflow? */ fprintf(stderr, "value \"%s\" is out of range for type bigint\n", str); result = tmp; } @@ -2235,7 +2235,7 @@ doCustom(TState *thread, CState *st, StatsData *agg) st->state = CSTATE_FINISHED; break; } - else if (!ret) /* on error */ + else if (!ret) /* on error */ { commandFailed(st, "execution of meta-command 'setshell' failed"); st->state = CSTATE_ABORTED; @@ -2255,7 +2255,7 @@ doCustom(TState *thread, CState *st, StatsData *agg) st->state = CSTATE_FINISHED; break; } - else if (!ret) /* on error */ + else if (!ret) /* on error */ { commandFailed(st, "execution of meta-command 'shell' failed"); st->state = CSTATE_ABORTED; @@ -3029,7 +3029,7 @@ process_backslash_command(PsqlScanState sstate, const char *source) Command *my_command; PQExpBufferData word_buf; int word_offset; - int offsets[MAX_ARGS]; /* offsets of argument words */ + int offsets[MAX_ARGS]; /* offsets of argument words */ int start_offset, end_offset; int lineno; @@ -3649,8 +3649,8 @@ main(int argc, char **argv) }; int c; - int is_init_mode = 0; /* initialize mode? */ - int is_no_vacuum = 0; /* no vacuum at all before testing? */ + int is_init_mode = 0; /* initialize mode? */ + int is_no_vacuum = 0; /* no vacuum at all before testing? */ int do_vacuum_accounts = 0; /* do vacuum accounts before testing? */ int optindex; bool scale_given = false; @@ -3749,7 +3749,7 @@ main(int argc, char **argv) if (getrlimit(RLIMIT_NOFILE, &rlim) == -1) #else /* but BSD doesn't ... */ if (getrlimit(RLIMIT_OFILE, &rlim) == -1) -#endif /* RLIMIT_NOFILE */ +#endif /* RLIMIT_NOFILE */ { fprintf(stderr, "getrlimit failed: %s\n", strerror(errno)); exit(1); @@ -3761,7 +3761,7 @@ main(int argc, char **argv) fprintf(stderr, "Reduce number of clients, or use limit/ulimit to increase the system limit.\n"); exit(1); } -#endif /* HAVE_GETRLIMIT */ +#endif /* HAVE_GETRLIMIT */ break; case 'j': /* jobs */ benchmarking_option_set = true; @@ -3778,7 +3778,7 @@ main(int argc, char **argv) fprintf(stderr, "threads are not supported on this platform; use -j1\n"); exit(1); } -#endif /* !ENABLE_THREAD_SAFETY */ +#endif /* !ENABLE_THREAD_SAFETY */ break; case 'C': benchmarking_option_set = true; @@ -4315,7 +4315,7 @@ main(int argc, char **argv) end_time = INSTR_TIME_GET_MICROSEC(threads[0].start_time) + (int64) 1000000 * duration; threads[0].thread = INVALID_THREAD; -#endif /* ENABLE_THREAD_SAFETY */ +#endif /* ENABLE_THREAD_SAFETY */ /* wait for threads and accumulate results */ initStats(&stats, 0); @@ -4333,7 +4333,7 @@ main(int argc, char **argv) pthread_join(thread->thread, NULL); #else (void) threadRun(thread); -#endif /* ENABLE_THREAD_SAFETY */ +#endif /* ENABLE_THREAD_SAFETY */ /* aggregate thread level stats */ mergeSimpleStats(&stats.latency, &thread->stats.latency); @@ -4370,7 +4370,7 @@ threadRun(void *arg) instr_time start, end; int nstate = thread->nstate; - int remains = nstate; /* number of remaining clients */ + int remains = nstate; /* number of remaining clients */ int i; /* for reporting progress: */ @@ -4441,7 +4441,7 @@ threadRun(void *arg) fd_set input_mask; int maxsock; /* max socket number to be waited for */ int64 min_usec; - int64 now_usec = 0; /* set this only if needed */ + int64 now_usec = 0; /* set this only if needed */ /* identify which client sockets should be checked for input */ FD_ZERO(&input_mask); @@ -4825,4 +4825,4 @@ pthread_join(pthread_t th, void **thread_return) return 0; } -#endif /* WIN32 */ +#endif /* WIN32 */ diff --git a/src/bin/pgbench/pgbench.h b/src/bin/pgbench/pgbench.h index 38b3af5ab19..abc13e94634 100644 --- a/src/bin/pgbench/pgbench.h +++ b/src/bin/pgbench/pgbench.h @@ -137,4 +137,4 @@ extern void syntax_error(const char *source, int lineno, const char *line, extern int64 strtoint64(const char *str); -#endif /* PGBENCH_H */ +#endif /* PGBENCH_H */ diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index b3263a9570a..7faf5bc582d 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -563,7 +563,7 @@ exec_command_cd(PsqlScanState scan_state, bool active_branch, const char *cmd) * directory, so if someone wants to code this here instead... */ dir = "/"; -#endif /* WIN32 */ +#endif /* WIN32 */ } if (chdir(dir) == -1) diff --git a/src/bin/psql/command.h b/src/bin/psql/command.h index e8ea8473e84..7aedd0d6252 100644 --- a/src/bin/psql/command.h +++ b/src/bin/psql/command.h @@ -43,4 +43,4 @@ extern void SyncVariables(void); extern void UnsyncVariables(void); -#endif /* COMMAND_H */ +#endif /* COMMAND_H */ diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c index a2f1259c1e2..044cdb82a7a 100644 --- a/src/bin/psql/common.c +++ b/src/bin/psql/common.c @@ -377,7 +377,7 @@ setup_cancel_handler(void) SetConsoleCtrlHandler(consoleHandler, TRUE); } -#endif /* WIN32 */ +#endif /* WIN32 */ /* ConnectionUp diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h index 1ceb8ae386c..f34868b54e4 100644 --- a/src/bin/psql/common.h +++ b/src/bin/psql/common.h @@ -46,4 +46,4 @@ extern void expand_tilde(char **filename); extern bool recognized_connection_string(const char *connstr); -#endif /* COMMON_H */ +#endif /* COMMON_H */ diff --git a/src/bin/psql/conditional.h b/src/bin/psql/conditional.h index 00fbe90ed05..09576277425 100644 --- a/src/bin/psql/conditional.h +++ b/src/bin/psql/conditional.h @@ -80,4 +80,4 @@ extern void conditional_stack_set_paren_depth(ConditionalStack cstack, int depth extern int conditional_stack_get_paren_depth(ConditionalStack cstack); -#endif /* CONDITIONAL_H */ +#endif /* CONDITIONAL_H */ diff --git a/src/bin/psql/copy.c b/src/bin/psql/copy.c index 12a50d215c0..cd2e656911f 100644 --- a/src/bin/psql/copy.c +++ b/src/bin/psql/copy.c @@ -102,7 +102,7 @@ parse_slash_copy(const char *args) result = pg_malloc0(sizeof(struct copy_options)); - result->before_tofrom = pg_strdup(""); /* initialize for appending */ + result->before_tofrom = pg_strdup(""); /* initialize for appending */ token = strtokx(args, whitespace, ".,()", "\"", 0, false, false, pset.encoding); diff --git a/src/bin/psql/crosstabview.h b/src/bin/psql/crosstabview.h index 97c72a51397..ad63ddef509 100644 --- a/src/bin/psql/crosstabview.h +++ b/src/bin/psql/crosstabview.h @@ -24,4 +24,4 @@ /* prototypes */ extern bool PrintResultsInCrosstab(const PGresult *res); -#endif /* CROSSTABVIEW_H */ +#endif /* CROSSTABVIEW_H */ diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index 83c133534cf..17bfedb4338 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -3391,7 +3391,7 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys if (showSeq) appendPQExpBufferStr(&buf, CppAsString2(RELKIND_SEQUENCE) ","); if (showSystem || pattern) - appendPQExpBufferStr(&buf, "'s',"); /* was RELKIND_SPECIAL */ + appendPQExpBufferStr(&buf, "'s',"); /* was RELKIND_SPECIAL */ if (showForeign) appendPQExpBufferStr(&buf, CppAsString2(RELKIND_FOREIGN_TABLE) ","); diff --git a/src/bin/psql/describe.h b/src/bin/psql/describe.h index b05d6bb9762..14a5667f3e2 100644 --- a/src/bin/psql/describe.h +++ b/src/bin/psql/describe.h @@ -111,4 +111,4 @@ bool describePublications(const char *pattern); /* \dRs */ bool describeSubscriptions(const char *pattern, bool verbose); -#endif /* DESCRIBE_H */ +#endif /* DESCRIBE_H */ diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c index f097b06594a..f6acf871971 100644 --- a/src/bin/psql/help.c +++ b/src/bin/psql/help.c @@ -515,7 +515,7 @@ helpSQL(const char *topic, unsigned short int pager) while (topic[j] != ' ' && j++ <= len) wordlen++; } - if (wordlen >= len) /* Don't try again if the same word */ + if (wordlen >= len) /* Don't try again if the same word */ { if (!output) output = PageOutput(nl_count, pager ? &(pset.popt.topt) : NULL); diff --git a/src/bin/psql/input.c b/src/bin/psql/input.c index b8c9a00b099..62f5f773839 100644 --- a/src/bin/psql/input.c +++ b/src/bin/psql/input.c @@ -333,7 +333,7 @@ decode_history(void) } END_ITERATE_HISTORY(); } -#endif /* USE_READLINE */ +#endif /* USE_READLINE */ /* diff --git a/src/bin/psql/input.h b/src/bin/psql/input.h index f40561459d7..35886dae22a 100644 --- a/src/bin/psql/input.h +++ b/src/bin/psql/input.h @@ -32,8 +32,8 @@ #if defined(HAVE_HISTORY_H) #include <history.h> #endif -#endif /* HAVE_READLINE_READLINE_H, etc */ -#endif /* HAVE_LIBREADLINE */ +#endif /* HAVE_READLINE_READLINE_H, etc */ +#endif /* HAVE_LIBREADLINE */ #include "pqexpbuffer.h" @@ -48,4 +48,4 @@ extern bool printHistory(const char *fname, unsigned short int pager); extern void pg_append_history(const char *s, PQExpBuffer history_buf); extern void pg_send_history(PQExpBuffer history_buf); -#endif /* INPUT_H */ +#endif /* INPUT_H */ diff --git a/src/bin/psql/large_obj.h b/src/bin/psql/large_obj.h index 7d74d5fdb71..5750b5d9ccc 100644 --- a/src/bin/psql/large_obj.h +++ b/src/bin/psql/large_obj.h @@ -13,4 +13,4 @@ bool do_lo_import(const char *filename_arg, const char *comment_arg); bool do_lo_unlink(const char *loid_arg); bool do_lo_list(void); -#endif /* LARGE_OBJ_H */ +#endif /* LARGE_OBJ_H */ diff --git a/src/bin/psql/mainloop.c b/src/bin/psql/mainloop.c index 67e922fa94d..e35b9077649 100644 --- a/src/bin/psql/mainloop.c +++ b/src/bin/psql/mainloop.c @@ -36,7 +36,7 @@ MainLoop(FILE *source) { PsqlScanState scan_state; /* lexer working state */ ConditionalStack cond_stack; /* \if status stack */ - volatile PQExpBuffer query_buf; /* buffer for query being accumulated */ + volatile PQExpBuffer query_buf; /* buffer for query being accumulated */ volatile PQExpBuffer previous_buf; /* if there isn't anything in the new * buffer yet, use this one for \e, * etc. */ diff --git a/src/bin/psql/mainloop.h b/src/bin/psql/mainloop.h index 228a5e085eb..8ef8cc1bd68 100644 --- a/src/bin/psql/mainloop.h +++ b/src/bin/psql/mainloop.h @@ -14,4 +14,4 @@ extern const PsqlScanCallbacks psqlscan_callbacks; extern int MainLoop(FILE *source); -#endif /* MAINLOOP_H */ +#endif /* MAINLOOP_H */ diff --git a/src/bin/psql/prompt.c b/src/bin/psql/prompt.c index e502ff3f6e6..913b23e4cd8 100644 --- a/src/bin/psql/prompt.c +++ b/src/bin/psql/prompt.c @@ -310,7 +310,7 @@ get_prompt(promptStatus_t status, ConditionalStack cstack) */ buf[0] = (*p == '[') ? RL_PROMPT_START_IGNORE : RL_PROMPT_END_IGNORE; buf[1] = '\0'; -#endif /* USE_READLINE */ +#endif /* USE_READLINE */ break; default: diff --git a/src/bin/psql/prompt.h b/src/bin/psql/prompt.h index b3d2d98fd7d..a7a95effb48 100644 --- a/src/bin/psql/prompt.h +++ b/src/bin/psql/prompt.h @@ -14,4 +14,4 @@ char *get_prompt(promptStatus_t status, ConditionalStack cstack); -#endif /* PROMPT_H */ +#endif /* PROMPT_H */ diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h index 70ff1812c8f..b78f151acd8 100644 --- a/src/bin/psql/settings.h +++ b/src/bin/psql/settings.h @@ -86,7 +86,7 @@ typedef struct _psqlSettings FILE *copyStream; /* Stream to read/write for \copy command */ - PGresult *last_error_result; /* most recent error result, if any */ + PGresult *last_error_result; /* most recent error result, if any */ printQueryOpt popt; diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c index 751ef913f08..7f767976a5b 100644 --- a/src/bin/psql/startup.c +++ b/src/bin/psql/startup.c @@ -12,7 +12,7 @@ #else /* WIN32 */ #include <io.h> #include <win32.h> -#endif /* WIN32 */ +#endif /* WIN32 */ #include "getopt_long.h" diff --git a/src/bin/psql/stringutils.h b/src/bin/psql/stringutils.h index 360ee030a11..213473f9199 100644 --- a/src/bin/psql/stringutils.h +++ b/src/bin/psql/stringutils.h @@ -24,4 +24,4 @@ extern void strip_quotes(char *source, char quote, char escape, int encoding); extern char *quote_if_needed(const char *source, const char *entails_quote, char quote, char escape, int encoding); -#endif /* STRINGUTILS_H */ +#endif /* STRINGUTILS_H */ diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 4ef8ed47351..20c41b7ce51 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -131,8 +131,8 @@ static int completion_max_records; */ static const char *completion_charp; /* to pass a string */ static const char *const *completion_charpp; /* to pass a list of strings */ -static const char *completion_info_charp; /* to pass a second string */ -static const char *completion_info_charp2; /* to pass a third string */ +static const char *completion_info_charp; /* to pass a second string */ +static const char *completion_info_charp2; /* to pass a third string */ static const SchemaQuery *completion_squery; /* to pass a SchemaQuery */ static bool completion_case_sensitive; /* completion is case sensitive */ @@ -1043,8 +1043,8 @@ static const pgsql_thing_t words_after_create[] = { {"SYSTEM", NULL, NULL, THING_NO_CREATE | THING_NO_DROP}, {"TABLE", NULL, &Query_for_list_of_tables}, {"TABLESPACE", Query_for_list_of_tablespaces}, - {"TEMP", NULL, NULL, THING_NO_DROP | THING_NO_ALTER}, /* for CREATE TEMP TABLE - * ... */ + {"TEMP", NULL, NULL, THING_NO_DROP | THING_NO_ALTER}, /* for CREATE TEMP TABLE + * ... */ {"TEMPLATE", Query_for_list_of_ts_templates, NULL, THING_NO_SHOW}, {"TEMPORARY", NULL, NULL, THING_NO_DROP | THING_NO_ALTER}, /* for CREATE TEMPORARY * TABLE ... */ @@ -1052,8 +1052,8 @@ static const pgsql_thing_t words_after_create[] = { {"TRANSFORM", NULL, NULL}, {"TRIGGER", "SELECT pg_catalog.quote_ident(tgname) FROM pg_catalog.pg_trigger WHERE substring(pg_catalog.quote_ident(tgname),1,%d)='%s' AND NOT tgisinternal"}, {"TYPE", NULL, &Query_for_list_of_datatypes}, - {"UNIQUE", NULL, NULL, THING_NO_DROP | THING_NO_ALTER}, /* for CREATE UNIQUE - * INDEX ... */ + {"UNIQUE", NULL, NULL, THING_NO_DROP | THING_NO_ALTER}, /* for CREATE UNIQUE + * INDEX ... */ {"UNLOGGED", NULL, NULL, THING_NO_DROP | THING_NO_ALTER}, /* for CREATE UNLOGGED * TABLE ... */ {"USER", Query_for_list_of_roles}, @@ -4422,6 +4422,6 @@ dequote_file_name(char *text, char quote_char) return s; } -#endif /* NOT_USED */ +#endif /* NOT_USED */ -#endif /* USE_READLINE */ +#endif /* USE_READLINE */ diff --git a/src/bin/psql/tab-complete.h b/src/bin/psql/tab-complete.h index 9c0309dc1ed..1a42ef1c661 100644 --- a/src/bin/psql/tab-complete.h +++ b/src/bin/psql/tab-complete.h @@ -14,4 +14,4 @@ extern PQExpBuffer tab_completion_query_buf; extern void initialize_readline(void); -#endif /* TAB_COMPLETE_H */ +#endif /* TAB_COMPLETE_H */ diff --git a/src/bin/psql/variables.c b/src/bin/psql/variables.c index d9d07631a59..806d39bfbe3 100644 --- a/src/bin/psql/variables.c +++ b/src/bin/psql/variables.c @@ -273,7 +273,7 @@ SetVariable(VariableSpace space, const char *name, const char *value) } } else if (new_value) - pg_free(new_value); /* current->value is left unchanged */ + pg_free(new_value); /* current->value is left unchanged */ return confirmed; } diff --git a/src/bin/psql/variables.h b/src/bin/psql/variables.h index 19257937c7c..02d85b1bc2e 100644 --- a/src/bin/psql/variables.h +++ b/src/bin/psql/variables.h @@ -93,4 +93,4 @@ void SetVariableHooks(VariableSpace space, const char *name, void PsqlVarEnumError(const char *name, const char *value, const char *suggestions); -#endif /* VARIABLES_H */ +#endif /* VARIABLES_H */ diff --git a/src/bin/scripts/common.c b/src/bin/scripts/common.c index 0b88fa6b4dc..7394bf293ea 100644 --- a/src/bin/scripts/common.c +++ b/src/bin/scripts/common.c @@ -425,4 +425,4 @@ setup_cancel_handler(void) SetConsoleCtrlHandler(consoleHandler, TRUE); } -#endif /* WIN32 */ +#endif /* WIN32 */ diff --git a/src/bin/scripts/common.h b/src/bin/scripts/common.h index 6532eb23725..61a31a7f4d7 100644 --- a/src/bin/scripts/common.h +++ b/src/bin/scripts/common.h @@ -55,4 +55,4 @@ extern void SetCancelConn(PGconn *conn); extern void ResetCancelConn(void); -#endif /* COMMON_H */ +#endif /* COMMON_H */ |
