diff options
author | Yash Tibrewal <yashkt@google.com> | 2017-09-25 16:45:02 -0700 |
---|---|---|
committer | Yash Tibrewal <yashkt@google.com> | 2017-10-02 16:32:27 -0700 |
commit | 37fdb739607895335c748e42cd25170545a00d6c (patch) | |
tree | 2a2cc2e82bb42ec6f978376e5b5b93c222563da7 /src/core | |
parent | fcd26bcd0f9091389915858ae0ac404b3c8748b9 (diff) |
More build errors
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/ext/filters/client_channel/client_channel.cc | 2 | ||||
-rw-r--r-- | src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc | 3 | ||||
-rw-r--r-- | src/core/ext/transport/chttp2/transport/chttp2_transport.cc | 65 | ||||
-rw-r--r-- | src/core/ext/transport/chttp2/transport/writing.cc | 15 | ||||
-rw-r--r-- | src/core/lib/compression/stream_compression_gzip.c | 7 | ||||
-rw-r--r-- | src/core/lib/compression/stream_compression_identity.c | 9 | ||||
-rw-r--r-- | src/core/lib/iomgr/error.cc | 2 | ||||
-rw-r--r-- | src/core/lib/iomgr/executor.cc | 4 | ||||
-rw-r--r-- | src/core/lib/iomgr/iomgr.cc | 3 | ||||
-rw-r--r-- | src/core/lib/iomgr/tcp_client_windows.cc | 6 | ||||
-rw-r--r-- | src/core/lib/iomgr/tcp_server_windows.cc | 17 | ||||
-rw-r--r-- | src/core/lib/iomgr/timer_manager.cc | 5 | ||||
-rw-r--r-- | src/core/lib/security/credentials/jwt/jwt_credentials.cc | 2 | ||||
-rw-r--r-- | src/core/lib/support/string_util_windows.cc | 4 | ||||
-rw-r--r-- | src/core/lib/surface/call.cc | 6 | ||||
-rw-r--r-- | src/core/lib/surface/channel.cc | 20 | ||||
-rw-r--r-- | src/core/lib/surface/completion_queue.cc | 15 | ||||
-rw-r--r-- | src/core/lib/transport/transport_op_string.cc | 3 |
18 files changed, 93 insertions, 95 deletions
diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc index 47ec5fe24a..8bff7548ac 100644 --- a/src/core/ext/filters/client_channel/client_channel.cc +++ b/src/core/ext/filters/client_channel/client_channel.cc @@ -16,6 +16,8 @@ * */ +#include <grpc/support/port_platform.h> + #include "src/core/ext/filters/client_channel/client_channel.h" #include <inttypes.h> diff --git a/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc b/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc index 1baf80b720..1c093d0ad2 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +++ b/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc @@ -16,6 +16,9 @@ * */ +#include <grpc/support/port_platform.h> + +#include <inttypes.h> #include <string.h> #include <grpc/support/alloc.h> diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc index 9fc1b29138..d6a9aab7d6 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc @@ -18,6 +18,9 @@ #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" +#include <grpc/support/port_platform.h> + +#include <inttypes.h> #include <limits.h> #include <math.h> #include <stdio.h> @@ -434,13 +437,11 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA)) { t->ping_policy.max_pings_without_data = grpc_channel_arg_get_integer( &channel_args->args[i], - (grpc_integer_options){g_default_max_pings_without_data, 0, - INT_MAX}); + {g_default_max_pings_without_data, 0, INT_MAX}); } else if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_HTTP2_MAX_PING_STRIKES)) { t->ping_policy.max_ping_strikes = grpc_channel_arg_get_integer( - &channel_args->args[i], - (grpc_integer_options){g_default_max_ping_strikes, 0, INT_MAX}); + &channel_args->args[i], {g_default_max_ping_strikes, 0, INT_MAX}); } else if (0 == strcmp( channel_args->args[i].key, @@ -449,9 +450,8 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, gpr_time_from_millis( grpc_channel_arg_get_integer( &channel_args->args[i], - (grpc_integer_options){ - g_default_min_sent_ping_interval_without_data_ms, 0, - INT_MAX}), + {g_default_min_sent_ping_interval_without_data_ms, 0, + INT_MAX}), GPR_TIMESPAN); } else if (0 == strcmp( @@ -461,27 +461,24 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, gpr_time_from_millis( grpc_channel_arg_get_integer( &channel_args->args[i], - (grpc_integer_options){ - g_default_min_recv_ping_interval_without_data_ms, 0, - INT_MAX}), + {g_default_min_recv_ping_interval_without_data_ms, 0, + INT_MAX}), GPR_TIMESPAN); } else if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE)) { t->write_buffer_size = (uint32_t)grpc_channel_arg_get_integer( - &channel_args->args[i], - (grpc_integer_options){0, 0, MAX_WRITE_BUFFER_SIZE}); + &channel_args->args[i], {0, 0, MAX_WRITE_BUFFER_SIZE}); } else if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_HTTP2_BDP_PROBE)) { - t->flow_control.enable_bdp_probe = grpc_channel_arg_get_integer( - &channel_args->args[i], (grpc_integer_options){1, 0, 1}); + t->flow_control.enable_bdp_probe = + grpc_channel_arg_get_integer(&channel_args->args[i], {1, 0, 1}); } else if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_KEEPALIVE_TIME_MS)) { const int value = grpc_channel_arg_get_integer( &channel_args->args[i], - (grpc_integer_options){t->is_client - ? g_default_client_keepalive_time_ms - : g_default_server_keepalive_time_ms, - 1, INT_MAX}); + {t->is_client ? g_default_client_keepalive_time_ms + : g_default_server_keepalive_time_ms, + 1, INT_MAX}); t->keepalive_time = value == INT_MAX ? gpr_inf_future(GPR_TIMESPAN) : gpr_time_from_millis(value, GPR_TIMESPAN); @@ -489,18 +486,17 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, GRPC_ARG_KEEPALIVE_TIMEOUT_MS)) { const int value = grpc_channel_arg_get_integer( &channel_args->args[i], - (grpc_integer_options){t->is_client - ? g_default_client_keepalive_timeout_ms - : g_default_server_keepalive_timeout_ms, - 0, INT_MAX}); + {t->is_client ? g_default_client_keepalive_timeout_ms + : g_default_server_keepalive_timeout_ms, + 0, INT_MAX}); t->keepalive_timeout = value == INT_MAX ? gpr_inf_future(GPR_TIMESPAN) : gpr_time_from_millis(value, GPR_TIMESPAN); } else if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS)) { t->keepalive_permit_without_calls = - (uint32_t)grpc_channel_arg_get_integer( - &channel_args->args[i], (grpc_integer_options){0, 0, 1}); + (uint32_t)grpc_channel_arg_get_integer(&channel_args->args[i], + {0, 0, 1}); } else if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_OPTIMIZATION_TARGET)) { if (channel_args->args[i].type != GRPC_ARG_STRING) { @@ -2627,9 +2623,7 @@ void grpc_chttp2_config_default_keepalive_args(grpc_channel_args *args, for (i = 0; i < args->num_args; i++) { if (0 == strcmp(args->args[i].key, GRPC_ARG_KEEPALIVE_TIME_MS)) { const int value = grpc_channel_arg_get_integer( - &args->args[i], - (grpc_integer_options){g_default_client_keepalive_time_ms, 1, - INT_MAX}); + &args->args[i], {g_default_client_keepalive_time_ms, 1, INT_MAX}); if (is_client) { g_default_client_keepalive_time_ms = value; } else { @@ -2639,8 +2633,7 @@ void grpc_chttp2_config_default_keepalive_args(grpc_channel_args *args, strcmp(args->args[i].key, GRPC_ARG_KEEPALIVE_TIMEOUT_MS)) { const int value = grpc_channel_arg_get_integer( &args->args[i], - (grpc_integer_options){g_default_client_keepalive_timeout_ms, 0, - INT_MAX}); + {g_default_client_keepalive_timeout_ms, 0, INT_MAX}); if (is_client) { g_default_client_keepalive_timeout_ms = value; } else { @@ -2651,8 +2644,7 @@ void grpc_chttp2_config_default_keepalive_args(grpc_channel_args *args, g_default_keepalive_permit_without_calls = (uint32_t)grpc_channel_arg_get_integer( &args->args[i], - (grpc_integer_options){g_default_keepalive_permit_without_calls, - 0, 1}); + {g_default_keepalive_permit_without_calls, 0, 1}); } else if (0 == strcmp(args->args[i].key, GRPC_ARG_HTTP2_MAX_PING_STRIKES)) { g_default_max_ping_strikes = grpc_channel_arg_get_integer( @@ -2661,8 +2653,7 @@ void grpc_chttp2_config_default_keepalive_args(grpc_channel_args *args, } else if (0 == strcmp(args->args[i].key, GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA)) { g_default_max_pings_without_data = grpc_channel_arg_get_integer( - &args->args[i], (grpc_integer_options){ - g_default_max_pings_without_data, 0, INT_MAX}); + &args->args[i], {g_default_max_pings_without_data, 0, INT_MAX}); } else if (0 == strcmp( args->args[i].key, @@ -2670,9 +2661,7 @@ void grpc_chttp2_config_default_keepalive_args(grpc_channel_args *args, g_default_min_sent_ping_interval_without_data_ms = grpc_channel_arg_get_integer( &args->args[i], - (grpc_integer_options){ - g_default_min_sent_ping_interval_without_data_ms, 0, - INT_MAX}); + {g_default_min_sent_ping_interval_without_data_ms, 0, INT_MAX}); } else if (0 == strcmp( args->args[i].key, @@ -2680,9 +2669,7 @@ void grpc_chttp2_config_default_keepalive_args(grpc_channel_args *args, g_default_min_recv_ping_interval_without_data_ms = grpc_channel_arg_get_integer( &args->args[i], - (grpc_integer_options){ - g_default_min_recv_ping_interval_without_data_ms, 0, - INT_MAX}); + {g_default_min_recv_ping_interval_without_data_ms, 0, INT_MAX}); } } } diff --git a/src/core/ext/transport/chttp2/transport/writing.cc b/src/core/ext/transport/chttp2/transport/writing.cc index 399b1608bd..ba3d55abb3 100644 --- a/src/core/ext/transport/chttp2/transport/writing.cc +++ b/src/core/ext/transport/chttp2/transport/writing.cc @@ -431,17 +431,16 @@ grpc_chttp2_begin_write_result grpc_chttp2_begin_write( &s->stats.outgoing, &t->outbuf); } else { grpc_encode_header_options hopt = { - .stream_id = s->id, - .is_eof = true, - .use_true_binary_metadata = - t->settings + s->id, true, + + t->settings [GRPC_PEER_SETTINGS] [GRPC_CHTTP2_SETTINGS_GRPC_ALLOW_TRUE_BINARY_METADATA] != 0, - .max_frame_size = - t->settings[GRPC_PEER_SETTINGS] - [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE], - .stats = &s->stats.outgoing}; + + t->settings[GRPC_PEER_SETTINGS] + [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE], + &s->stats.outgoing}; grpc_chttp2_encode_header(exec_ctx, &t->hpack_compressor, extra_headers_for_trailing_metadata, num_extra_headers_for_trailing_metadata, diff --git a/src/core/lib/compression/stream_compression_gzip.c b/src/core/lib/compression/stream_compression_gzip.c index abcbdb3a91..087b018be5 100644 --- a/src/core/lib/compression/stream_compression_gzip.c +++ b/src/core/lib/compression/stream_compression_gzip.c @@ -222,7 +222,6 @@ static void grpc_stream_compression_context_destroy_gzip( } const grpc_stream_compression_vtable grpc_stream_compression_gzip_vtable = { - .compress = grpc_stream_compress_gzip, - .decompress = grpc_stream_decompress_gzip, - .context_create = grpc_stream_compression_context_create_gzip, - .context_destroy = grpc_stream_compression_context_destroy_gzip}; + grpc_stream_compress_gzip, grpc_stream_decompress_gzip, + grpc_stream_compression_context_create_gzip, + grpc_stream_compression_context_destroy_gzip}; diff --git a/src/core/lib/compression/stream_compression_identity.c b/src/core/lib/compression/stream_compression_identity.c index 3dfcf53b85..9b2e6062e1 100644 --- a/src/core/lib/compression/stream_compression_identity.c +++ b/src/core/lib/compression/stream_compression_identity.c @@ -27,7 +27,7 @@ /* Singleton context used for all identity streams. */ static grpc_stream_compression_context identity_ctx = { - .vtable = &grpc_stream_compression_identity_vtable}; + &grpc_stream_compression_identity_vtable}; static void grpc_stream_compression_pass_through(grpc_slice_buffer *in, grpc_slice_buffer *out, @@ -88,7 +88,6 @@ static void grpc_stream_compression_context_destroy_identity( } const grpc_stream_compression_vtable grpc_stream_compression_identity_vtable = { - .compress = grpc_stream_compress_identity, - .decompress = grpc_stream_decompress_identity, - .context_create = grpc_stream_compression_context_create_identity, - .context_destroy = grpc_stream_compression_context_destroy_identity}; + grpc_stream_compress_identity, grpc_stream_decompress_identity, + grpc_stream_compression_context_create_identity, + grpc_stream_compression_context_destroy_identity}; diff --git a/src/core/lib/iomgr/error.cc b/src/core/lib/iomgr/error.cc index aa05501537..2ea6cf1301 100644 --- a/src/core/lib/iomgr/error.cc +++ b/src/core/lib/iomgr/error.cc @@ -15,9 +15,11 @@ * limitations under the License. * */ +#include <grpc/support/port_platform.h> #include "src/core/lib/iomgr/error.h" +#include <inttypes.h> #include <string.h> #include <grpc/status.h> diff --git a/src/core/lib/iomgr/executor.cc b/src/core/lib/iomgr/executor.cc index 892385d7d7..ebe7f240b4 100644 --- a/src/core/lib/iomgr/executor.cc +++ b/src/core/lib/iomgr/executor.cc @@ -100,7 +100,7 @@ void grpc_executor_set_threading(grpc_exec_ctx *exec_ctx, bool threading) { for (size_t i = 0; i < g_max_threads; i++) { gpr_mu_init(&g_thread_state[i].mu); gpr_cv_init(&g_thread_state[i].cv); - g_thread_state[i].elems = (grpc_closure_list)GRPC_CLOSURE_LIST_INIT; + g_thread_state[i].elems = GRPC_CLOSURE_LIST_INIT; } gpr_thd_options opt = gpr_thd_options_default(); @@ -172,7 +172,7 @@ static void executor_thread(void *arg) { } GRPC_STATS_INC_EXECUTOR_QUEUE_DRAINED(&exec_ctx); grpc_closure_list exec = ts->elems; - ts->elems = (grpc_closure_list)GRPC_CLOSURE_LIST_INIT; + ts->elems = GRPC_CLOSURE_LIST_INIT; gpr_mu_unlock(&ts->mu); if (GRPC_TRACER_ON(executor_trace)) { gpr_log(GPR_DEBUG, "EXECUTOR[%d]: execute", (int)(ts - g_thread_state)); diff --git a/src/core/lib/iomgr/iomgr.cc b/src/core/lib/iomgr/iomgr.cc index f63f190155..3a0605833a 100644 --- a/src/core/lib/iomgr/iomgr.cc +++ b/src/core/lib/iomgr/iomgr.cc @@ -16,8 +16,11 @@ * */ +#include <grpc/support/port_platform.h> + #include "src/core/lib/iomgr/iomgr.h" +#include <inttypes.h> #include <stdlib.h> #include <string.h> diff --git a/src/core/lib/iomgr/tcp_client_windows.cc b/src/core/lib/iomgr/tcp_client_windows.cc index 10f5594d56..cb274ec771 100644 --- a/src/core/lib/iomgr/tcp_client_windows.cc +++ b/src/core/lib/iomgr/tcp_client_windows.cc @@ -68,7 +68,7 @@ static void async_connect_unlock_and_cleanup(grpc_exec_ctx *exec_ctx, } static void on_alarm(grpc_exec_ctx *exec_ctx, void *acp, grpc_error *error) { - async_connect *ac = acp; + async_connect *ac = (async_connect *)acp; gpr_mu_lock(&ac->mu); grpc_winsocket *socket = ac->socket; ac->socket = NULL; @@ -79,7 +79,7 @@ static void on_alarm(grpc_exec_ctx *exec_ctx, void *acp, grpc_error *error) { } static void on_connect(grpc_exec_ctx *exec_ctx, void *acp, grpc_error *error) { - async_connect *ac = acp; + async_connect *ac = (async_connect *)acp; grpc_endpoint **ep = ac->endpoint; GPR_ASSERT(*ep == NULL); grpc_closure *on_done = ac->on_done; @@ -195,7 +195,7 @@ static void tcp_client_connect_impl( } } - ac = gpr_malloc(sizeof(async_connect)); + ac = (async_connect *)gpr_malloc(sizeof(async_connect)); ac->on_done = on_done; ac->socket = socket; gpr_mu_init(&ac->mu); diff --git a/src/core/lib/iomgr/tcp_server_windows.cc b/src/core/lib/iomgr/tcp_server_windows.cc index 2f23c04306..f198aaaa5b 100644 --- a/src/core/lib/iomgr/tcp_server_windows.cc +++ b/src/core/lib/iomgr/tcp_server_windows.cc @@ -98,7 +98,7 @@ grpc_error *grpc_tcp_server_create(grpc_exec_ctx *exec_ctx, grpc_closure *shutdown_complete, const grpc_channel_args *args, grpc_tcp_server **server) { - grpc_tcp_server *s = gpr_malloc(sizeof(grpc_tcp_server)); + grpc_tcp_server *s = (grpc_tcp_server *)gpr_malloc(sizeof(grpc_tcp_server)); s->channel_args = grpc_channel_args_copy(args); gpr_ref_init(&s->refs, 1); gpr_mu_init(&s->mu); @@ -116,7 +116,7 @@ grpc_error *grpc_tcp_server_create(grpc_exec_ctx *exec_ctx, static void destroy_server(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { - grpc_tcp_server *s = arg; + grpc_tcp_server *s = (grpc_tcp_server *)arg; /* Now that the accepts have been aborted, we can destroy the sockets. The IOCP won't get notified on these, so we can flag them as already @@ -189,6 +189,7 @@ static grpc_error *prepare_socket(SOCKET sock, int *port) { grpc_resolved_address sockname_temp; grpc_error *error = GRPC_ERROR_NONE; + int sockname_temp_len; error = grpc_tcp_prepare_socket(sock); if (error != GRPC_ERROR_NONE) { @@ -206,7 +207,7 @@ static grpc_error *prepare_socket(SOCKET sock, goto failure; } - int sockname_temp_len = sizeof(struct sockaddr_storage); + sockname_temp_len = sizeof(struct sockaddr_storage); if (getsockname(sock, (struct sockaddr *)sockname_temp.addr, &sockname_temp_len) == SOCKET_ERROR) { error = GRPC_WSA_ERROR(WSAGetLastError(), "getsockname"); @@ -295,7 +296,7 @@ failure: /* Event manager callback when reads are ready. */ static void on_accept(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { - grpc_tcp_listener *sp = arg; + grpc_tcp_listener *sp = (grpc_tcp_listener *)arg; SOCKET sock = sp->new_socket; grpc_winsocket_callback_info *info = &sp->socket->read_info; grpc_endpoint *ep = NULL; @@ -369,7 +370,8 @@ static void on_accept(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { managed to accept a connection, and created an endpoint. */ if (ep) { // Create acceptor. - grpc_tcp_server_acceptor *acceptor = gpr_malloc(sizeof(*acceptor)); + grpc_tcp_server_acceptor *acceptor = + (grpc_tcp_server_acceptor *)gpr_malloc(sizeof(*acceptor)); acceptor->from_server = sp->server; acceptor->port_index = sp->port_index; acceptor->fd_index = 0; @@ -422,7 +424,7 @@ static grpc_error *add_socket_to_server(grpc_tcp_server *s, SOCKET sock, GPR_ASSERT(port >= 0); gpr_mu_lock(&s->mu); GPR_ASSERT(!s->on_accept_cb && "must add ports before starting server"); - sp = gpr_malloc(sizeof(grpc_tcp_listener)); + sp = (grpc_tcp_listener *)gpr_malloc(sizeof(grpc_tcp_listener)); sp->next = NULL; if (s->head == NULL) { s->head = sp; @@ -473,7 +475,8 @@ grpc_error *grpc_tcp_server_add_port(grpc_tcp_server *s, sockname_temp.len = (size_t)sockname_temp_len; *port = grpc_sockaddr_get_port(&sockname_temp); if (*port > 0) { - allocated_addr = gpr_malloc(sizeof(grpc_resolved_address)); + allocated_addr = (grpc_resolved_address *)gpr_malloc( + sizeof(grpc_resolved_address)); memcpy(allocated_addr, addr, sizeof(grpc_resolved_address)); grpc_sockaddr_set_port(allocated_addr, *port); addr = allocated_addr; diff --git a/src/core/lib/iomgr/timer_manager.cc b/src/core/lib/iomgr/timer_manager.cc index 9f67d8ef22..862eba19f4 100644 --- a/src/core/lib/iomgr/timer_manager.cc +++ b/src/core/lib/iomgr/timer_manager.cc @@ -18,12 +18,13 @@ #include "src/core/lib/iomgr/timer_manager.h" -#include <inttypes.h> - #include <grpc/support/alloc.h> #include <grpc/support/log.h> +#include <grpc/support/port_platform.h> #include <grpc/support/thd.h> +#include <inttypes.h> + #include "src/core/lib/debug/trace.h" #include "src/core/lib/iomgr/timer.h" diff --git a/src/core/lib/security/credentials/jwt/jwt_credentials.cc b/src/core/lib/security/credentials/jwt/jwt_credentials.cc index 5e4de4166d..835dd677ed 100644 --- a/src/core/lib/security/credentials/jwt/jwt_credentials.cc +++ b/src/core/lib/security/credentials/jwt/jwt_credentials.cc @@ -16,6 +16,8 @@ * */ +#include <grpc/support/port_platform.h> + #include "src/core/lib/security/credentials/jwt/jwt_credentials.h" #include <inttypes.h> diff --git a/src/core/lib/support/string_util_windows.cc b/src/core/lib/support/string_util_windows.cc index d96f57a4b0..f8b9a06c31 100644 --- a/src/core/lib/support/string_util_windows.cc +++ b/src/core/lib/support/string_util_windows.cc @@ -43,7 +43,7 @@ gpr_char_to_tchar(LPCSTR input) { LPTSTR ret; int needed = MultiByteToWideChar(CP_UTF8, 0, input, -1, NULL, 0); if (needed <= 0) return NULL; - ret = gpr_malloc((unsigned)needed * sizeof(TCHAR)); + ret = (LPTSTR)gpr_malloc((unsigned)needed * sizeof(TCHAR)); MultiByteToWideChar(CP_UTF8, 0, input, -1, ret, needed); return ret; } @@ -53,7 +53,7 @@ gpr_tchar_to_char(LPCTSTR input) { LPSTR ret; int needed = WideCharToMultiByte(CP_UTF8, 0, input, -1, NULL, 0, NULL, NULL); if (needed <= 0) return NULL; - ret = gpr_malloc((unsigned)needed); + ret = (LPSTR)gpr_malloc((unsigned)needed); WideCharToMultiByte(CP_UTF8, 0, input, -1, ret, needed, NULL, NULL); return ret; } diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc index 4055d656bd..6c97f5cc01 100644 --- a/src/core/lib/surface/call.cc +++ b/src/core/lib/surface/call.cc @@ -808,10 +808,8 @@ static void get_final_status(grpc_call *call, static void set_status_from_error(grpc_exec_ctx *exec_ctx, grpc_call *call, status_source source, grpc_error *error) { if (!gpr_atm_rel_cas(&call->status[source], - pack_received_status((received_status){ - .is_set = false, .error = GRPC_ERROR_NONE}), - pack_received_status((received_status){ - .is_set = true, .error = error}))) { + pack_received_status({false, GRPC_ERROR_NONE}), + pack_received_status({true, error}))) { GRPC_ERROR_UNREF(error); } } diff --git a/src/core/lib/surface/channel.cc b/src/core/lib/surface/channel.cc index 65333cf1af..59fced7bc4 100644 --- a/src/core/lib/surface/channel.cc +++ b/src/core/lib/surface/channel.cc @@ -145,9 +145,8 @@ grpc_channel *grpc_channel_create_with_builder( channel->compression_options.default_level.level = (grpc_compression_level)grpc_channel_arg_get_integer( &args->args[i], - (grpc_integer_options){GRPC_COMPRESS_LEVEL_NONE, - GRPC_COMPRESS_LEVEL_NONE, - GRPC_COMPRESS_LEVEL_COUNT - 1}); + {GRPC_COMPRESS_LEVEL_NONE, GRPC_COMPRESS_LEVEL_NONE, + GRPC_COMPRESS_LEVEL_COUNT - 1}); } else if (0 == strcmp(args->args[i].key, GRPC_STREAM_COMPRESSION_CHANNEL_DEFAULT_LEVEL)) { channel->compression_options.default_stream_compression_level.is_set = @@ -155,17 +154,15 @@ grpc_channel *grpc_channel_create_with_builder( channel->compression_options.default_stream_compression_level.level = (grpc_stream_compression_level)grpc_channel_arg_get_integer( &args->args[i], - (grpc_integer_options){GRPC_STREAM_COMPRESS_LEVEL_NONE, - GRPC_STREAM_COMPRESS_LEVEL_NONE, - GRPC_STREAM_COMPRESS_LEVEL_COUNT - 1}); + {GRPC_STREAM_COMPRESS_LEVEL_NONE, GRPC_STREAM_COMPRESS_LEVEL_NONE, + GRPC_STREAM_COMPRESS_LEVEL_COUNT - 1}); } else if (0 == strcmp(args->args[i].key, GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM)) { channel->compression_options.default_algorithm.is_set = true; channel->compression_options.default_algorithm.algorithm = (grpc_compression_algorithm)grpc_channel_arg_get_integer( - &args->args[i], - (grpc_integer_options){GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, - GRPC_COMPRESS_ALGORITHMS_COUNT - 1}); + &args->args[i], {GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE, + GRPC_COMPRESS_ALGORITHMS_COUNT - 1}); } else if (0 == strcmp(args->args[i].key, GRPC_STREAM_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM)) { channel->compression_options.default_stream_compression_algorithm.is_set = @@ -174,9 +171,8 @@ grpc_channel *grpc_channel_create_with_builder( .algorithm = (grpc_stream_compression_algorithm)grpc_channel_arg_get_integer( &args->args[i], - (grpc_integer_options){ - GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_NONE, - GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT - 1}); + {GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_NONE, + GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT - 1}); } else if (0 == strcmp(args->args[i].key, GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET)) { diff --git a/src/core/lib/surface/completion_queue.cc b/src/core/lib/surface/completion_queue.cc index 91ad2cacd4..453646bd49 100644 --- a/src/core/lib/surface/completion_queue.cc +++ b/src/core/lib/surface/completion_queue.cc @@ -15,6 +15,8 @@ * limitations under the License. * */ +#include <grpc/support/port_platform.h> + #include "src/core/lib/surface/completion_queue.h" #include <inttypes.h> @@ -1064,13 +1066,12 @@ static grpc_event cq_pluck(grpc_completion_queue *cq, void *tag, GRPC_CQ_INTERNAL_REF(cq, "pluck"); gpr_mu_lock(cq->mu); cq_is_finished_arg is_finished_arg = { - .last_seen_things_queued_ever = - gpr_atm_no_barrier_load(&cqd->things_queued_ever), - .cq = cq, - .deadline = deadline, - .stolen_completion = NULL, - .tag = tag, - .first_loop = true}; + gpr_atm_no_barrier_load(&cqd->things_queued_ever), + cq, + deadline, + NULL, + tag, + true}; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INITIALIZER(0, cq_is_pluck_finished, &is_finished_arg); for (;;) { diff --git a/src/core/lib/transport/transport_op_string.cc b/src/core/lib/transport/transport_op_string.cc index 858664715c..87fdf72e29 100644 --- a/src/core/lib/transport/transport_op_string.cc +++ b/src/core/lib/transport/transport_op_string.cc @@ -16,8 +16,11 @@ * */ +#include <grpc/support/port_platform.h> + #include "src/core/lib/channel/channel_stack.h" +#include <inttypes.h> #include <stdarg.h> #include <stdio.h> #include <string.h> |