From 06312bdb43c66150e59958479640913c3726ee10 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Mon, 18 Sep 2017 15:10:22 -0700 Subject: Minor formatting, commenting and clang format for C to C++ conversion --- .../filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c | 2 +- src/core/ext/transport/chttp2/transport/hpack_encoder.c | 2 +- src/core/lib/iomgr/ev_epoll1_linux.c | 6 +++++- src/core/lib/iomgr/ev_epollex_linux.c | 6 +++++- 4 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c index 9975b1ef79..04379975e1 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c @@ -276,7 +276,7 @@ static void on_txt_done_cb(void *arg, int status, int timeouts, char *error_msg; grpc_ares_request *r = (grpc_ares_request *)arg; const size_t prefix_len = sizeof(g_service_config_attribute_prefix) - 1; - struct ares_txt_ext *result; + struct ares_txt_ext *result = NULL; struct ares_txt_ext *reply = NULL; grpc_error *error = GRPC_ERROR_NONE; gpr_mu_lock(&r->mu); diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.c b/src/core/ext/transport/chttp2/transport/hpack_encoder.c index 52c9e217f1..9dfbd3c3a9 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_encoder.c +++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.c @@ -53,7 +53,7 @@ static grpc_slice_refcount terminal_slice_refcount = {NULL, NULL}; static const grpc_slice terminal_slice = { &terminal_slice_refcount, /* refcount */ - {{0, 0}} /* refcounted */ + {{0, 0}} /* data.refcounted */ }; extern grpc_tracer_flag grpc_http_trace; diff --git a/src/core/lib/iomgr/ev_epoll1_linux.c b/src/core/lib/iomgr/ev_epoll1_linux.c index b5066e5f58..7fde45865e 100644 --- a/src/core/lib/iomgr/ev_epoll1_linux.c +++ b/src/core/lib/iomgr/ev_epoll1_linux.c @@ -568,7 +568,11 @@ static int poll_deadline_to_millis_timeout(gpr_timespec deadline, return 0; } - static const gpr_timespec round_up = {0, GPR_NS_PER_MS - 1, GPR_TIMESPAN}; + static const gpr_timespec round_up = { + 0, /* tv_sec */ + GPR_NS_PER_MS - 1, /* tv_nsec */ + GPR_TIMESPAN /* clock_type */ + }; timeout = gpr_time_sub(deadline, now); int millis = gpr_time_to_millis(gpr_time_add(timeout, round_up)); return millis >= 1 ? millis : 1; diff --git a/src/core/lib/iomgr/ev_epollex_linux.c b/src/core/lib/iomgr/ev_epollex_linux.c index 671c4cd730..cff0c07a2b 100644 --- a/src/core/lib/iomgr/ev_epollex_linux.c +++ b/src/core/lib/iomgr/ev_epollex_linux.c @@ -706,7 +706,11 @@ static int poll_deadline_to_millis_timeout(gpr_timespec deadline, return 0; } - static const gpr_timespec round_up = {0, GPR_NS_PER_MS - 1, GPR_TIMESPAN}; + static const gpr_timespec round_up = { + 0, /* tv_sec */ + GPR_NS_PER_MS - 1, /* tv_nsec */ + GPR_TIMESPAN /* clock_type */ + }; timeout = gpr_time_sub(deadline, now); int millis = gpr_time_to_millis(gpr_time_add(timeout, round_up)); return millis >= 1 ? millis : 1; -- cgit v1.2.3