diff options
| author | Michael P | 2011-08-08 06:54:49 +0000 |
|---|---|---|
| committer | Michael P | 2011-08-08 06:56:50 +0000 |
| commit | 52fde6ac488b392203d642bc1b54d124ec4843ed (patch) | |
| tree | a10d841ff80a3330bd87a9c6be5fabf7a3632607 /src/gtm | |
| parent | f1a32c6227136d722aead50b8d4a85fceba7523f (diff) | |
Clean up compilation warnings
90% of compilation warnings are cleaned with this commit.
There are still warnings remaining due to the strong dependance
between GTM and PGXC main code.
Diffstat (limited to 'src/gtm')
| -rw-r--r-- | src/gtm/common/mcxt.c | 8 | ||||
| -rw-r--r-- | src/gtm/gtm_ctl/gtm_ctl.c | 2 | ||||
| -rw-r--r-- | src/gtm/main/gtm_seq.c | 6 | ||||
| -rw-r--r-- | src/gtm/main/gtm_txn.c | 1 | ||||
| -rw-r--r-- | src/gtm/path/path.c | 12 | ||||
| -rw-r--r-- | src/gtm/proxy/proxy_main.c | 1 |
6 files changed, 18 insertions, 12 deletions
diff --git a/src/gtm/common/mcxt.c b/src/gtm/common/mcxt.c index 90c63f08f1..e214cfe1aa 100644 --- a/src/gtm/common/mcxt.c +++ b/src/gtm/common/mcxt.c @@ -769,4 +769,10 @@ void *current_memcontext(void) { return((void *)CurrentMemoryContext); } -Gen_Alloc genAlloc_class = {MemoryContextAlloc, MemoryContextAllocZero, repalloc, pfree, current_memcontext}; + +Gen_Alloc genAlloc_class = {(void *)MemoryContextAlloc, + (void *)MemoryContextAllocZero, + (void *)repalloc, + (void *)pfree, + (void *)current_memcontext}; + diff --git a/src/gtm/gtm_ctl/gtm_ctl.c b/src/gtm/gtm_ctl/gtm_ctl.c index d37c009f37..b951f3da40 100644 --- a/src/gtm/gtm_ctl/gtm_ctl.c +++ b/src/gtm/gtm_ctl/gtm_ctl.c @@ -65,8 +65,6 @@ static char *log_file = NULL; static char *gtm_path = NULL; static char *gtm_app = NULL; static char *argv0 = NULL; -static char *reconnect_host = NULL; -static char *reconnect_port = NULL; static void write_stderr(const char *fmt,...) diff --git a/src/gtm/main/gtm_seq.c b/src/gtm/main/gtm_seq.c index 2c2c7d6423..261af75e3a 100644 --- a/src/gtm/main/gtm_seq.c +++ b/src/gtm/main/gtm_seq.c @@ -22,6 +22,7 @@ #include "gtm/gtm_seq.h" #include "gtm/gtm_serialize.h" #include "gtm/gtm_standby.h" +#include "gtm/standby_utils.h" #include "gtm/libpq.h" #include "gtm/libpq-int.h" #include "gtm/pqformat.h" @@ -639,7 +640,7 @@ GTM_SeqRename(GTM_SequenceKey seqkey, GTM_SequenceKey newseqkey) /* Release first the structure as it has been taken previously */ seq_release_seqinfo(seqinfo); - /* Close sequence properly, full name is here */ + /* Close sequence properly, full name is here */ seqkey->gsk_type = GTM_SEQ_FULL_NAME; /* Then close properly the old sequence */ GTM_SeqClose(seqkey); @@ -685,7 +686,8 @@ GTM_SeqSetVal(GTM_SequenceKey seqkey, GTM_Sequence nextval, bool iscalled) ereport(LOG, (EINVAL, errmsg("The sequence with the given key does not exist"))); - return InvalidSequenceValue; + + return EINVAL; } GTM_RWLockAcquire(&seqinfo->gs_lock, GTM_LOCKMODE_WRITE); diff --git a/src/gtm/main/gtm_txn.c b/src/gtm/main/gtm_txn.c index 37b40a68e3..0b69de922d 100644 --- a/src/gtm/main/gtm_txn.c +++ b/src/gtm/main/gtm_txn.c @@ -23,6 +23,7 @@ #include "gtm/gtm_txn.h" #include "gtm/gtm_serialize.h" #include "gtm/gtm_standby.h" +#include "gtm/standby_utils.h" #include "gtm/libpq.h" #include "gtm/libpq-int.h" #include "gtm/pqformat.h" diff --git a/src/gtm/path/path.c b/src/gtm/path/path.c index a3604f3b92..32009a3bcf 100644 --- a/src/gtm/path/path.c +++ b/src/gtm/path/path.c @@ -24,7 +24,7 @@ #include <gtm/path.h> -#define IS_DIR_SEP(ch) ((ch) == '/' || (ch) == '\\') +#define IS_DIR_SEP_GTM(ch) ((ch) == '/' || (ch) == '\\') #define skip_drive(path) (path) @@ -146,16 +146,16 @@ trim_directory(char *path) return; /* back up over trailing slash(es) */ - for (p = path + strlen(path) - 1; IS_DIR_SEP(*p) && p > path; p--) + for (p = path + strlen(path) - 1; IS_DIR_SEP_GTM(*p) && p > path; p--) ; /* back up over directory name */ - for (; !IS_DIR_SEP(*p) && p > path; p--) + for (; !IS_DIR_SEP_GTM(*p) && p > path; p--) ; /* if multiple slashes before directory name, remove 'em all */ - for (; p > path && IS_DIR_SEP(*(p - 1)); p--) + for (; p > path && IS_DIR_SEP_GTM(*(p - 1)); p--) ; /* don't erase a leading slash */ - if (p == path && IS_DIR_SEP(*p)) + if (p == path && IS_DIR_SEP_GTM(*p)) p++; *p = '\0'; } @@ -173,7 +173,7 @@ trim_trailing_separator(char *path) path = skip_drive(path); p = path + strlen(path); if (p > path) - for (p--; p > path && IS_DIR_SEP(*p); p--) + for (p--; p > path && IS_DIR_SEP_GTM(*p); p--) *p = '\0'; } diff --git a/src/gtm/proxy/proxy_main.c b/src/gtm/proxy/proxy_main.c index 1dc17e0d86..290556349c 100644 --- a/src/gtm/proxy/proxy_main.c +++ b/src/gtm/proxy/proxy_main.c @@ -1674,7 +1674,6 @@ static int ReadCommand(GTMProxy_ConnectionInfo *conninfo, StringInfo inBuf) { int qtype; - int rv; int connIdx = conninfo->con_id; int anyBackup; int myLocalId; |
