aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2014-04-04 11:26:01 -0400
committerRobert Haas <rhaas@postgresql.org>2014-04-04 11:29:50 -0400
commit59202fae0434c98beb4994c5fe4df354a6af31e6 (patch)
tree4aac1efe801fe27872a202dba130b72db0633d9b /src
parentb1236f4b7ba2c05542f44d07c0a9ffbec3b66295 (diff)
downloadpostgresql-59202fae0434c98beb4994c5fe4df354a6af31e6.tar.gz
postgresql-59202fae0434c98beb4994c5fe4df354a6af31e6.zip
Fix some compiler warnings that clang emits with -pedantic.
Andres Freund
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/transam/xlog.c2
-rw-r--r--src/bin/pg_dump/parallel.c5
-rw-r--r--src/bin/psql/tab-complete.c10
-rw-r--r--src/include/catalog/objectaccess.h2
-rw-r--r--src/include/pgstat.h2
-rw-r--r--src/include/utils/jsonapi.h2
6 files changed, 13 insertions, 10 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 3a48227ad93..0b4a5f68a99 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -651,7 +651,7 @@ typedef enum
XLOG_FROM_ANY = 0, /* request to read WAL from any source */
XLOG_FROM_ARCHIVE, /* restored using restore_command */
XLOG_FROM_PG_XLOG, /* existing file in pg_xlog */
- XLOG_FROM_STREAM, /* streamed from master */
+ XLOG_FROM_STREAM /* streamed from master */
} XLogSource;
/* human-readable names for XLogSources, for debugging output */
diff --git a/src/bin/pg_dump/parallel.c b/src/bin/pg_dump/parallel.c
index 6f2634bb641..7d6e146dbda 100644
--- a/src/bin/pg_dump/parallel.c
+++ b/src/bin/pg_dump/parallel.c
@@ -558,7 +558,10 @@ ParallelBackupStart(ArchiveHandle *AH, RestoreOptions *ropt)
{
/* we are the worker */
int j;
- int pipefd[2] = {pipeMW[PIPE_READ], pipeWM[PIPE_WRITE]};
+ int pipefd[2];
+
+ pipefd[0] = pipeMW[PIPE_READ];
+ pipefd[1] = pipeWM[PIPE_WRITE];
/*
* Store the fds for the reverse communication in pstate. Actually
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 1d69b953878..202ffcef690 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -781,7 +781,7 @@ static const pgsql_thing_t words_after_create[] = {
/* Forward declaration of functions */
-static char **psql_completion(char *text, int start, int end);
+static char **psql_completion(const char *text, int start, int end);
static char *create_command_generator(const char *text, int state);
static char *drop_command_generator(const char *text, int state);
static char *complete_from_query(const char *text, int state);
@@ -790,7 +790,7 @@ static char *_complete_from_query(int is_schema_query,
const char *text, int state);
static char *complete_from_list(const char *text, int state);
static char *complete_from_const(const char *text, int state);
-static char **complete_from_variables(char *text,
+static char **complete_from_variables(const char *text,
const char *prefix, const char *suffix);
static char *complete_from_files(const char *text, int state);
@@ -812,7 +812,7 @@ void
initialize_readline(void)
{
rl_readline_name = (char *) pset.progname;
- rl_attempted_completion_function = (void *) psql_completion;
+ rl_attempted_completion_function = psql_completion;
rl_basic_word_break_characters = WORD_BREAKS;
@@ -834,7 +834,7 @@ initialize_readline(void)
* completion_matches() function, so we don't have to worry about it.
*/
static char **
-psql_completion(char *text, int start, int end)
+psql_completion(const char *text, int start, int end)
{
/* This is the variable we'll return. */
char **matches = NULL;
@@ -3847,7 +3847,7 @@ complete_from_const(const char *text, int state)
* to support quoting usages.
*/
static char **
-complete_from_variables(char *text, const char *prefix, const char *suffix)
+complete_from_variables(const char *text, const char *prefix, const char *suffix)
{
char **matches;
char **varnames;
diff --git a/src/include/catalog/objectaccess.h b/src/include/catalog/objectaccess.h
index e2f6b142498..ac8260b63c2 100644
--- a/src/include/catalog/objectaccess.h
+++ b/src/include/catalog/objectaccess.h
@@ -45,7 +45,7 @@ typedef enum ObjectAccessType
OAT_DROP,
OAT_POST_ALTER,
OAT_NAMESPACE_SEARCH,
- OAT_FUNCTION_EXECUTE,
+ OAT_FUNCTION_EXECUTE
} ObjectAccessType;
/*
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index 932c83d79e5..5f131f8272b 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -676,7 +676,7 @@ typedef enum BackendState
STATE_IDLEINTRANSACTION,
STATE_FASTPATH,
STATE_IDLEINTRANSACTION_ABORTED,
- STATE_DISABLED,
+ STATE_DISABLED
} BackendState;
/* ----------
diff --git a/src/include/utils/jsonapi.h b/src/include/utils/jsonapi.h
index 7a4fbfe4545..e4a2bd565dc 100644
--- a/src/include/utils/jsonapi.h
+++ b/src/include/utils/jsonapi.h
@@ -30,7 +30,7 @@ typedef enum
JSON_TOKEN_TRUE,
JSON_TOKEN_FALSE,
JSON_TOKEN_NULL,
- JSON_TOKEN_END,
+ JSON_TOKEN_END
} JsonTokenType;