]> granicus.if.org Git - postgresql/commitdiff
Fix some compiler warnings that clang emits with -pedantic.
authorRobert Haas <rhaas@postgresql.org>
Fri, 4 Apr 2014 15:26:01 +0000 (11:26 -0400)
committerRobert Haas <rhaas@postgresql.org>
Fri, 4 Apr 2014 15:29:50 +0000 (11:29 -0400)
Andres Freund

src/backend/access/transam/xlog.c
src/bin/pg_dump/parallel.c
src/bin/psql/tab-complete.c
src/include/catalog/objectaccess.h
src/include/pgstat.h
src/include/utils/jsonapi.h

index 3a48227ad930871a2e524300d160a378717ecbd5..0b4a5f68a999816545584e0a3b5d22a384c5c828 100644 (file)
@@ -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 */
index 6f2634bb641e3f2b8d3e29d107a75eb92a1dad05..7d6e146dbda831d1cc50697bad37900d0cdf679a 100644 (file)
@@ -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
index 1d69b9538780a4c84233f0f466910b2fa347683a..202ffcef690832c3e412aef1aa29c65238a9984c 100644 (file)
@@ -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;
index e2f6b1424980f7c44e440a0784e7a261631c77c6..ac8260b63c2f581ba2fc7fc4731cd9665d054d53 100644 (file)
@@ -45,7 +45,7 @@ typedef enum ObjectAccessType
        OAT_DROP,
        OAT_POST_ALTER,
        OAT_NAMESPACE_SEARCH,
-       OAT_FUNCTION_EXECUTE,
+       OAT_FUNCTION_EXECUTE
 } ObjectAccessType;
 
 /*
index 932c83d79e5b0c6c38619766a3d71d79dd7b9a85..5f131f8272b639724c6ba28d7d9fe9810f8926cc 100644 (file)
@@ -676,7 +676,7 @@ typedef enum BackendState
        STATE_IDLEINTRANSACTION,
        STATE_FASTPATH,
        STATE_IDLEINTRANSACTION_ABORTED,
-       STATE_DISABLED,
+       STATE_DISABLED
 } BackendState;
 
 /* ----------
index 7a4fbfe4545c7c262c17979e387532e7029f4041..e4a2bd565dc942d8cdee6f5e92b604686c724bb2 100644 (file)
@@ -30,7 +30,7 @@ typedef enum
        JSON_TOKEN_TRUE,
        JSON_TOKEN_FALSE,
        JSON_TOKEN_NULL,
-       JSON_TOKEN_END,
+       JSON_TOKEN_END
 } JsonTokenType;