From: Marko Kreen Date: Thu, 24 Feb 2011 21:25:48 +0000 (+0200) Subject: Sync with libusual portability changes X-Git-Tag: pgbouncer_1_4_1_rc1~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=edc9f63701d78647a2796245252c0c75cf3174af;p=pgbouncer Sync with libusual portability changes --- diff --git a/lib b/lib index 4235e02..7abebdf 160000 --- a/lib +++ b/lib @@ -1 +1 @@ -Subproject commit 4235e02ac2cd3218ec53b3fd6eadbc1894eef250 +Subproject commit 7abebdff3422e4a7d0baaa57eaa14205dba14e39 diff --git a/src/dnslookup.c b/src/dnslookup.c index ac136a2..76e3acf 100644 --- a/src/dnslookup.c +++ b/src/dnslookup.c @@ -351,7 +351,7 @@ loop: goto loop; } -static int req_cmp(long arg, struct AANode *node) +static int req_cmp(uintptr_t arg, struct AANode *node) { const char *s1 = (char *)arg; struct DNSRequest *req = container_of(node, struct DNSRequest, node); @@ -412,7 +412,7 @@ struct DNSToken *adns_resolve(struct DNSContext *ctx, const char *name, adns_cal struct AANode *node; /* setup actual lookup */ - node = aatree_search(&ctx->req_tree, (long)name); + node = aatree_search(&ctx->req_tree, (uintptr_t)name); if (node) { req = container_of(node, struct DNSRequest, node); } else { @@ -428,7 +428,7 @@ struct DNSToken *adns_resolve(struct DNSContext *ctx, const char *name, adns_cal req->ctx = ctx; req->namelen = namelen; list_init(&req->ucb_list); - aatree_insert(&ctx->req_tree, (long)req->name, &req->node); + aatree_insert(&ctx->req_tree, (uintptr_t)req->name, &req->node); impl_launch_query(req); } diff --git a/src/main.c b/src/main.c index c1ac799..834dd2f 100644 --- a/src/main.c +++ b/src/main.c @@ -25,8 +25,7 @@ #include #include #include - -#include +#include #ifdef HAVE_SYS_RESOURCE_H #include diff --git a/src/objects.c b/src/objects.c index 1dc41d7..e93b3d2 100644 --- a/src/objects.c +++ b/src/objects.c @@ -87,7 +87,7 @@ static void construct_server(void *obj) } /* compare string with PgUser->name, for usage with btree */ -static int user_node_cmp(long userptr, struct AANode *node) +static int user_node_cmp(uintptr_t userptr, struct AANode *node) { const char *name = (const char *)userptr; PgUser *user = container_of(node, PgUser, tree_node); @@ -356,7 +356,7 @@ PgUser *add_user(const char *name, const char *passwd) safe_strcpy(user->name, name, sizeof(user->name)); put_in_order(&user->head, &user_list, cmp_user); - aatree_insert(&user_tree, (long)user->name, &user->tree_node); + aatree_insert(&user_tree, (uintptr_t)user->name, &user->tree_node); } safe_strcpy(user->passwd, passwd, sizeof(user->passwd)); return user; @@ -408,7 +408,7 @@ PgUser *find_user(const char *name) PgUser *user = NULL; struct AANode *node; - node = aatree_search(&user_tree, (long)name); + node = aatree_search(&user_tree, (uintptr_t)name); user = node ? container_of(node, PgUser, tree_node) : NULL; return user; }