pgpool2.git / summary / log / commit / refs

commit    90efb9540aa7ac8902ededdfb27ef3d582a78ab0
Author:   Tatsuo Ishii <ishii at sraoss.co.jp>
Date:     Sat Jan 02 09:17:48 2010 +0000

    Fix warnings when compiling on 64bit platforms.


pool_connection_pool.c | 2 +- pool_process_query.c | 2 +- pool_proto_modules.c | 4 ++-- pool_relcache.c | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pool_connection_pool.c b/pool_connection_pool.c index c3c248648..3c98dd63f 100644 --- a/pool_connection_pool.c +++ b/pool_connection_pool.c @@ -254,7 +254,7 @@ POOL_CONNECTION_POOL *pool_create_cp(void) p = oldestp; pool_send_frontend_exits(p); - pool_debug("discarding old %d th connection. user: %s database: %s", + pool_debug("discarding old %zd th connection. user: %s database: %s", oldestp - pool_connection_pool, MASTER_CONNECTION(p)->sp->user, MASTER_CONNECTION(p)->sp->database); diff --git a/pool_process_query.c b/pool_process_query.c index bcd190fef..d4c11758d 100644 --- a/pool_process_query.c +++ b/pool_process_query.c @@ -2924,7 +2924,7 @@ int need_insert_lock(POOL_CONNECTION_POOL *backend, char *query, Node *node) /* * Search relcache. */ - result = (int)pool_search_relcache(relcache, backend, str); + result = pool_search_relcache(relcache, backend, str)==0?0:1; return result; } diff --git a/pool_proto_modules.c b/pool_proto_modules.c index 17823f5b9..b41352da2 100644 --- a/pool_proto_modules.c +++ b/pool_proto_modules.c @@ -2679,7 +2679,7 @@ static int is_temp_table(POOL_CONNECTION_POOL *backend, Node *node) } } - hasrelistemp = (int)pool_search_relcache(hasrelistemp_cache, backend, "pg_class"); + hasrelistemp = pool_search_relcache(hasrelistemp_cache, backend, "pg_class")==0?0:1; if (hasrelistemp) query = ISTEMPQUERY84; else @@ -2703,7 +2703,7 @@ static int is_temp_table(POOL_CONNECTION_POOL *backend, Node *node) /* * Search relcache. */ - result = (int)pool_search_relcache(relcache, backend, str); + result = pool_search_relcache(relcache, backend, str)==0?0:1; return result; } diff --git a/pool_relcache.c b/pool_relcache.c index 525029f88..c521e5ac0 100644 --- a/pool_relcache.c +++ b/pool_relcache.c @@ -46,7 +46,7 @@ POOL_RELCACHE *pool_create_relcache(int cachesize, char *sql, ip = (PoolRelCache *)malloc(sizeof(PoolRelCache)*cachesize); if (ip == NULL) { - pool_error("pool_create_relcache: cannot allocate memory %d", sizeof(PoolRelCache)*cachesize); + pool_error("pool_create_relcache: cannot allocate memory %zd", sizeof(PoolRelCache)*cachesize); return NULL; } memset(ip, 0, sizeof(PoolRelCache)*cachesize); @@ -54,7 +54,7 @@ POOL_RELCACHE *pool_create_relcache(int cachesize, char *sql, p = (POOL_RELCACHE *)malloc(sizeof(POOL_RELCACHE)); if (p == NULL) { - pool_error("pool_create_relcache: cannot allocate memory %d", sizeof(POOL_RELCACHE)); + pool_error("pool_create_relcache: cannot allocate memory %zd", sizeof(POOL_RELCACHE)); free(ip); return NULL; } @@ -205,7 +205,7 @@ void *pool_search_relcache(POOL_RELCACHE *relcache, POOL_CONNECTION_POOL *backen void *int_register_func(POOL_SELECT_RESULT *res) { if (res->numrows >= 1) - return (void *)atoi(res->data[0]); + return (void *)atol(res->data[0]); return (void *)0; } [parent: df7f5e8c13aa]