bdr: fix: use correct datatypes in various loops
authorChristian Kruse <cjk@defunct.ch>
Fri, 9 May 2014 09:50:52 +0000 (11:50 +0200)
committerAndres Freund <andres@anarazel.de>
Thu, 3 Jul 2014 15:55:32 +0000 (17:55 +0200)
This avoids compiler warnings for signed vs unsigned comparison.

contrib/bdr/bdr.c
contrib/bdr/bdr_count.c
contrib/bdr/bdr_init_replica.c
contrib/bdr/bdr_seq.c

index 0f3f53a91275939171ec1dec5fd9031cfc9d6fc6..8b1768bff54af82757363b346dfe1e0c60b7aa84 100644 (file)
@@ -784,7 +784,7 @@ bdr_create_con_gucs(char  *name,
                    char **database_initcons,
                    BdrConnectionConfig **out_config)
 {
-   int         off;
+   Size        off;
    char       *errmsg = NULL;
    PQconninfoOption *options;
    PQconninfoOption *cur_option;
index 55ddfdfd898a441ef8d9649b6f026a99253f4780..dabf6f36e251782a967feaca54efc0c9d576b181 100644 (file)
@@ -297,7 +297,7 @@ pg_stat_get_bdr(PG_FUNCTION_ARGS)
    Tuplestorestate *tupstore;
    MemoryContext per_query_ctx;
    MemoryContext oldcontext;
-   int         current_offset;
+   size_t      current_offset;
 
    if (!superuser())
        elog(ERROR, "blarg");
@@ -453,7 +453,7 @@ bdr_count_unserialize(void)
    int         fd;
    const char *path = "global/bdr.stat";
    BdrCountSerialize serial;
-   Size        read_size;
+   ssize_t     read_size;
 
    if (BdrCountCtl == NULL)
        elog(ERROR, "cannot use bdr statistics function without loading bdr");
index 40d8d4516767ffeae620ab72a8832792f992979f..ad5f73b885926da4d795f02b25e9179d54a91de0 100644 (file)
@@ -69,7 +69,7 @@ static void bdr_catchup_to_lsn(int cfg_index,
 static BdrWorker*
 find_init_replica_worker(Name dbname)
 {
-   Size off;
+   int off;
 
    Assert(LWLockHeldByMe(BdrWorkerCtl->lock));
    /* Check whether one of our connections has init_replica set */
index 4ed12f671161e80cb4f2e9b5dd1803bc1c6875db..b41756aa89fa5cc79710547832010df6b794cf35 100644 (file)
@@ -526,7 +526,7 @@ bdr_sequencer_shmem_init(int nnodes, int sequencers)
 void
 bdr_sequencer_wakeup(void)
 {
-   int off;
+   size_t off;
    BdrSequencerSlot *slot;