From 4473a087febe2f2f8eb7b710b507acd5ffd483c7 Mon Sep 17 00:00:00 2001 From: Vijay Pai <vpai@google.com> Date: Thu, 24 Sep 2015 15:02:42 -0700 Subject: [PATCH] Cleanup existing code to use GPR_ARRAY_SIZE --- src/core/iomgr/resolve_address_posix.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/iomgr/resolve_address_posix.c b/src/core/iomgr/resolve_address_posix.c index a28f2aaa3b..28f17a98cc 100644 --- a/src/core/iomgr/resolve_address_posix.c +++ b/src/core/iomgr/resolve_address_posix.c @@ -51,6 +51,7 @@ #include <grpc/support/string_util.h> #include <grpc/support/thd.h> #include <grpc/support/time.h> +#include <grpc/support/useful.h> typedef struct { char *name; @@ -110,8 +111,8 @@ grpc_resolved_addresses *grpc_blocking_resolve_address( if (s != 0) { /* Retry if well-known service name is recognized */ char *svc[][2] = {{"http", "80"}, {"https", "443"}}; - int i; - for (i = 0; i < (int)(sizeof(svc) / sizeof(svc[0])); i++) { + size_t i; + for (i = 0; i < GPR_ARRAY_SIZE(svc); i++) { if (strcmp(port, svc[i][0]) == 0) { GRPC_IOMGR_START_BLOCKING_REGION; s = getaddrinfo(host, svc[i][1], &hints, &result); -- GitLab