aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/client_config/resolvers
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-09-10 09:56:20 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-09-10 09:56:20 -0700
commit3121fd4d757991e7ef95a7b6b370b83c23ba61b6 (patch)
tree8c2a4c481d9a213921b5eed0c79c5865e2840098 /src/core/client_config/resolvers
parent495c0d332e3ad398d9b3ec7fa3f0f4811032bfa1 (diff)
Sign conversion fixes
Diffstat (limited to 'src/core/client_config/resolvers')
-rw-r--r--src/core/client_config/resolvers/dns_resolver.c2
-rw-r--r--src/core/client_config/resolvers/sockaddr_resolver.c15
2 files changed, 10 insertions, 7 deletions
diff --git a/src/core/client_config/resolvers/dns_resolver.c b/src/core/client_config/resolvers/dns_resolver.c
index 84643c464a..5124c4476a 100644
--- a/src/core/client_config/resolvers/dns_resolver.c
+++ b/src/core/client_config/resolvers/dns_resolver.c
@@ -140,7 +140,7 @@ static void dns_on_resolved(void *arg, grpc_resolved_addresses *addresses) {
for (i = 0; i < addresses->naddrs; i++) {
memset(&args, 0, sizeof(args));
args.addr = (struct sockaddr *)(addresses->addrs[i].addr);
- args.addr_len = addresses->addrs[i].len;
+ args.addr_len = (size_t)addresses->addrs[i].len;
subchannels[i] = grpc_subchannel_factory_create_subchannel(
r->subchannel_factory, &args);
}
diff --git a/src/core/client_config/resolvers/sockaddr_resolver.c b/src/core/client_config/resolvers/sockaddr_resolver.c
index 0d8540a566..4a3c14545a 100644
--- a/src/core/client_config/resolvers/sockaddr_resolver.c
+++ b/src/core/client_config/resolvers/sockaddr_resolver.c
@@ -63,7 +63,7 @@ typedef struct {
/** the addresses that we've 'resolved' */
struct sockaddr_storage *addrs;
/** the corresponding length of the addresses */
- int *addrs_len;
+ size_t *addrs_len;
/** how many elements in \a addrs */
size_t num_addrs;
@@ -157,7 +157,8 @@ static void sockaddr_destroy(grpc_resolver *gr) {
}
#ifdef GPR_POSIX_SOCKET
-static int parse_unix(grpc_uri *uri, struct sockaddr_storage *addr, int *len) {
+static int parse_unix(grpc_uri *uri, struct sockaddr_storage *addr,
+ size_t *len) {
struct sockaddr_un *un = (struct sockaddr_un *)addr;
un->sun_family = AF_UNIX;
@@ -189,7 +190,8 @@ static char *ipv6_get_default_authority(grpc_resolver_factory *factory,
return ip_get_default_authority(uri);
}
-static int parse_ipv4(grpc_uri *uri, struct sockaddr_storage *addr, int *len) {
+static int parse_ipv4(grpc_uri *uri, struct sockaddr_storage *addr,
+ size_t *len) {
const char *host_port = uri->path;
char *host;
char *port;
@@ -229,7 +231,8 @@ done:
return result;
}
-static int parse_ipv6(grpc_uri *uri, struct sockaddr_storage *addr, int *len) {
+static int parse_ipv6(grpc_uri *uri, struct sockaddr_storage *addr,
+ size_t *len) {
const char *host_port = uri->path;
char *host;
char *port;
@@ -275,7 +278,7 @@ static grpc_resolver *sockaddr_create(
grpc_lb_policy *(*lb_policy_factory)(grpc_subchannel **subchannels,
size_t num_subchannels),
grpc_subchannel_factory *subchannel_factory,
- int parse(grpc_uri *uri, struct sockaddr_storage *dst, int *len)) {
+ int parse(grpc_uri *uri, struct sockaddr_storage *dst, size_t *len)) {
size_t i;
int errors_found = 0; /* GPR_FALSE */
sockaddr_resolver *r;
@@ -296,7 +299,7 @@ static grpc_resolver *sockaddr_create(
gpr_slice_split(path_slice, ",", &path_parts);
r->num_addrs = path_parts.count;
r->addrs = gpr_malloc(sizeof(struct sockaddr_storage) * r->num_addrs);
- r->addrs_len = gpr_malloc(sizeof(int) * r->num_addrs);
+ r->addrs_len = gpr_malloc(sizeof(*r->addrs_len) * r->num_addrs);
for(i = 0; i < r->num_addrs; i++) {
grpc_uri ith_uri = *uri;