Skip to content

Commit 59202fa

Browse files
committed
Fix some compiler warnings that clang emits with -pedantic.
Andres Freund
1 parent b1236f4 commit 59202fa

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

src/backend/access/transam/xlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ typedef enum
651651
XLOG_FROM_ANY = 0, /* request to read WAL from any source */
652652
XLOG_FROM_ARCHIVE, /* restored using restore_command */
653653
XLOG_FROM_PG_XLOG, /* existing file in pg_xlog */
654-
XLOG_FROM_STREAM, /* streamed from master */
654+
XLOG_FROM_STREAM /* streamed from master */
655655
} XLogSource;
656656

657657
/* human-readable names for XLogSources, for debugging output */

src/bin/pg_dump/parallel.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,10 @@ ParallelBackupStart(ArchiveHandle *AH, RestoreOptions *ropt)
558558
{
559559
/* we are the worker */
560560
int j;
561-
int pipefd[2] = {pipeMW[PIPE_READ], pipeWM[PIPE_WRITE]};
561+
int pipefd[2];
562+
563+
pipefd[0] = pipeMW[PIPE_READ];
564+
pipefd[1] = pipeWM[PIPE_WRITE];
562565

563566
/*
564567
* Store the fds for the reverse communication in pstate. Actually

src/bin/psql/tab-complete.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ static const pgsql_thing_t words_after_create[] = {
781781

782782

783783
/* Forward declaration of functions */
784-
static char **psql_completion(char *text, int start, int end);
784+
static char **psql_completion(const char *text, int start, int end);
785785
static char *create_command_generator(const char *text, int state);
786786
static char *drop_command_generator(const char *text, int state);
787787
static char *complete_from_query(const char *text, int state);
@@ -790,7 +790,7 @@ static char *_complete_from_query(int is_schema_query,
790790
const char *text, int state);
791791
static char *complete_from_list(const char *text, int state);
792792
static char *complete_from_const(const char *text, int state);
793-
static char **complete_from_variables(char *text,
793+
static char **complete_from_variables(const char *text,
794794
const char *prefix, const char *suffix);
795795
static char *complete_from_files(const char *text, int state);
796796

@@ -812,7 +812,7 @@ void
812812
initialize_readline(void)
813813
{
814814
rl_readline_name = (char *) pset.progname;
815-
rl_attempted_completion_function = (void *) psql_completion;
815+
rl_attempted_completion_function = psql_completion;
816816

817817
rl_basic_word_break_characters = WORD_BREAKS;
818818

@@ -834,7 +834,7 @@ initialize_readline(void)
834834
* completion_matches() function, so we don't have to worry about it.
835835
*/
836836
static char **
837-
psql_completion(char *text, int start, int end)
837+
psql_completion(const char *text, int start, int end)
838838
{
839839
/* This is the variable we'll return. */
840840
char **matches = NULL;
@@ -3847,7 +3847,7 @@ complete_from_const(const char *text, int state)
38473847
* to support quoting usages.
38483848
*/
38493849
static char **
3850-
complete_from_variables(char *text, const char *prefix, const char *suffix)
3850+
complete_from_variables(const char *text, const char *prefix, const char *suffix)
38513851
{
38523852
char **matches;
38533853
char **varnames;

src/include/catalog/objectaccess.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ typedef enum ObjectAccessType
4545
OAT_DROP,
4646
OAT_POST_ALTER,
4747
OAT_NAMESPACE_SEARCH,
48-
OAT_FUNCTION_EXECUTE,
48+
OAT_FUNCTION_EXECUTE
4949
} ObjectAccessType;
5050

5151
/*

src/include/pgstat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ typedef enum BackendState
676676
STATE_IDLEINTRANSACTION,
677677
STATE_FASTPATH,
678678
STATE_IDLEINTRANSACTION_ABORTED,
679-
STATE_DISABLED,
679+
STATE_DISABLED
680680
} BackendState;
681681

682682
/* ----------

src/include/utils/jsonapi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ typedef enum
3030
JSON_TOKEN_TRUE,
3131
JSON_TOKEN_FALSE,
3232
JSON_TOKEN_NULL,
33-
JSON_TOKEN_END,
33+
JSON_TOKEN_END
3434
} JsonTokenType;
3535

3636

0 commit comments

Comments
 (0)