Merge remote-tracking branch 'upstream/master'

pull/145/head
murgatroid99 10 years ago
commit 216aa818a7
  1. 2958
      Makefile
  2. 8
      build.json
  3. 22
      include/grpc/grpc.h
  4. 2
      include/grpc/support/slice.h
  5. 4
      src/core/iomgr/alarm.c
  6. 6
      src/core/iomgr/alarm_internal.h
  7. 10
      src/core/iomgr/iomgr.c
  8. 4
      src/core/iomgr/iomgr.h
  9. 8
      src/core/iomgr/iomgr_internal.h
  10. 4
      src/core/iomgr/iomgr_posix.c
  11. 4
      src/core/iomgr/iomgr_posix.h
  12. 6
      src/core/iomgr/pollset_posix.c
  13. 2
      src/core/iomgr/pollset_posix.h
  14. 4
      src/core/iomgr/socket_utils_common_posix.c
  15. 2
      src/core/iomgr/socket_utils_posix.h
  16. 2
      src/core/iomgr/tcp_server.h
  17. 6
      src/core/iomgr/tcp_server_posix.c
  18. 4
      src/core/security/credentials.c
  19. 4
      src/core/statistics/census_init.c
  20. 6
      src/core/statistics/census_interface.h
  21. 10
      src/core/statistics/census_log.c
  22. 8
      src/core/statistics/census_log.h
  23. 10
      src/core/statistics/census_rpc_stats.c
  24. 6
      src/core/statistics/census_rpc_stats.h
  25. 16
      src/core/statistics/census_tracing.c
  26. 8
      src/core/statistics/census_tracing.h
  27. 4
      src/core/support/cpu.h
  28. 4
      src/core/support/cpu_linux.c
  29. 4
      src/core/support/cpu_posix.c
  30. 2
      src/core/support/log_linux.c
  31. 2
      src/core/support/log_posix.c
  32. 2
      src/core/support/slice.c
  33. 2
      src/core/support/string.c
  34. 11
      src/core/surface/call.c
  35. 4
      src/core/surface/completion_queue.c
  36. 4
      src/core/surface/init.c
  37. 2
      src/core/transport/chttp2/alpn.c
  38. 2
      src/core/transport/chttp2/alpn.h
  39. 2
      src/core/transport/chttp2/frame_settings.c
  40. 2
      src/core/transport/chttp2/frame_settings.h
  41. 14
      src/core/transport/chttp2/gen_hpack_tables.c
  42. 2
      src/core/transport/metadata.c
  43. 2
      src/core/transport/metadata.h
  44. 2
      src/ruby/grpc.gemspec
  45. 195
      templates/Makefile.template
  46. 2
      test/core/channel/channel_stack_test.c
  47. 2
      test/core/compression/message_compress_test.c
  48. 6
      test/core/echo/server.c
  49. 3
      test/core/end2end/dualstack_socket_test.c
  50. 5
      test/core/end2end/tests/cancel_after_accept.c
  51. 5
      test/core/end2end/tests/cancel_after_accept_and_writes_closed.c
  52. 2
      test/core/end2end/tests/cancel_after_invoke.c
  53. 2
      test/core/end2end/tests/cancel_before_invoke.c
  54. 2
      test/core/end2end/tests/cancel_in_a_vacuum.c
  55. 3
      test/core/end2end/tests/census_simple_request.c
  56. 6
      test/core/end2end/tests/disappearing_server.c
  57. 5
      test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c
  58. 2
      test/core/end2end/tests/early_server_shutdown_finishes_tags.c
  59. 5
      test/core/end2end/tests/invoke_large_request.c
  60. 13
      test/core/end2end/tests/max_concurrent_streams.c
  61. 2
      test/core/end2end/tests/no_op.c
  62. 5
      test/core/end2end/tests/ping_pong_streaming.c
  63. 2
      test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c
  64. 2
      test/core/end2end/tests/request_response_with_metadata_and_payload.c
  65. 5
      test/core/end2end/tests/request_response_with_payload.c
  66. 2
      test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c
  67. 2
      test/core/end2end/tests/request_with_large_metadata.c
  68. 2
      test/core/end2end/tests/request_with_payload.c
  69. 6
      test/core/end2end/tests/simple_delayed_request.c
  70. 8
      test/core/end2end/tests/simple_request.c
  71. 14
      test/core/end2end/tests/thread_stress.c
  72. 5
      test/core/end2end/tests/writes_done_hangs_with_pending_read.c
  73. 10
      test/core/fling/client.c
  74. 5
      test/core/fling/server.c
  75. 8
      test/core/httpcli/format_request_test.c
  76. 6
      test/core/iomgr/alarm_heap_test.c
  77. 6
      test/core/iomgr/alarm_list_test.c
  78. 2
      test/core/iomgr/alarm_test.c
  79. 4
      test/core/iomgr/fd_posix_test.c
  80. 16
      test/core/iomgr/resolve_address_test.c
  81. 8
      test/core/iomgr/sockaddr_utils_test.c
  82. 8
      test/core/iomgr/tcp_client_posix_test.c
  83. 4
      test/core/iomgr/tcp_posix_test.c
  84. 8
      test/core/iomgr/tcp_server_posix_test.c
  85. 16
      test/core/iomgr/time_averaged_stats_test.c
  86. 2
      test/core/network_benchmarks/low_level_ping_pong.c
  87. 2
      test/core/security/secure_endpoint_test.c
  88. 28
      test/core/statistics/census_log_tests.c
  89. 2
      test/core/statistics/census_stub_test.c
  90. 14
      test/core/statistics/hash_table_test.c
  91. 10
      test/core/statistics/rpc_stats_test.c
  92. 12
      test/core/statistics/trace_test.c
  93. 10
      test/core/statistics/window_stats_test.c
  94. 30
      test/core/support/cmdline_test.c
  95. 8
      test/core/support/histogram_test.c
  96. 4
      test/core/support/host_port_test.c
  97. 8
      test/core/support/slice_test.c
  98. 8
      test/core/support/string_test.c
  99. 2
      test/core/support/time_test.c
  100. 6
      test/core/surface/byte_buffer_reader_test.c
  101. Some files were not shown because too many files have changed in this diff Show More

2958
Makefile

File diff suppressed because one or more lines are too long

@ -422,8 +422,8 @@
"c++": true,
"secure": false,
"src": [
"src/compiler/cpp_plugin.cpp",
"src/compiler/cpp_generator.cpp"
"src/compiler/cpp_plugin.cc",
"src/compiler/cpp_generator.cc"
],
"headers": [
"src/compiler/cpp_generator.h",
@ -437,8 +437,8 @@
"c++": true,
"secure": false,
"src": [
"src/compiler/ruby_plugin.cpp",
"src/compiler/ruby_generator.cpp"
"src/compiler/ruby_plugin.cc",
"src/compiler/ruby_generator.cc"
],
"headers": [
"src/compiler/cpp_generator.h",

@ -232,12 +232,12 @@ typedef struct grpc_event {
} grpc_event;
/* Initialize the grpc library */
void grpc_init();
void grpc_init(void);
/* Shutdown the grpc library */
void grpc_shutdown();
void grpc_shutdown(void);
grpc_completion_queue *grpc_completion_queue_create();
grpc_completion_queue *grpc_completion_queue_create(void);
/* Blocks until an event is available, the completion queue is being shutdown,
or deadline is reached. Returns NULL on timeout, otherwise the event that
@ -325,22 +325,6 @@ grpc_call_error grpc_call_start_invoke(grpc_call *call,
void *metadata_read_tag,
void *finished_tag, gpr_uint32 flags);
/* DEPRECATED: users should use grpc_call_server_accept, and
grpc_call_server_end_initial_metadata instead now.
Accept an incoming RPC, binding a completion queue to it.
To be called after adding metadata to the call, but before sending
messages.
flags is a bit-field combination of the write flags defined above.
REQUIRES: Can be called at most once per call.
Can only be called on the server.
Produces a GRPC_FINISHED event with finished_tag when the call has been
completed (there may be other events for the call pending at this
time) */
grpc_call_error grpc_call_accept(grpc_call *call, grpc_completion_queue *cq,
void *finished_tag, gpr_uint32 flags);
/* Accept an incoming RPC, binding a completion queue to it.
To be called before sending or receiving messages.
REQUIRES: Can be called at most once per call.

@ -163,7 +163,7 @@ gpr_slice gpr_slice_split_tail(gpr_slice *s, size_t split);
Requires s intialized, split <= s.length */
gpr_slice gpr_slice_split_head(gpr_slice *s, size_t split);
gpr_slice gpr_empty_slice();
gpr_slice gpr_empty_slice(void);
/* Returns <0 if a < b, ==0 if a == b, >0 if a > b */
int gpr_slice_cmp(gpr_slice a, gpr_slice b);

@ -100,7 +100,7 @@ void grpc_alarm_list_init(gpr_timespec now) {
}
}
void grpc_alarm_list_shutdown() {
void grpc_alarm_list_shutdown(void) {
int i;
while (run_some_expired_alarms(NULL, gpr_inf_future, NULL, 0))
;
@ -360,7 +360,7 @@ int grpc_alarm_check(gpr_mu *drop_mu, gpr_timespec now, gpr_timespec *next) {
return run_some_expired_alarms(drop_mu, now, next, 1);
}
gpr_timespec grpc_alarm_list_next_timeout() {
gpr_timespec grpc_alarm_list_next_timeout(void) {
gpr_timespec out;
gpr_mu_lock(&g_mu);
out = g_shard_queue[0]->min_deadline;

@ -42,12 +42,12 @@
int grpc_alarm_check(gpr_mu *drop_mu, gpr_timespec now, gpr_timespec *next);
void grpc_alarm_list_init(gpr_timespec now);
void grpc_alarm_list_shutdown();
void grpc_alarm_list_shutdown(void);
gpr_timespec grpc_alarm_list_next_timeout();
gpr_timespec grpc_alarm_list_next_timeout(void);
/* the following must be implemented by each iomgr implementation */
void grpc_kick_poller();
void grpc_kick_poller(void);
#endif /* __GRPC_INTERNAL_IOMGR_ALARM_INTERNAL_H_ */

@ -80,9 +80,9 @@ static void background_callback_executor(void *ignored) {
gpr_event_set(&g_background_callback_executor_done, (void *)1);
}
void grpc_kick_poller() { gpr_cv_broadcast(&g_cv); }
void grpc_kick_poller(void) { gpr_cv_broadcast(&g_cv); }
void grpc_iomgr_init() {
void grpc_iomgr_init(void) {
gpr_thd_id id;
gpr_mu_init(&g_mu);
gpr_cv_init(&g_cv);
@ -93,7 +93,7 @@ void grpc_iomgr_init() {
gpr_thd_new(&id, background_callback_executor, NULL, NULL);
}
void grpc_iomgr_shutdown() {
void grpc_iomgr_shutdown(void) {
delayed_callback *cb;
gpr_timespec shutdown_deadline =
gpr_time_add(gpr_now(), gpr_time_from_seconds(10));
@ -134,13 +134,13 @@ void grpc_iomgr_shutdown() {
gpr_cv_destroy(&g_cv);
}
void grpc_iomgr_ref() {
void grpc_iomgr_ref(void) {
gpr_mu_lock(&g_mu);
++g_refs;
gpr_mu_unlock(&g_mu);
}
void grpc_iomgr_unref() {
void grpc_iomgr_unref(void) {
gpr_mu_lock(&g_mu);
if (0 == --g_refs) {
gpr_cv_signal(&g_cv);

@ -37,8 +37,8 @@
/* gRPC Callback definition */
typedef void (*grpc_iomgr_cb_func)(void *arg, int success);
void grpc_iomgr_init();
void grpc_iomgr_shutdown();
void grpc_iomgr_init(void);
void grpc_iomgr_shutdown(void);
/* This function is called from within a callback or from anywhere else
and causes the invocation of a callback at some point in the future */

@ -42,10 +42,10 @@ int grpc_maybe_call_delayed_callbacks(gpr_mu *drop_mu, int success);
void grpc_iomgr_add_delayed_callback(grpc_iomgr_cb_func cb, void *cb_arg,
int success);
void grpc_iomgr_ref();
void grpc_iomgr_unref();
void grpc_iomgr_ref(void);
void grpc_iomgr_unref(void);
void grpc_iomgr_platform_init();
void grpc_iomgr_platform_shutdown();
void grpc_iomgr_platform_init(void);
void grpc_iomgr_platform_shutdown(void);
#endif /* __GRPC_INTERNAL_IOMGR_IOMGR_INTERNAL_H_ */

@ -33,6 +33,6 @@
#include "src/core/iomgr/iomgr_posix.h"
void grpc_iomgr_platform_init() { grpc_pollset_global_init(); }
void grpc_iomgr_platform_init(void) { grpc_pollset_global_init(); }
void grpc_iomgr_platform_shutdown() { grpc_pollset_global_shutdown(); }
void grpc_iomgr_platform_shutdown(void) { grpc_pollset_global_shutdown(); }

@ -36,7 +36,7 @@
#include "src/core/iomgr/iomgr_internal.h"
void grpc_pollset_global_init();
void grpc_pollset_global_shutdown();
void grpc_pollset_global_init(void);
void grpc_pollset_global_shutdown(void);
#endif /* __GRPC_INTERNAL_IOMGR_IOMGR_POSIX_H_ */

@ -129,9 +129,9 @@ void grpc_kick_drain(grpc_pollset *p) {
/* global state management */
grpc_pollset *grpc_backup_pollset() { return &g_backup_pollset; }
grpc_pollset *grpc_backup_pollset(void) { return &g_backup_pollset; }
void grpc_pollset_global_init() {
void grpc_pollset_global_init(void) {
int i;
gpr_thd_id id;
@ -151,7 +151,7 @@ void grpc_pollset_global_init() {
gpr_thd_new(&id, backup_poller, NULL, NULL);
}
void grpc_pollset_global_shutdown() {
void grpc_pollset_global_shutdown(void) {
int i;
/* terminate the backup poller thread */

@ -86,7 +86,7 @@ void grpc_kick_drain(grpc_pollset *p);
regardless of applications listening to events. Relying on this is slow
however (the backup pollset only listens every 100ms or so) - so it's not
to be relied on. */
grpc_pollset *grpc_backup_pollset();
grpc_pollset *grpc_backup_pollset(void);
/* turn a pollset into a multipoller: platform specific */
void grpc_platform_become_multipoller(grpc_pollset *pollset,

@ -115,7 +115,7 @@ int grpc_set_socket_low_latency(int fd, int low_latency) {
static gpr_once g_probe_ipv6_once = GPR_ONCE_INIT;
static int g_ipv6_loopback_available;
static void probe_ipv6_once() {
static void probe_ipv6_once(void) {
int fd = socket(AF_INET6, SOCK_STREAM, 0);
g_ipv6_loopback_available = 0;
if (fd < 0) {
@ -135,7 +135,7 @@ static void probe_ipv6_once() {
}
}
int grpc_ipv6_loopback_available() {
int grpc_ipv6_loopback_available(void) {
gpr_once_init(&g_probe_ipv6_once, probe_ipv6_once);
return g_ipv6_loopback_available;
}

@ -61,7 +61,7 @@ int grpc_set_socket_low_latency(int fd, int low_latency);
and bind IPv6 sockets, but cannot connect to a getsockname() of [::]:port
without a valid loopback interface. Rather than expose this half-broken
state to library users, we turn off IPv6 sockets. */
int grpc_ipv6_loopback_available();
int grpc_ipv6_loopback_available(void);
/* An enum to keep track of IPv4/IPv6 socket modes.

@ -46,7 +46,7 @@ typedef struct grpc_tcp_server grpc_tcp_server;
typedef void (*grpc_tcp_server_cb)(void *arg, grpc_endpoint *ep);
/* Create a server, initially not bound to any ports */
grpc_tcp_server *grpc_tcp_server_create();
grpc_tcp_server *grpc_tcp_server_create(void);
/* Start listening to bound ports */
void grpc_tcp_server_start(grpc_tcp_server *server, grpc_pollset *pollset,

@ -84,7 +84,7 @@ struct grpc_tcp_server {
size_t port_capacity;
};
grpc_tcp_server *grpc_tcp_server_create() {
grpc_tcp_server *grpc_tcp_server_create(void) {
grpc_tcp_server *s = gpr_malloc(sizeof(grpc_tcp_server));
gpr_mu_init(&s->mu);
gpr_cv_init(&s->cv);
@ -120,7 +120,7 @@ void grpc_tcp_server_destroy(grpc_tcp_server *s) {
}
/* get max listen queue size on linux */
static void init_max_accept_queue_size() {
static void init_max_accept_queue_size(void) {
int n = SOMAXCONN;
char buf[64];
FILE *fp = fopen("/proc/sys/net/core/somaxconn", "r");
@ -147,7 +147,7 @@ static void init_max_accept_queue_size() {
}
}
static int get_max_accept_queue_size() {
static int get_max_accept_queue_size(void) {
gpr_once_init(&s_init_max_accept_queue_size, init_max_accept_queue_size);
return s_max_accept_queue_size;
}

@ -637,8 +637,8 @@ grpc_credentials *grpc_fake_transport_security_credentials_create(void) {
return c;
}
grpc_server_credentials *
grpc_fake_transport_security_server_credentials_create() {
grpc_server_credentials *grpc_fake_transport_security_server_credentials_create(
void) {
grpc_server_credentials *c = gpr_malloc(sizeof(grpc_server_credentials));
memset(c, 0, sizeof(grpc_server_credentials));
c->type = GRPC_CREDENTIALS_TYPE_FAKE_TRANSPORT_SECURITY;

@ -37,13 +37,13 @@
#include "src/core/statistics/census_rpc_stats.h"
#include "src/core/statistics/census_tracing.h"
void census_init() {
void census_init(void) {
gpr_log(GPR_INFO, "Initialize census library.");
census_tracing_init();
census_stats_store_init();
}
void census_shutdown() {
void census_shutdown(void) {
gpr_log(GPR_INFO, "Shutdown census library.");
census_stats_store_shutdown();
census_tracing_shutdown();

@ -49,10 +49,10 @@ typedef struct census_op_id {
typedef struct census_rpc_stats census_rpc_stats;
/* Initializes Census library. No-op if Census is already initialized. */
void census_init();
void census_init(void);
/* Shutdown Census Library. */
void census_shutdown();
void census_shutdown(void);
/* Annotates grpc method name on a census_op_id. The method name has the format
of <full quantified rpc service name>/<rpc function name>. Returns 0 iff
@ -68,7 +68,7 @@ int census_add_method_tag(census_op_id op_id, const char* method_name);
void census_tracing_print(census_op_id op_id, const char* annotation);
/* Starts tracing for an RPC. Returns a locally unique census_op_id */
census_op_id census_tracing_start_op();
census_op_id census_tracing_start_op(void);
/* Ends tracing. Calling this function will invalidate the input op_id. */
void census_tracing_end_op(census_op_id op_id);

@ -368,7 +368,7 @@ static void cl_block_end_read(cl_block* block) {
/* Allocates a new free block (or recycles an available dirty block if log is
configured to discard old records). Returns NULL if out-of-space. */
static cl_block* cl_allocate_block() {
static cl_block* cl_allocate_block(void) {
cl_block* block = cl_block_list_head(&g_log.free_block_list);
if (block != NULL) {
cl_block_list_remove(&g_log.free_block_list, block);
@ -496,7 +496,7 @@ void census_log_initialize(size_t size_in_mb, int discard_old_records) {
g_log.initialized = 1;
}
void census_log_shutdown() {
void census_log_shutdown(void) {
GPR_ASSERT(g_log.initialized);
gpr_mu_destroy(&g_log.lock);
gpr_free_aligned(g_log.core_local_blocks);
@ -551,7 +551,7 @@ void census_log_end_write(void* record, size_t bytes_written) {
cl_block_end_write(cl_get_block(record), bytes_written);
}
void census_log_init_reader() {
void census_log_init_reader(void) {
GPR_ASSERT(g_log.initialized);
gpr_mu_lock(&g_log.lock);
/* If a block is locked for reading unlock it. */
@ -584,7 +584,7 @@ const void* census_log_read_next(size_t* bytes_available) {
return NULL;
}
size_t census_log_remaining_space() {
size_t census_log_remaining_space(void) {
size_t space;
GPR_ASSERT(g_log.initialized);
gpr_mu_lock(&g_log.lock);
@ -598,7 +598,7 @@ size_t census_log_remaining_space() {
return space;
}
int census_log_out_of_space_count() {
int census_log_out_of_space_count(void) {
GPR_ASSERT(g_log.initialized);
return gpr_atm_acq_load(&g_log.out_of_space_count);
}

@ -53,7 +53,7 @@ void census_log_initialize(size_t size_in_mb, int discard_old_records);
- no in progress or future call to any census_log functions
- no incomplete records
*/
void census_log_shutdown();
void census_log_shutdown(void);
/* Allocates and returns a 'size' bytes record and marks it in use. A
subsequent census_log_end_write() marks the record complete. The
@ -74,7 +74,7 @@ void census_log_end_write(void* record, size_t bytes_written);
is read. census_log_init_reader() starts the iteration or aborts the
current iteration.
*/
void census_log_init_reader();
void census_log_init_reader(void);
const void* census_log_read_next(size_t* bytes_available);
/* Returns estimated remaining space across all blocks, in bytes. If log is
@ -82,10 +82,10 @@ const void* census_log_read_next(size_t* bytes_available);
returns space available in empty blocks (partially filled blocks are
treated as full).
*/
size_t census_log_remaining_space();
size_t census_log_remaining_space(void);
/* Returns the number of times gprc_stats_log_start_write() failed due to
out-of-space. */
int census_log_out_of_space_count();
int census_log_out_of_space_count(void);
#endif /* __GRPC_INTERNAL_STATISTICS_LOG_H__ */

@ -59,9 +59,9 @@ static gpr_mu g_mu;
static census_ht* g_client_stats_store = NULL;
static census_ht* g_server_stats_store = NULL;
static void init_mutex() { gpr_mu_init(&g_mu); }
static void init_mutex(void) { gpr_mu_init(&g_mu); }
static void init_mutex_once() {
static void init_mutex_once(void) {
gpr_once_init(&g_stats_store_mu_init, init_mutex);
}
@ -115,7 +115,7 @@ static gpr_timespec min_hour_total_intervals[3] = {
static const census_window_stats_stat_info window_stats_settings = {
sizeof(census_rpc_stats), init_rpc_stats, stat_add, stat_add_proportion};
census_rpc_stats* census_rpc_stats_create_empty() {
census_rpc_stats* census_rpc_stats_create_empty(void) {
census_rpc_stats* ret =
(census_rpc_stats*)gpr_malloc(sizeof(census_rpc_stats));
memset(ret, 0, sizeof(census_rpc_stats));
@ -220,7 +220,7 @@ void census_get_server_stats(census_aggregated_rpc_stats* data) {
get_stats(g_server_stats_store, data);
}
void census_stats_store_init() {
void census_stats_store_init(void) {
gpr_log(GPR_INFO, "Initialize census stats store.");
init_mutex_once();
gpr_mu_lock(&g_mu);
@ -233,7 +233,7 @@ void census_stats_store_init() {
gpr_mu_unlock(&g_mu);
}
void census_stats_store_shutdown() {
void census_stats_store_shutdown(void) {
gpr_log(GPR_INFO, "Shutdown census stats store.");
init_mutex_once();
gpr_mu_lock(&g_mu);

@ -53,7 +53,7 @@ struct census_rpc_stats {
};
/* Creates an empty rpc stats object on heap. */
census_rpc_stats* census_rpc_stats_create_empty();
census_rpc_stats* census_rpc_stats_create_empty(void);
typedef struct census_per_method_rpc_stats {
const char* method;
@ -91,8 +91,8 @@ void census_get_server_stats(census_aggregated_rpc_stats* data_map);
DO NOT CALL from outside of grpc code. */
void census_get_client_stats(census_aggregated_rpc_stats* data_map);
void census_stats_store_init();
void census_stats_store_shutdown();
void census_stats_store_init(void);
void census_stats_store_shutdown(void);
#ifdef __cplusplus
}

@ -93,11 +93,13 @@ static gpr_uint64 op_id_2_uint64(census_op_id* id) {
return ret;
}
static void init_mutex() { gpr_mu_init(&g_mu); }
static void init_mutex(void) { gpr_mu_init(&g_mu); }
static void init_mutex_once() { gpr_once_init(&g_init_mutex_once, init_mutex); }
static void init_mutex_once(void) {
gpr_once_init(&g_init_mutex_once, init_mutex);
}
census_op_id census_tracing_start_op() {
census_op_id census_tracing_start_op(void) {
gpr_mu_lock(&g_mu);
{
trace_obj* ret = (trace_obj*)gpr_malloc(sizeof(trace_obj));
@ -164,7 +166,7 @@ void census_tracing_end_op(census_op_id op_id) {
gpr_mu_unlock(&g_mu);
}
void census_tracing_init() {
void census_tracing_init(void) {
gpr_log(GPR_INFO, "Initialize census trace store.");
init_mutex_once();
gpr_mu_lock(&g_mu);
@ -177,7 +179,7 @@ void census_tracing_init() {
gpr_mu_unlock(&g_mu);
}
void census_tracing_shutdown() {
void census_tracing_shutdown(void) {
gpr_log(GPR_INFO, "Shutdown census trace store.");
gpr_mu_lock(&g_mu);
if (g_trace_store != NULL) {
@ -189,9 +191,9 @@ void census_tracing_shutdown() {
gpr_mu_unlock(&g_mu);
}
void census_internal_lock_trace_store() { gpr_mu_lock(&g_mu); }
void census_internal_lock_trace_store(void) { gpr_mu_lock(&g_mu); }
void census_internal_unlock_trace_store() { gpr_mu_unlock(&g_mu); }
void census_internal_unlock_trace_store(void) { gpr_mu_unlock(&g_mu); }
trace_obj* census_get_trace_obj_locked(census_op_id op_id) {
if (g_trace_store == NULL) {

@ -38,10 +38,10 @@
typedef struct trace_obj trace_obj;
/* Initializes trace store. This function is thread safe. */
void census_tracing_init();
void census_tracing_init(void);
/* Shutsdown trace store. This function is thread safe. */
void census_tracing_shutdown();
void census_tracing_shutdown(void);
/* Gets trace obj corresponding to the input op_id. Returns NULL if trace store
is not initialized or trace obj is not found. Requires trace store being
@ -50,8 +50,8 @@ trace_obj* census_get_trace_obj_locked(census_op_id op_id);
/* The following two functions acquire and release the trace store global lock.
They are for census internal use only. */
void census_internal_lock_trace_store();
void census_internal_unlock_trace_store();
void census_internal_lock_trace_store(void);
void census_internal_unlock_trace_store(void);
/* Gets method tag name associated with the input trace object. */
const char* census_get_trace_method_name(const trace_obj* trace);

@ -38,12 +38,12 @@
/* Return the number of CPU cores on the current system. Will return 0 if
if information is not available. */
int gpr_cpu_num_cores();
int gpr_cpu_num_cores(void);
/* Return the CPU on which the current thread is executing; N.B. This should
be considered advisory only - it is possible that the thread is switched
to a different CPU at any time. Returns a value in range
[0, gpr_cpu_num_cores() - 1] */
int gpr_cpu_current_cpu();
int gpr_cpu_current_cpu(void);
#endif /* __GRPC_INTERNAL_SUPPORT_CPU_H__ */

@ -75,7 +75,7 @@
#include <grpc/support/log.h>
int gpr_cpu_num_cores() {
int gpr_cpu_num_cores(void) {
static int ncpus = 0;
if (ncpus == 0) {
ncpus = sysconf(_SC_NPROCESSORS_ONLN);
@ -87,7 +87,7 @@ int gpr_cpu_num_cores() {
return ncpus;
}
int gpr_cpu_current_cpu() {
int gpr_cpu_current_cpu(void) {
int cpu = sched_getcpu();
if (cpu < 0) {
gpr_log(GPR_ERROR, "Error determining current CPU: %s\n", strerror(errno));

@ -45,7 +45,7 @@
static __thread char magic_thread_local;
int gpr_cpu_num_cores() {
int gpr_cpu_num_cores(void) {
static int ncpus = 0;
if (ncpus == 0) {
ncpus = sysconf(_SC_NPROCESSORS_ONLN);
@ -63,7 +63,7 @@ static size_t shard_ptr(const void *info) {
return ((x >> 4) ^ (x >> 9) ^ (x >> 14)) % gpr_cpu_num_cores();
}
int gpr_cpu_current_cpu() {
int gpr_cpu_current_cpu(void) {
/* NOTE: there's no way I know to return the actual cpu index portably...
most code that's using this is using it to shard across work queues though,
so here we use thread identity instead to achieve a similar though not

@ -47,7 +47,7 @@
#include <sys/syscall.h>
#include <unistd.h>
static long gettid() { return syscall(__NR_gettid); }
static long gettid(void) { return syscall(__NR_gettid); }
void gpr_log(const char *file, int line, gpr_log_severity severity,
const char *format, ...) {

@ -50,7 +50,7 @@
#include <time.h>
#include <pthread.h>
static gpr_intptr gettid() { return (gpr_intptr)pthread_self(); }
static gpr_intptr gettid(void) { return (gpr_intptr)pthread_self(); }
void gpr_log(const char *file, int line, gpr_log_severity severity,
const char *format, ...) {

@ -37,7 +37,7 @@
#include <string.h>
gpr_slice gpr_empty_slice() {
gpr_slice gpr_empty_slice(void) {
gpr_slice out;
out.refcount = 0;
out.data.inlined.length = 0;

@ -63,7 +63,7 @@ typedef struct {
char *data;
} hexout;
static hexout hexout_create() {
static hexout hexout_create(void) {
hexout r = {0, 0, NULL};
return r;
}

@ -535,17 +535,6 @@ grpc_call_error grpc_call_server_end_initial_metadata(grpc_call *call,
return GRPC_CALL_OK;
}
grpc_call_error grpc_call_accept(grpc_call *call, grpc_completion_queue *cq,
void *finished_tag, gpr_uint32 flags) {
grpc_call_error err;
err = grpc_call_server_accept(call, cq, finished_tag);
if (err != GRPC_CALL_OK) return err;
err = grpc_call_server_end_initial_metadata(call, flags);
if (err != GRPC_CALL_OK) return err;
return GRPC_CALL_OK;
}
static void done_writes_done(void *user_data, grpc_op_error error) {
grpc_call *call = user_data;
void *tag = call->write_tag;

@ -85,7 +85,7 @@ struct grpc_completion_queue {
/* Default do-nothing on_finish function */
static void null_on_finish(void *user_data, grpc_op_error error) {}
grpc_completion_queue *grpc_completion_queue_create() {
grpc_completion_queue *grpc_completion_queue_create(void) {
grpc_completion_queue *cc = gpr_malloc(sizeof(grpc_completion_queue));
memset(cc, 0, sizeof(*cc));
/* Initial ref is dropped by grpc_completion_queue_shutdown */
@ -251,7 +251,7 @@ void grpc_cq_end_new_rpc(grpc_completion_queue *cc, void *tag, grpc_call *call,
}
/* Create a GRPC_QUEUE_SHUTDOWN event without queuing it anywhere */
static event *create_shutdown_event() {
static event *create_shutdown_event(void) {
event *ev = gpr_malloc(sizeof(event));
ev->base.type = GRPC_QUEUE_SHUTDOWN;
ev->base.call = NULL;

@ -35,12 +35,12 @@
#include "src/core/statistics/census_interface.h"
#include "src/core/iomgr/iomgr.h"
void grpc_init() {
void grpc_init(void) {
grpc_iomgr_init();
census_init();
}
void grpc_shutdown() {
void grpc_shutdown(void) {
grpc_iomgr_shutdown();
census_shutdown();
}

@ -46,7 +46,7 @@ int grpc_chttp2_is_alpn_version_supported(const char *version, size_t size) {
return 0;
}
size_t grpc_chttp2_num_alpn_versions() {
size_t grpc_chttp2_num_alpn_versions(void) {
return GPR_ARRAY_SIZE(supported_versions);
}

@ -40,7 +40,7 @@
int grpc_chttp2_is_alpn_version_supported(const char *version, size_t size);
/* Returns the number of protocol versions to advertise */
size_t grpc_chttp2_num_alpn_versions();
size_t grpc_chttp2_num_alpn_versions(void);
/* Returns the protocol version at index i (0 <= i <
* grpc_chttp2_num_alpn_versions()) */

@ -102,7 +102,7 @@ gpr_slice grpc_chttp2_settings_create(gpr_uint32 *old, const gpr_uint32 *new,
return output;
}
gpr_slice grpc_chttp2_settings_ack_create() {
gpr_slice grpc_chttp2_settings_ack_create(void) {
gpr_slice output = gpr_slice_malloc(9);
fill_header(GPR_SLICE_START_PTR(output), 0, GRPC_CHTTP2_FLAG_ACK);
return output;

@ -88,7 +88,7 @@ extern const grpc_chttp2_setting_parameters
gpr_slice grpc_chttp2_settings_create(gpr_uint32 *old, const gpr_uint32 *new,
gpr_uint32 force_mask, size_t count);
/* Create an ack settings frame */
gpr_slice grpc_chttp2_settings_ack_create();
gpr_slice grpc_chttp2_settings_ack_create(void);
grpc_chttp2_parse_error grpc_chttp2_settings_parser_begin_frame(
grpc_chttp2_settings_parser *parser, gpr_uint32 length, gpr_uint8 flags,

@ -86,7 +86,7 @@ static unsigned char suffix_mask(unsigned char prefix_len) {
return ~prefix_mask(prefix_len);
}
static void generate_first_byte_lut() {
static void generate_first_byte_lut(void) {
int i, j, n;
const spec *chrspec;
unsigned char suffix;
@ -136,21 +136,21 @@ typedef struct { char included[GRPC_CHTTP2_NUM_HUFFSYMS]; } symset;
typedef struct { int values[16]; } nibblelut;
/* returns a symset that includes all possible symbols */
static symset symset_all() {
static symset symset_all(void) {
symset x;
memset(x.included, 1, sizeof(x.included));
return x;
}
/* returns a symset that includes no symbols */
static symset symset_none() {
static symset symset_none(void) {
symset x;
memset(x.included, 0, sizeof(x.included));
return x;
}
/* returns an empty nibblelut */
static nibblelut nibblelut_empty() {
static nibblelut nibblelut_empty(void) {
nibblelut x;
int i;
for (i = 0; i < 16; i++) {
@ -296,7 +296,7 @@ static void dump_ctbl(const char *name) {
printf("};\n");
}
static void generate_huff_tables() {
static void generate_huff_tables(void) {
int i;
build_dec_tbl(state_index(0, symset_all(), &i), 0, 0, 0, -1, symset_all());
@ -317,7 +317,7 @@ static void generate_huff_tables() {
dump_ctbl("emit_sub_tbl");
}
static void generate_base64_huff_encoder_table() {
static void generate_base64_huff_encoder_table(void) {
static const char alphabet[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int i;
@ -332,7 +332,7 @@ static void generate_base64_huff_encoder_table() {
printf("};\n");
}
static void generate_base64_inverse_table() {
static void generate_base64_inverse_table(void) {
static const char alphabet[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
unsigned char inverse[256];

@ -154,7 +154,7 @@ grpc_mdctx *grpc_mdctx_create_with_seed(gpr_uint32 seed) {
return ctx;
}
grpc_mdctx *grpc_mdctx_create() {
grpc_mdctx *grpc_mdctx_create(void) {
/* This seed is used to prevent remote connections from controlling hash table
* collisions. It needs to be somewhat unpredictable to a remote connection.
*/

@ -82,7 +82,7 @@ struct grpc_mdelem {
};
/* Create/orphan a metadata context */
grpc_mdctx *grpc_mdctx_create();
grpc_mdctx *grpc_mdctx_create(void);
grpc_mdctx *grpc_mdctx_create_with_seed(gpr_uint32 seed);
void grpc_mdctx_orphan(grpc_mdctx *mdctx);

@ -19,7 +19,7 @@ Gem::Specification.new do |s|
s.add_dependency 'xray'
s.add_dependency 'logging', '~> 1.8'
s.add_dependency 'google-protobuf', '~> 3.0.0alpha'
s.add_dependency 'google-protobuf', '~> 3.0.0alpha.1.1'
s.add_dependency 'minitest', '~> 5.4' # not a dev dependency, used by the interop tests
s.add_development_dependency "bundler", "~> 1.7"

@ -39,30 +39,48 @@ CPPFLAGS_dbg = -O0
LDFLAGS_dbg =
DEFINES_dbg = _DEBUG DEBUG
VALID_CONFIG_valgrind = 1
REQUIRE_CUSTOM_LIBRARIES_valgrind = 1
CC_valgrind = gcc
CXX_valgrind = g++
LD_valgrind = gcc
LDXX_valgrind = g++
CPPFLAGS_valgrind = -O0
OPENSSL_CFLAGS_valgrind = -DPURIFY
LDFLAGS_valgrind =
DEFINES_valgrind = _DEBUG DEBUG
VALID_CONFIG_tsan = 1
REQUIRE_CUSTOM_LIBRARIES_tsan = 1
CC_tsan = clang
CXX_tsan = clang++
LD_tsan = clang
LDXX_tsan = clang++
CPPFLAGS_tsan = -O1 -fsanitize=thread -fno-omit-frame-pointer
OPENSSL_CONFIG_tsan = no-asm
LDFLAGS_tsan = -fsanitize=thread
DEFINES_tsan = NDEBUG
VALID_CONFIG_asan = 1
REQUIRE_CUSTOM_LIBRARIES_asan = 1
CC_asan = clang
CXX_asan = clang++
LD_asan = clang
LDXX_asan = clang++
CPPFLAGS_asan = -O1 -fsanitize=address -fno-omit-frame-pointer
OPENSSL_CONFIG_asan = no-asm
LDFLAGS_asan = -fsanitize=address
DEFINES_asan = NDEBUG
VALID_CONFIG_msan = 1
REQUIRE_CUSTOM_LIBRARIES_msan = 1
CC_msan = clang
CXX_msan = clang++
LD_msan = clang
LDXX_msan = clang++
CPPFLAGS_msan = -O1 -fsanitize=memory -fno-omit-frame-pointer
OPENSSL_CFLAGS_msan = -DPURIFY
OPENSSL_CONFIG_msan = no-asm
LDFLAGS_msan = -fsanitize=memory
DEFINES_msan = NDEBUG
@ -172,8 +190,14 @@ endif
OPENSSL_ALPN_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o /dev/null test/build/openssl-alpn.c -lssl -lcrypto -ldl $(LDFLAGS)
ZLIB_CHECK_CMD = $(CC) $(CFLAGS) $(CPPFLAGS) -o /dev/null test/build/zlib.c -lz $(LDFLAGS)
ifndef REQUIRE_CUSTOM_LIBRARIES_$(CONFIG)
HAS_SYSTEM_OPENSSL_ALPN = $(shell $(OPENSSL_ALPN_CHECK_CMD) 2> /dev/null && echo true || echo false)
HAS_SYSTEM_ZLIB = $(shell $(ZLIB_CHECK_CMD) 2> /dev/null && echo true || echo false)
else
# override system libraries if the config requires a custom compiled library
HAS_SYSTEM_OPENSSL_ALPN = false
HAS_SYSTEM_ZLIB = false
endif
ifeq ($(wildcard third_party/openssl/ssl/ssl.h),)
HAS_EMBEDDED_OPENSSL_ALPN = false
@ -189,7 +213,7 @@ endif
ifeq ($(HAS_SYSTEM_ZLIB),false)
ifeq ($(HAS_EMBEDDED_ZLIB),true)
ZLIB_DEP = third_party/zlib/libz.a
ZLIB_DEP = libs/$(CONFIG)/zlib/libz.a
CPPFLAGS += -Ithird_party/zlib
LDFLAGS += -Lthird_party/zlib
else
@ -199,10 +223,10 @@ endif
ifeq ($(HAS_SYSTEM_OPENSSL_ALPN),false)
ifeq ($(HAS_EMBEDDED_OPENSSL_ALPN),true)
OPENSSL_DEP = third_party/openssl/libssl.a
OPENSSL_MERGE_LIBS += third_party/openssl/libssl.a third_party/openssl/libcrypto.a
OPENSSL_DEP = libs/$(CONFIG)/openssl/libssl.a
OPENSSL_MERGE_LIBS += libs/$(CONFIG)/openssl/libssl.a libs/$(CONFIG)/openssl/libcrypto.a
CPPFLAGS += -Ithird_party/openssl/include
LDFLAGS += -Lthird_party/openssl
LDFLAGS += -Llibs/$(CONFIG)/openssl
LIBS_SECURE = dl
else
NO_SECURE = true
@ -213,16 +237,19 @@ endif
LDLIBS_SECURE += $(addprefix -l, $(LIBS_SECURE))
ifneq ($(DEP_MISSING),)
NO_DEPS = true
endif
ifneq ($(MAKECMDGOALS),clean)
ifeq ($(MAKECMDGOALS),clean)
NO_DEPS = true
endif
.SECONDARY = %.pb.h %.pb.cc
PROTOC_PLUGINS=\
% for tgt in targets:
% if tgt.build == 'protoc':
bins/$(CONFIG)/${tgt.name}\
% endif
% endfor
ifeq ($(DEP_MISSING),)
all: static shared\
% for tgt in targets:
@ -290,17 +317,23 @@ run_dep_checks:
$(OPENSSL_ALPN_CHECK_CMD) || true
$(ZLIB_CHECK_CMD) || true
third_party/zlib/libz.a:
(cd third_party/zlib ; CFLAGS="-fPIC -fvisibility=hidden" ./configure --static)
libs/$(CONFIG)/zlib/libz.a:
(cd third_party/zlib ; CC="$(CC)" CFLAGS="-fPIC -fvisibility=hidden $(CPPFLAGS_$(CONFIG))" ./configure --static)
$(MAKE) -C third_party/zlib clean
$(MAKE) -C third_party/zlib
mkdir -p libs/$(CONFIG)/zlib
cp third_party/zlib/libz.a libs/$(CONFIG)/zlib
third_party/openssl/libssl.a:
(cd third_party/openssl ; CC="$(CC) -fPIC -fvisibility=hidden" ./config)
libs/$(CONFIG)/openssl/libssl.a:
(cd third_party/openssl ; CC="$(CC) -fPIC -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG))" ./config $(OPENSSL_CONFIG_$(CONFIG)))
$(MAKE) -C third_party/openssl clean
$(MAKE) -C third_party/openssl build_crypto build_ssl
mkdir -p libs/$(CONFIG)/openssl
cp third_party/openssl/libssl.a third_party/openssl/libcrypto.a libs/$(CONFIG)/openssl
static: static_c static_cxx
static_c: dep_c\
static_c: \
% for lib in libs:
% if lib.build == 'all' and not lib.get('c++', False):
libs/$(CONFIG)/lib${lib.name}.a\
@ -308,7 +341,7 @@ static_c: dep_c\
% endfor
static_cxx: dep_cxx\
static_cxx: \
% for lib in libs:
% if lib.build == 'all' and lib.get('c++', False):
libs/$(CONFIG)/lib${lib.name}.a\
@ -318,7 +351,7 @@ static_cxx: dep_cxx\
shared: shared_c shared_cxx
shared_c: dep_c\
shared_c: \
% for lib in libs:
% if lib.build == 'all' and not lib.get('c++', False):
libs/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)\
@ -326,7 +359,7 @@ shared_c: dep_c\
% endfor
shared_cxx: dep_cxx\
shared_cxx: \
% for lib in libs:
% if lib.build == 'all' and lib.get('c++', False):
libs/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)\
@ -336,7 +369,7 @@ shared_cxx: dep_cxx\
privatelibs: privatelibs_c privatelibs_cxx
privatelibs_c: dep_c\
privatelibs_c: \
% for lib in libs:
% if lib.build == 'private' and not lib.get('c++', False):
libs/$(CONFIG)/lib${lib.name}.a\
@ -344,7 +377,7 @@ privatelibs_c: dep_c\
% endfor
privatelibs_cxx: dep_cxx\
privatelibs_cxx: \
% for lib in libs:
% if lib.build == 'private' and lib.get('c++', False):
libs/$(CONFIG)/lib${lib.name}.a\
@ -354,7 +387,7 @@ privatelibs_cxx: dep_cxx\
buildtests: buildtests_c buildtests_cxx
buildtests_c: bins_dep_c privatelibs_c\
buildtests_c: privatelibs_c\
% for tgt in targets:
% if tgt.build == 'test' and not tgt.get('c++', False):
bins/$(CONFIG)/${tgt.name}\
@ -362,7 +395,7 @@ buildtests_c: bins_dep_c privatelibs_c\
% endfor
buildtests_cxx: bins_dep_cxx privatelibs_cxx\
buildtests_cxx: privatelibs_cxx\
% for tgt in targets:
% if tgt.build == 'test' and tgt.get('c++', False):
bins/$(CONFIG)/${tgt.name}\
@ -398,14 +431,6 @@ tools: privatelibs\
% endfor
protoc_plugins:\
% for tgt in targets:
% if tgt.build == 'protoc':
bins/$(CONFIG)/${tgt.name}\
% endif
% endfor
buildbenchmarks: privatelibs\
% for tgt in targets:
% if tgt.build == 'benchmark':
@ -463,79 +488,32 @@ strip-shared_cxx: shared_cxx
% endfor
% for p in protos:
deps/$(CONFIG)/gens/${p}.pb.dep:
$(Q) mkdir -p `dirname $@`
$(Q) touch $@
gens/${p}.pb.cc: ${p}.proto protoc_plugins
gens/${p}.pb.cc: ${p}.proto $(PROTOC_PLUGINS)
$(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(PROTOC) --cpp_out=gens --grpc_out=gens --plugin=protoc-gen-grpc=bins/$(CONFIG)/cpp_plugin $<
% endfor
deps/$(CONFIG)/%.dep : %.c
$(E) "[DEP] Generating dependencies for $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(CC) $(CFLAGS) $(CPPFLAGS_NO_ARCH) -MG -M $< > $@
deps/$(CONFIG)/%.dep : %.cc
$(E) "[DEP] Generating dependencies for $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(CXX) $(CXXFLAGS) $(CPPFLAGS_NO_ARCH) -MG -M $< > $@
objs/$(CONFIG)/%.o : %.c
$(E) "[C] Compiling $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
$(Q) $(CC) $(CFLAGS) $(CPPFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $<
objs/$(CONFIG)/%.o : gens/%.pb.cc
$(E) "[CXX] Compiling $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
$(Q) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $<
objs/$(CONFIG)/src/compiler/%.o : src/compiler/%.cc
$(E) "[HOSTCXX] Compiling $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(HOST_CXX) $(HOST_CXXFLAGS) $(HOST_CPPFLAGS) -c -o $@ $<
$(Q) $(HOST_CXX) $(HOST_CXXFLAGS) $(HOST_CPPFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $<
objs/$(CONFIG)/%.o : %.cc
$(E) "[CXX] Compiling $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
dep: dep_c dep_cxx
dep_c:\
% for lib in libs:
% if not lib.get('c++', False):
deps_lib${lib.name}\
% endif
% endfor
bins_dep_c:\
% for tgt in targets:
% if not tgt.get('c++', False):
deps_${tgt.name}\
% endif
% endfor
dep_cxx:\
% for lib in libs:
% if lib.get('c++', False):
deps_lib${lib.name}\
% endif
% endfor
bins_dep_cxx:\
% for tgt in targets:
% if tgt.get('c++', False):
deps_${tgt.name}\
% endif
% endfor
$(Q) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $<
install: install_c install_cxx
@ -624,15 +602,8 @@ ifneq ($(SYSTEM),Darwin)
endif
endif
clean:\
% for lib in libs:
clean_lib${lib.name}\
% endfor
% for tgt in targets:
clean_${tgt.name}\
% endfor
$(Q) $(RM) -r deps objs libs bins gens
clean:
$(Q) $(RM) -rf objs libs bins gens
# The various libraries
@ -671,7 +642,6 @@ PUBLIC_HEADERS_C += \\
% endif
LIB${lib.name.upper()}_OBJS = $(addprefix objs/$(CONFIG)/, $(addsuffix .o, $(basename $(LIB${lib.name.upper()}_SRC))))
LIB${lib.name.upper()}_DEPS = $(addprefix deps/$(CONFIG)/, $(addsuffix .dep, $(basename $(LIB${lib.name.upper()}_SRC))))
% if lib.get('secure', True):
ifeq ($(NO_SECURE),true)
@ -688,9 +658,9 @@ endif
else
libs/$(CONFIG)/lib${lib.name}.a: $(OPENSSL_DEP) $(LIB${lib.name.upper()}_OBJS)
libs/$(CONFIG)/lib${lib.name}.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(LIB${lib.name.upper()}_OBJS)
% else:
libs/$(CONFIG)/lib${lib.name}.a: $(LIB${lib.name.upper()}_OBJS)
libs/$(CONFIG)/lib${lib.name}.a: $(ZLIB_DEP) $(LIB${lib.name.upper()}_OBJS)
% endif
$(E) "[AR] Creating $@"
$(Q) mkdir -p `dirname $@`
@ -719,12 +689,12 @@ libs/$(CONFIG)/lib${lib.name}.a: $(LIB${lib.name.upper()}_OBJS)
common = '$(LIB' + lib.name.upper() + '_OBJS) $(LDLIBS)'
libs = ''
lib_deps = ''
lib_deps = ' $(ZLIB_DEP)'
mingw_libs = ''
mingw_lib_deps = ''
mingw_lib_deps = ' $(ZLIB_DEP)'
for dep in lib.get('deps', []):
libs = libs + ' -l' + dep
lib_deps = lib_deps + 'libs/$(CONFIG)/lib' + dep + '.$(SHARED_EXT)'
lib_deps = lib_deps + ' libs/$(CONFIG)/lib' + dep + '.$(SHARED_EXT)'
mingw_libs = mingw_libs + ' -l' + dep + '-imp'
mingw_lib_deps = mingw_lib_deps + 'libs/$(CONFIG)/' + dep + '.$(SHARED_EXT)'
@ -732,7 +702,6 @@ libs/$(CONFIG)/lib${lib.name}.a: $(LIB${lib.name.upper()}_OBJS)
common = common + ' $(LDLIBS_SECURE) $(OPENSSL_MERGE_LIBS)'
lib_deps = lib_deps + ' $(OPENSSL_DEP)'
mingw_lib_deps = mingw_lib_deps + ' $(OPENSSL_DEP)'
%>
% if lib.build == "all":
@ -759,13 +728,11 @@ endif
endif
% endif
deps_lib${lib.name}: $(LIB${lib.name.upper()}_DEPS)
% if lib.get('secure', True):
ifneq ($(NO_SECURE),true)
% endif
ifneq ($(NO_DEPS),true)
-include $(LIB${lib.name.upper()}_DEPS)
-include $(LIB${lib.name.upper()}_OBJS:.o=.dep)
endif
% if lib.get('secure', True):
endif
@ -782,13 +749,6 @@ objs/$(CONFIG)/${os.path.splitext(src)[0]}.o: \
% endif
% endfor
clean_lib${lib.name}:
$(E) "[CLEAN] Cleaning lib${lib.name} files"
$(Q) $(RM) $(LIB${lib.name.upper()}_OBJS)
$(Q) $(RM) $(LIB${lib.name.upper()}_DEPS)
$(Q) $(RM) libs/$(CONFIG)/lib${lib.name}.a
$(Q) $(RM) libs/$(CONFIG)/lib${lib.name}.$(SHARED_EXT)
</%def>
<%def name="maketarget(tgt)">
@ -800,7 +760,6 @@ ${tgt.name.upper()}_SRC = \\
% endfor
${tgt.name.upper()}_OBJS = $(addprefix objs/$(CONFIG)/, $(addsuffix .o, $(basename $(${tgt.name.upper()}_SRC))))
${tgt.name.upper()}_DEPS = $(addprefix deps/$(CONFIG)/, $(addsuffix .dep, $(basename $(${tgt.name.upper()}_SRC))))
% if tgt.get('secure', True):
ifeq ($(NO_SECURE),true)
@ -867,23 +826,17 @@ objs/$(CONFIG)/${os.path.splitext(src)[0]}.o: \
% endfor
deps_${tgt.name}: $(${tgt.name.upper()}_DEPS)
deps_${tgt.name}: $(${tgt.name.upper()}_OBJS:.o=.dep)
% if tgt.get('secure', True):
ifneq ($(NO_SECURE),true)
% endif
ifneq ($(NO_DEPS),true)
-include $(${tgt.name.upper()}_DEPS)
-include $(${tgt.name.upper()}_OBJS:.o=.dep)
endif
% if tgt.get('secure', True):
endif
% endif
clean_${tgt.name}:
$(E) "[CLEAN] Cleaning ${tgt.name} files"
$(Q) $(RM) $(${tgt.name.upper()}_OBJS)
$(Q) $(RM) $(${tgt.name.upper()}_DEPS)
$(Q) $(RM) bins/$(CONFIG)/${tgt.name}
</%def>
.PHONY: all strip tools \
@ -897,12 +850,6 @@ install-static install-static_c install-static_cxx \
strip strip-shared strip-static \
strip_c strip-shared_c strip-static_c \
strip_cxx strip-shared_cxx strip-static_cxx \
clean \
dep_c dep_cxx bins_dep_c bins_dep_cxx\
% for lib in libs:
deps_lib${lib.name} clean_lib${lib.name}\
% endfor
% for tgt in targets:
deps_${tgt.name} clean_${tgt.name}\
% endfor
dep_c dep_cxx bins_dep_c bins_dep_cxx \
clean

@ -76,7 +76,7 @@ static void channel_func(grpc_channel_element *elem,
++*(int *)(elem->channel_data);
}
static void test_create_channel_stack() {
static void test_create_channel_stack(void) {
const grpc_channel_filter filter = {
call_func, channel_func,

@ -145,7 +145,7 @@ static gpr_slice create_test_value(test_value id) {
return gpr_slice_from_copied_string("bad value");
}
static void test_bad_data() {
static void test_bad_data(void) {
gpr_slice_buffer input;
gpr_slice_buffer output;
int i;

@ -56,7 +56,7 @@ typedef struct {
gpr_intmax bytes_read;
} call_state;
static void request_call() {
static void request_call(void) {
call_state *tag = gpr_malloc(sizeof(*tag));
gpr_ref_init(&tag->pending_ops, 2);
tag->bytes_read = 0;
@ -124,7 +124,9 @@ int main(int argc, char **argv) {
case GRPC_SERVER_RPC_NEW:
if (ev->call != NULL) {
/* initial ops are already started in request_call */
grpc_call_accept(ev->call, cq, s, GRPC_WRITE_BUFFER_HINT);
grpc_call_server_accept(ev->call, cq, s);
grpc_call_server_end_initial_metadata(ev->call,
GRPC_WRITE_BUFFER_HINT);
GPR_ASSERT(grpc_call_start_read(ev->call, s) == GRPC_CALL_OK);
request_call();
} else {

@ -131,7 +131,8 @@ void test_connect(const char *server_host, const char *client_host, int port,
deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s, server_cq, tag(102), 0));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, server_cq, tag(102)));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0));
cq_expect_client_metadata_read(v_client, tag(2), NULL);
cq_verify(v_client);

@ -72,7 +72,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev;
@ -133,7 +133,8 @@ static void test_cancel_after_accept(grpc_end2end_test_config config,
deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s, f.server_cq, tag(102), 0));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102)));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0));
cq_expect_client_metadata_read(v_client, tag(2), NULL);
cq_verify(v_client);

@ -72,7 +72,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev;
@ -133,7 +133,8 @@ static void test_cancel_after_accept_and_writes_closed(
deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s, f.server_cq, tag(102), 0));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102)));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0));
cq_expect_client_metadata_read(v_client, tag(2), NULL);
cq_verify(v_client);

@ -72,7 +72,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev;

@ -68,7 +68,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev;

@ -70,7 +70,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev;

@ -122,7 +122,8 @@ static void test_body(grpc_end2end_test_fixture f) {
deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s, f.server_cq, tag(102), 0));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102)));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0));
cq_expect_client_metadata_read(v_client, tag(2), NULL);
cq_verify(v_client);

@ -52,7 +52,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev;
@ -115,7 +115,9 @@ static void do_request_and_shutdown_server(grpc_end2end_test_fixture *f,
deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s, f->server_cq, tag(102), 0));
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_server_accept(s, f->server_cq, tag(102)));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0));
cq_expect_client_metadata_read(v_client, tag(2), NULL);
cq_verify(v_client);

@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev;
@ -128,7 +128,8 @@ static void test_early_server_shutdown_finishes_inflight_calls(
deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s, f.server_cq, tag(102), 0));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102)));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0));
cq_expect_client_metadata_read(v_client, tag(2), NULL);
cq_verify(v_client);

@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev;

@ -100,7 +100,7 @@ static void end_test(grpc_end2end_test_fixture *f) {
grpc_completion_queue_destroy(f->client_cq);
}
static gpr_slice large_slice() {
static gpr_slice large_slice(void) {
gpr_slice slice = gpr_slice_malloc(1000000);
memset(GPR_SLICE_START_PTR(slice), 0xab, GPR_SLICE_LENGTH(slice));
return slice;
@ -143,7 +143,8 @@ static void test_invoke_large_request(grpc_end2end_test_config config) {
deadline, NULL);
cq_verify(v_server);
grpc_call_accept(s, f.server_cq, tag(102), 0);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102)));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0));
cq_expect_client_metadata_read(v_client, tag(2), NULL);
cq_verify(v_client);

@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev;
@ -126,7 +126,8 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s, f.server_cq, tag(102), 0));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102)));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0));
cq_expect_client_metadata_read(v_client, tag(2), NULL);
cq_verify(v_client);
@ -216,7 +217,9 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) {
"test.google.com", deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s1, f.server_cq, tag(102), 0));
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_server_accept(s1, f.server_cq, tag(102)));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s1, 0));
cq_expect_client_metadata_read(v_client, tag(live_call + 1), NULL);
cq_verify(v_client);
@ -246,7 +249,9 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) {
"test.google.com", deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s2, f.server_cq, tag(202), 0));
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_server_accept(s2, f.server_cq, tag(202)));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s2, 0));
cq_expect_client_metadata_read(v_client, tag(live_call + 1), NULL);
cq_verify(v_client);

@ -62,7 +62,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev;

@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev;
@ -130,7 +130,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config,
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
deadline, NULL);
cq_verify(v_server);
grpc_call_accept(s, f.server_cq, tag(102), 0);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102)));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0));
cq_expect_client_metadata_read(v_client, tag(2), NULL);
cq_verify(v_client);

@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev;

@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev;

@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev;
@ -141,7 +141,8 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) {
deadline, NULL);
cq_verify(v_server);
grpc_call_accept(s, f.server_cq, tag(102), 0);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102)));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0));
cq_expect_client_metadata_read(v_client, tag(2), NULL);
cq_verify(v_client);

@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev;

@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev;

@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev;

@ -52,7 +52,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev;
@ -124,7 +124,9 @@ static void simple_delayed_request_body(grpc_end2end_test_config config,
deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s, f->server_cq, tag(102), 0));
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_server_accept(s, f->server_cq, tag(102)));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0));
cq_expect_client_metadata_read(v_client, tag(2), NULL);
cq_verify(v_client);

@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev;
@ -126,7 +126,8 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s, f.server_cq, tag(102), 0));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102)));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0));
cq_expect_client_metadata_read(v_client, tag(2), NULL);
cq_verify(v_client);
@ -173,7 +174,8 @@ static void simple_request_body2(grpc_end2end_test_fixture f) {
deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(s, f.server_cq, tag(102), 0));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102)));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_write_status(
s, GRPC_STATUS_UNIMPLEMENTED, "xyz", tag(5)));

@ -56,7 +56,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
/* Drain pending events on a completion queue until it's ready to destroy.
Does some post-processing to safely release memory on some of the events. */
@ -105,7 +105,7 @@ static void drain_cq(int client, grpc_completion_queue *cq) {
}
/* Kick off a new request - assumes g_mu taken */
static void start_request() {
static void start_request(void) {
grpc_call *call = grpc_channel_create_call(
g_fixture.client, "/Foo", "test.google.com", g_test_end_time);
g_active_requests++;
@ -180,7 +180,7 @@ static void client_thread(void *p) {
/* Request a new server call. We tag them with a ref-count that starts at two,
and decrements after each of: a read completes and a write completes.
When it drops to zero, we write status */
static void request_server_call() {
static void request_server_call(void) {
gpr_refcount *rc = gpr_malloc(sizeof(gpr_refcount));
gpr_ref_init(rc, 2);
grpc_server_request_call(g_fixture.server, rc);
@ -218,9 +218,11 @@ static void server_thread(void *p) {
break;
case GRPC_SERVER_RPC_NEW:
if (ev->call) {
GPR_ASSERT(GRPC_CALL_OK == grpc_call_accept(ev->call,
g_fixture.server_cq,
ev->tag, 0));
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_server_accept(ev->call, g_fixture.server_cq,
ev->tag));
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_server_end_initial_metadata(ev->call, 0));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_read(ev->call, ev->tag));
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_start_write(ev->call, buf, ev->tag, 0));

@ -64,7 +64,7 @@ static gpr_timespec n_seconds_time(int n) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(GPR_US_PER_SEC * n));
}
static gpr_timespec five_seconds_time() { return n_seconds_time(5); }
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event *ev;
@ -145,7 +145,8 @@ static void test_writes_done_hangs_with_pending_read(
deadline, NULL);
cq_verify(v_server);
grpc_call_accept(s, f.server_cq, tag(102), 0);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_accept(s, f.server_cq, tag(102)));
GPR_ASSERT(GRPC_CALL_OK == grpc_call_server_end_initial_metadata(s, 0));
cq_expect_client_metadata_read(v_client, tag(2), NULL);
cq_verify(v_client);

@ -50,9 +50,9 @@ static grpc_channel *channel;
static grpc_completion_queue *cq;
static grpc_call *call;
static void init_ping_pong_request() {}
static void init_ping_pong_request(void) {}
static void step_ping_pong_request() {
static void step_ping_pong_request(void) {
call = grpc_channel_create_call(channel, "/Reflector/reflectUnary",
"localhost", gpr_inf_future);
GPR_ASSERT(grpc_call_start_invoke(call, cq, (void *)1, (void *)1, (void *)1,
@ -71,7 +71,7 @@ static void step_ping_pong_request() {
call = NULL;
}
static void init_ping_pong_stream() {
static void init_ping_pong_stream(void) {
call = grpc_channel_create_call(channel, "/Reflector/reflectStream",
"localhost", gpr_inf_future);
GPR_ASSERT(grpc_call_start_invoke(call, cq, (void *)1, (void *)1, (void *)1,
@ -80,7 +80,7 @@ static void init_ping_pong_stream() {
grpc_event_finish(grpc_completion_queue_next(cq, gpr_inf_future));
}
static void step_ping_pong_stream() {
static void step_ping_pong_stream(void) {
GPR_ASSERT(grpc_call_start_write(call, the_buffer, (void *)1, 0) ==
GRPC_CALL_OK);
GPR_ASSERT(grpc_call_start_read(call, (void *)1) == GRPC_CALL_OK);
@ -88,7 +88,7 @@ static void step_ping_pong_stream() {
grpc_event_finish(grpc_completion_queue_next(cq, gpr_inf_future));
}
static double now() {
static double now(void) {
gpr_timespec tv = gpr_now();
return 1e9 * tv.tv_sec + tv.tv_nsec;
}

@ -57,7 +57,7 @@ typedef struct {
gpr_uint32 flags;
} call_state;
static void request_call() {
static void request_call(void) {
call_state *s = gpr_malloc(sizeof(call_state));
gpr_ref_init(&s->pending_ops, 2);
grpc_server_request_call(server, s);
@ -130,7 +130,8 @@ int main(int argc, char **argv) {
} else {
s->flags = GRPC_WRITE_BUFFER_HINT;
}
grpc_call_accept(ev->call, cq, s, s->flags);
grpc_call_server_accept(ev->call, cq, s);
grpc_call_server_end_initial_metadata(ev->call, s->flags);
GPR_ASSERT(grpc_call_start_read(ev->call, s) == GRPC_CALL_OK);
request_call();
} else {

@ -38,7 +38,7 @@
#include <grpc/support/log.h>
#include "test/core/util/test_config.h"
static void test_format_get_request() {
static void test_format_get_request(void) {
grpc_httpcli_header hdr = {"x-yz", "abc"};
grpc_httpcli_request req;
gpr_slice slice;
@ -63,7 +63,7 @@ static void test_format_get_request() {
gpr_slice_unref(slice);
}
static void test_format_post_request() {
static void test_format_post_request(void) {
grpc_httpcli_header hdr = {"x-yz", "abc"};
grpc_httpcli_request req;
gpr_slice slice;
@ -93,7 +93,7 @@ static void test_format_post_request() {
gpr_slice_unref(slice);
}
static void test_format_post_request_no_body() {
static void test_format_post_request_no_body(void) {
grpc_httpcli_header hdr = {"x-yz", "abc"};
grpc_httpcli_request req;
gpr_slice slice;
@ -118,7 +118,7 @@ static void test_format_post_request_no_body() {
gpr_slice_unref(slice);
}
static void test_format_post_request_content_type_override() {
static void test_format_post_request_content_type_override(void) {
grpc_httpcli_header hdrs[2];
grpc_httpcli_request req;
gpr_slice slice;

@ -40,7 +40,7 @@
#include <grpc/support/log.h>
#include "test/core/util/test_config.h"
static gpr_timespec random_deadline() {
static gpr_timespec random_deadline(void) {
gpr_timespec ts;
ts.tv_sec = rand();
ts.tv_nsec = rand();
@ -150,7 +150,7 @@ static void check_valid(grpc_alarm_heap *pq) {
}
}
static void test1() {
static void test1(void) {
grpc_alarm_heap pq;
const int num_test_elements = 200;
const int num_test_operations = 10000;
@ -206,7 +206,7 @@ static void test1() {
gpr_free(inpq);
}
static void shrink_test() {
static void shrink_test(void) {
grpc_alarm_heap pq;
int i;
int expected_size;

@ -44,13 +44,13 @@
static int cb_called[MAX_CB][2];
static int kicks;
void grpc_kick_poller() { ++kicks; }
void grpc_kick_poller(void) { ++kicks; }
static void cb(void *arg, int success) {
cb_called[(gpr_intptr)arg][success]++;
}
static void add_test() {
static void add_test(void) {
gpr_timespec start = gpr_now();
int i;
grpc_alarm alarms[20];
@ -108,7 +108,7 @@ static void add_test() {
}
/* Cleaning up a list with pending alarms. */
void destruction_test() {
void destruction_test(void) {
grpc_alarm alarms[5];
grpc_alarm_list_init(gpr_time_0);

@ -89,7 +89,7 @@ static void alarm_cb(void *arg /* alarm_arg */, int success) {
}
/* Test grpc_alarm add and cancel. */
static void test_grpc_alarm() {
static void test_grpc_alarm(void) {
grpc_alarm alarm;
grpc_alarm alarm_to_cancel;
/* Timeout on the alarm cond. var, so make big enough to absorb time

@ -349,7 +349,7 @@ static void client_wait_and_shutdown(client *cl) {
/* Test grpc_fd. Start an upload server and client, upload a stream of
bytes from the client to the server, and verify that the total number of
sent bytes is equal to the total number of received bytes. */
static void test_grpc_fd() {
static void test_grpc_fd(void) {
server sv;
client cl;
int port;
@ -403,7 +403,7 @@ static void second_read_callback(void *arg /* fd_change_data */, int success) {
Note that we have two different but almost identical callbacks above -- the
point is to have two different function pointers and two different data
pointers and make sure that changing both really works. */
static void test_grpc_fd_change() {
static void test_grpc_fd_change(void) {
grpc_fd *em_fd;
fd_change_data a, b;
int flags;

@ -37,7 +37,7 @@
#include <grpc/support/time.h>
#include "test/core/util/test_config.h"
static gpr_timespec test_deadline() {
static gpr_timespec test_deadline(void) {
return gpr_time_add(gpr_now(), gpr_time_from_micros(100000000));
}
@ -53,35 +53,35 @@ static void must_fail(void* evp, grpc_resolved_addresses* p) {
gpr_event_set(evp, (void*)1);
}
static void test_localhost() {
static void test_localhost(void) {
gpr_event ev;
gpr_event_init(&ev);
grpc_resolve_address("localhost:1", NULL, must_succeed, &ev);
GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
}
static void test_default_port() {
static void test_default_port(void) {
gpr_event ev;
gpr_event_init(&ev);
grpc_resolve_address("localhost", "1", must_succeed, &ev);
GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
}
static void test_missing_default_port() {
static void test_missing_default_port(void) {
gpr_event ev;
gpr_event_init(&ev);
grpc_resolve_address("localhost", NULL, must_fail, &ev);
GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
}
static void test_ipv6_with_port() {
static void test_ipv6_with_port(void) {
gpr_event ev;
gpr_event_init(&ev);
grpc_resolve_address("[2001:db8::1]:1", NULL, must_succeed, &ev);
GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
}
static void test_ipv6_without_port() {
static void test_ipv6_without_port(void) {
const char* const kCases[] = {
"2001:db8::1", "2001:db8::1.2.3.4", "[2001:db8::1]",
};
@ -94,7 +94,7 @@ static void test_ipv6_without_port() {
}
}
static void test_invalid_ip_addresses() {
static void test_invalid_ip_addresses(void) {
const char* const kCases[] = {
"293.283.1238.3:1", "[2001:db8::11111]:1",
};
@ -107,7 +107,7 @@ static void test_invalid_ip_addresses() {
}
}
static void test_unparseable_hostports() {
static void test_unparseable_hostports(void) {
const char* const kCases[] = {
"[", "[::1", "[::1]bad", "[1.2.3.4]", "[localhost]", "[localhost]:1",
};

@ -70,7 +70,7 @@ static const gpr_uint8 kIPv4[] = {192, 0, 2, 1};
static const gpr_uint8 kIPv6[] = {0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1};
static void test_sockaddr_is_v4mapped() {
static void test_sockaddr_is_v4mapped(void) {
struct sockaddr_in input4;
struct sockaddr_in6 input6;
struct sockaddr_in output4;
@ -101,7 +101,7 @@ static void test_sockaddr_is_v4mapped() {
!grpc_sockaddr_is_v4mapped((const struct sockaddr *)&input4, NULL));
}
static void test_sockaddr_to_v4mapped() {
static void test_sockaddr_to_v4mapped(void) {
struct sockaddr_in input4;
struct sockaddr_in6 input6;
struct sockaddr_in6 output6;
@ -129,7 +129,7 @@ static void test_sockaddr_to_v4mapped() {
!grpc_sockaddr_to_v4mapped((const struct sockaddr *)&input6, &output6));
}
static void test_sockaddr_is_wildcard() {
static void test_sockaddr_is_wildcard(void) {
struct sockaddr_in wild4;
struct sockaddr_in6 wild6;
struct sockaddr_in6 wild_mapped;
@ -187,7 +187,7 @@ static void expect_sockaddr_str(const char *expected, void *addr,
gpr_free(str);
}
static void test_sockaddr_to_string() {
static void test_sockaddr_to_string(void) {
struct sockaddr_in input4;
struct sockaddr_in6 input6;
struct sockaddr dummy;

@ -43,7 +43,7 @@
#include <grpc/support/log.h>
#include <grpc/support/time.h>
static gpr_timespec test_deadline() {
static gpr_timespec test_deadline(void) {
return gpr_time_add(gpr_now(), gpr_time_from_seconds(10));
}
@ -59,7 +59,7 @@ static void must_fail(void *arg, grpc_endpoint *tcp) {
gpr_event_set(arg, (void *)1);
}
void test_succeeds() {
void test_succeeds(void) {
struct sockaddr_in addr;
socklen_t addr_len = sizeof(addr);
int svr_fd;
@ -94,7 +94,7 @@ void test_succeeds() {
GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
}
void test_fails() {
void test_fails(void) {
struct sockaddr_in addr;
socklen_t addr_len = sizeof(addr);
gpr_event ev;
@ -112,7 +112,7 @@ void test_fails() {
GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
}
void test_times_out() {
void test_times_out(void) {
struct sockaddr_in addr;
socklen_t addr_len = sizeof(addr);
int svr_fd;

@ -444,7 +444,7 @@ static void write_error_test(ssize_t num_bytes, ssize_t slice_size) {
free(slices);
}
void run_tests() {
void run_tests(void) {
int i = 0;
read_test(100, 8192);
@ -469,7 +469,7 @@ void run_tests() {
}
}
static void clean_up() {}
static void clean_up(void) {}
static grpc_endpoint_test_fixture create_fixture_tcp_socketpair(
size_t slice_size) {

@ -58,19 +58,19 @@ static void on_connect(void *arg, grpc_endpoint *tcp) {
gpr_mu_unlock(&mu);
}
static void test_no_op() {
static void test_no_op(void) {
grpc_tcp_server *s = grpc_tcp_server_create();
grpc_tcp_server_destroy(s);
}
static void test_no_op_with_start() {
static void test_no_op_with_start(void) {
grpc_tcp_server *s = grpc_tcp_server_create();
LOG_TEST();
grpc_tcp_server_start(s, NULL, on_connect, NULL);
grpc_tcp_server_destroy(s);
}
static void test_no_op_with_port() {
static void test_no_op_with_port(void) {
struct sockaddr_in addr;
grpc_tcp_server *s = grpc_tcp_server_create();
LOG_TEST();
@ -83,7 +83,7 @@ static void test_no_op_with_port() {
grpc_tcp_server_destroy(s);
}
static void test_no_op_with_port_and_start() {
static void test_no_op_with_port_and_start(void) {
struct sockaddr_in addr;
grpc_tcp_server *s = grpc_tcp_server_create();
LOG_TEST();

@ -41,7 +41,7 @@
#define EXPECT_EQ(a, b) GPR_ASSERT((a) == (b))
#define EXPECT_DOUBLE_EQ(a, b) GPR_ASSERT(fabs((a) - (b)) < 1e-9)
static void no_regress_no_persist_test_1() {
static void no_regress_no_persist_test_1(void) {
grpc_time_averaged_stats tas;
grpc_time_averaged_stats_init(&tas, 1000, 0, 0.0);
EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg);
@ -59,7 +59,7 @@ static void no_regress_no_persist_test_1() {
EXPECT_DOUBLE_EQ(1, tas.aggregate_total_weight);
}
static void no_regress_no_persist_test_2() {
static void no_regress_no_persist_test_2(void) {
grpc_time_averaged_stats tas;
grpc_time_averaged_stats_init(&tas, 1000, 0, 0.0);
EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg);
@ -75,7 +75,7 @@ static void no_regress_no_persist_test_2() {
EXPECT_DOUBLE_EQ(1, tas.aggregate_total_weight);
}
static void no_regress_no_persist_test_3() {
static void no_regress_no_persist_test_3(void) {
grpc_time_averaged_stats tas;
grpc_time_averaged_stats_init(&tas, 1000, 0, 0.0);
EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg);
@ -92,7 +92,7 @@ static void no_regress_no_persist_test_3() {
EXPECT_DOUBLE_EQ(2, tas.aggregate_total_weight);
}
static void some_regress_no_persist_test() {
static void some_regress_no_persist_test(void) {
grpc_time_averaged_stats tas;
grpc_time_averaged_stats_init(&tas, 1000, 0.5, 0.0);
EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg);
@ -105,7 +105,7 @@ static void some_regress_no_persist_test() {
EXPECT_DOUBLE_EQ(2.5, tas.aggregate_total_weight);
}
static void some_decay_test() {
static void some_decay_test(void) {
grpc_time_averaged_stats tas;
grpc_time_averaged_stats_init(&tas, 1000, 1, 0.0);
EXPECT_EQ(1000, tas.aggregate_weighted_avg);
@ -126,7 +126,7 @@ static void some_decay_test() {
EXPECT_DOUBLE_EQ(2, tas.aggregate_total_weight);
}
static void no_regress_full_persist_test() {
static void no_regress_full_persist_test(void) {
grpc_time_averaged_stats tas;
grpc_time_averaged_stats_init(&tas, 1000, 0, 1.0);
EXPECT_DOUBLE_EQ(1000, tas.aggregate_weighted_avg);
@ -146,7 +146,7 @@ static void no_regress_full_persist_test() {
EXPECT_DOUBLE_EQ(3, tas.aggregate_total_weight);
}
static void no_regress_some_persist_test() {
static void no_regress_some_persist_test(void) {
grpc_time_averaged_stats tas;
grpc_time_averaged_stats_init(&tas, 1000, 0, 0.5);
/* Should replace init value */
@ -162,7 +162,7 @@ static void no_regress_some_persist_test() {
EXPECT_DOUBLE_EQ(2.5, tas.aggregate_total_weight);
}
static void some_regress_some_persist_test() {
static void some_regress_some_persist_test(void) {
grpc_time_averaged_stats tas;
grpc_time_averaged_stats_init(&tas, 1000, 0.4, 0.6);
/* Sample weight = 0 */

@ -293,7 +293,7 @@ static void print_histogram(gpr_histogram *histogram) {
gpr_histogram_percentile(histogram, 99.9));
}
static double now() {
static double now(void) {
gpr_timespec tv = gpr_now();
return 1e9 * tv.tv_sec + tv.tv_nsec;
}

@ -125,7 +125,7 @@ secure_endpoint_create_fixture_tcp_socketpair_leftover(size_t slice_size) {
return f;
}
static void clean_up() {}
static void clean_up(void) {}
static grpc_endpoint_test_config configs[] = {
{"secure_ep/tcp_socketpair",

@ -114,7 +114,7 @@ static size_t perform_read_iteration(size_t record_size) {
}
/* Asserts that the log is empty. */
static void assert_log_empty() {
static void assert_log_empty(void) {
size_t bytes_available;
census_log_init_reader();
GPR_ASSERT(census_log_read_next(&bytes_available) == NULL);
@ -345,7 +345,7 @@ static void setup_test(int circular_log) {
/* Attempts to create a record of invalid size (size >
CENSUS_LOG_MAX_RECORD_SIZE). */
void test_invalid_record_size() {
void test_invalid_record_size(void) {
static const size_t INVALID_SIZE = CENSUS_LOG_MAX_RECORD_SIZE + 1;
static const size_t VALID_SIZE = 1;
void* record;
@ -368,7 +368,7 @@ void test_invalid_record_size() {
/* Tests end_write() with a different size than what was specified in
start_write(). */
void test_end_write_with_different_size() {
void test_end_write_with_different_size(void) {
static const size_t START_WRITE_SIZE = 10;
static const size_t END_WRITE_SIZE = 7;
void* record_written;
@ -388,7 +388,7 @@ void test_end_write_with_different_size() {
}
/* Verifies that pending records are not available via read_next(). */
void test_read_pending_record() {
void test_read_pending_record(void) {
static const size_t PR_RECORD_SIZE = 1024;
size_t bytes_available;
const void* record_read;
@ -413,7 +413,7 @@ void test_read_pending_record() {
}
/* Tries reading beyond pending write. */
void test_read_beyond_pending_record() {
void test_read_beyond_pending_record(void) {
/* Start a write. */
gpr_int32 incomplete_record_size = 10;
gpr_int32 complete_record_size = 20;
@ -452,7 +452,7 @@ void test_read_beyond_pending_record() {
/* Tests scenario where block being read is detached from a core and put on the
dirty list. */
void test_detached_while_reading() {
void test_detached_while_reading(void) {
static const size_t DWR_RECORD_SIZE = 10;
size_t bytes_available;
const void* record_read;
@ -488,7 +488,7 @@ void test_detached_while_reading() {
/* Fills non-circular log with records sized such that size is a multiple of
CENSUS_LOG_MAX_RECORD_SIZE (no per-block fragmentation). */
void test_fill_log_no_fragmentation() {
void test_fill_log_no_fragmentation(void) {
const int circular = 0;
printf("Starting test: fill log no fragmentation\n");
setup_test(circular);
@ -498,7 +498,7 @@ void test_fill_log_no_fragmentation() {
/* Fills circular log with records sized such that size is a multiple of
CENSUS_LOG_MAX_RECORD_SIZE (no per-block fragmentation). */
void test_fill_circular_log_no_fragmentation() {
void test_fill_circular_log_no_fragmentation(void) {
const int circular = 1;
printf("Starting test: fill circular log no fragmentation\n");
setup_test(circular);
@ -507,7 +507,7 @@ void test_fill_circular_log_no_fragmentation() {
}
/* Fills non-circular log with records that may straddle end of a block. */
void test_fill_log_with_straddling_records() {
void test_fill_log_with_straddling_records(void) {
const int circular = 0;
printf("Starting test: fill log with straddling records\n");
setup_test(circular);
@ -516,7 +516,7 @@ void test_fill_log_with_straddling_records() {
}
/* Fills circular log with records that may straddle end of a block. */
void test_fill_circular_log_with_straddling_records() {
void test_fill_circular_log_with_straddling_records(void) {
const int circular = 1;
printf("Starting test: fill circular log with straddling records\n");
setup_test(circular);
@ -526,7 +526,7 @@ void test_fill_circular_log_with_straddling_records() {
/* Tests scenario where multiple writers and a single reader are using a log
that is configured to discard old records. */
void test_multiple_writers_circular_log() {
void test_multiple_writers_circular_log(void) {
const int circular = 1;
printf("Starting test: multiple writers circular log\n");
setup_test(circular);
@ -536,7 +536,7 @@ void test_multiple_writers_circular_log() {
/* Tests scenario where multiple writers and a single reader are using a log
that is configured to discard old records. */
void test_multiple_writers() {
void test_multiple_writers(void) {
const int circular = 0;
printf("Starting test: multiple writers\n");
setup_test(circular);
@ -545,7 +545,7 @@ void test_multiple_writers() {
}
/* Repeat the straddling records and multiple writers tests with a small log. */
void test_small_log() {
void test_small_log(void) {
size_t log_size;
const int circular = 0;
printf("Starting test: small log\n");
@ -559,7 +559,7 @@ void test_small_log() {
census_log_shutdown();
}
void test_performance() {
void test_performance(void) {
int write_size = 1;
for (; write_size < CENSUS_LOG_MAX_RECORD_SIZE; write_size *= 2) {
gpr_timespec write_time;

@ -41,7 +41,7 @@
#include "test/core/util/test_config.h"
/* Tests census noop stubs in a simulated rpc flow */
void test_census_stubs() {
void test_census_stubs(void) {
census_op_id op_id;
census_rpc_stats* stats = census_rpc_stats_create_empty();
census_aggregated_rpc_stats data_map = {0, NULL};

@ -61,7 +61,7 @@ static gpr_uint64 force_collision(const void* k) {
static void free_data(void* data) { gpr_free(data); }
/* Basic tests that empty hash table can be created and destroyed. */
static void test_create_table() {
static void test_create_table(void) {
/* Create table with uint64 key type */
census_ht* ht = NULL;
census_ht_option ht_options = {CENSUS_HT_UINT64, 1999, NULL, NULL, NULL,
@ -81,7 +81,7 @@ static void test_create_table() {
census_ht_destroy(ht);
}
static void test_table_with_int_key() {
static void test_table_with_int_key(void) {
census_ht_option opt = {CENSUS_HT_UINT64, 7, NULL, NULL, NULL, NULL};
census_ht* ht = census_ht_create(&opt);
gpr_uint64 i = 0;
@ -118,7 +118,7 @@ static void test_table_with_int_key() {
}
/* Test that there is no memory leak when keys and values are owned by table. */
static void test_value_and_key_deleter() {
static void test_value_and_key_deleter(void) {
census_ht_option opt = {CENSUS_HT_POINTER, 7, &hash64, &cmp_str_keys,
&free_data, &free_data};
census_ht* ht = census_ht_create(&opt);
@ -148,7 +148,7 @@ static void test_value_and_key_deleter() {
}
/* Test simple insert and erase operations. */
static void test_simple_add_and_erase() {
static void test_simple_add_and_erase(void) {
census_ht_option opt = {CENSUS_HT_UINT64, 7, NULL, NULL, NULL, NULL};
census_ht* ht = census_ht_create(&opt);
GPR_ASSERT(ht != NULL);
@ -183,7 +183,7 @@ static void test_simple_add_and_erase() {
census_ht_destroy(ht);
}
static void test_insertion_and_deletion_with_high_collision_rate() {
static void test_insertion_and_deletion_with_high_collision_rate(void) {
census_ht_option opt = {CENSUS_HT_POINTER, 13, &force_collision,
&cmp_str_keys, NULL, NULL};
census_ht* ht = census_ht_create(&opt);
@ -207,7 +207,7 @@ static void test_insertion_and_deletion_with_high_collision_rate() {
census_ht_destroy(ht);
}
static void test_table_with_string_key() {
static void test_table_with_string_key(void) {
census_ht_option opt = {CENSUS_HT_POINTER, 7, &hash64, &cmp_str_keys, NULL,
NULL};
census_ht* ht = census_ht_create(&opt);
@ -258,7 +258,7 @@ static void test_table_with_string_key() {
census_ht_destroy(ht);
}
static void test_insertion_with_same_key() {
static void test_insertion_with_same_key(void) {
census_ht_option opt = {CENSUS_HT_UINT64, 11, NULL, NULL, NULL, NULL};
census_ht* ht = census_ht_create(&opt);
census_ht_key key;

@ -45,7 +45,7 @@
#include "test/core/util/test_config.h"
/* Ensure all possible state transitions are called without causing problem */
static void test_init_shutdown() {
static void test_init_shutdown(void) {
census_stats_store_init();
census_stats_store_init();
census_stats_store_shutdown();
@ -53,7 +53,7 @@ static void test_init_shutdown() {
census_stats_store_init();
}
static void test_create_and_destroy() {
static void test_create_and_destroy(void) {
census_rpc_stats* stats = NULL;
census_aggregated_rpc_stats agg_stats = {0, NULL};
@ -80,7 +80,7 @@ static void test_create_and_destroy() {
#define ASSERT_NEAR(a, b) \
GPR_ASSERT((a - b) * (a - b) < 1e-24 * (a + b) * (a + b))
static void test_record_and_get_stats() {
static void test_record_and_get_stats(void) {
census_rpc_stats stats = {1, 2, 3, 4, 5.1, 6.2, 7.3, 8.4};
census_op_id id;
census_aggregated_rpc_stats agg_stats = {0, NULL};
@ -149,7 +149,7 @@ static void test_record_and_get_stats() {
census_shutdown();
}
static void test_record_stats_on_unknown_op_id() {
static void test_record_stats_on_unknown_op_id(void) {
census_op_id unknown_id = {0xDEAD, 0xBEEF};
census_rpc_stats stats = {1, 2, 3, 4, 5.1, 6.2, 7.3, 8.4};
census_aggregated_rpc_stats agg_stats = {0, NULL};
@ -169,7 +169,7 @@ static void test_record_stats_on_unknown_op_id() {
}
/* Test that record stats is noop when trace store is uninitialized. */
static void test_record_stats_with_trace_store_uninitialized() {
static void test_record_stats_with_trace_store_uninitialized(void) {
census_rpc_stats stats = {1, 2, 3, 4, 5.1, 6.2, 7.3, 8.4};
census_op_id id = {0, 0};
census_aggregated_rpc_stats agg_stats = {0, NULL};

@ -45,7 +45,7 @@
#include "test/core/util/test_config.h"
/* Ensure all possible state transitions are called without causing problem */
static void test_init_shutdown() {
static void test_init_shutdown(void) {
census_tracing_init();
census_tracing_init();
census_tracing_shutdown();
@ -53,7 +53,7 @@ static void test_init_shutdown() {
census_tracing_init();
}
static void test_start_op_generates_locally_unique_ids() {
static void test_start_op_generates_locally_unique_ids(void) {
/* Check that ids generated within window size of 1000 are unique.
TODO(hongyu): Replace O(n^2) duplicate detection algorithm with O(nlogn)
algorithm. Enhance the test to larger window size (>10^6) */
@ -75,7 +75,7 @@ static void test_start_op_generates_locally_unique_ids() {
census_shutdown();
}
static void test_get_trace_method_name() {
static void test_get_trace_method_name(void) {
census_op_id id;
const char write_name[] = "service/method";
census_tracing_init();
@ -119,7 +119,7 @@ static void mimic_trace_op_sequences(void* arg) {
gpr_mu_unlock(&args->mu);
}
static void test_concurrency() {
static void test_concurrency(void) {
#define NUM_THREADS 1000
gpr_thd_id tid[NUM_THREADS];
int i = 0;
@ -141,7 +141,7 @@ static void test_concurrency() {
#undef NUM_THREADS
}
static void test_add_method_tag_to_unknown_op_id() {
static void test_add_method_tag_to_unknown_op_id(void) {
census_op_id unknown_id = {0xDEAD, 0xBEEF};
int ret = 0;
census_tracing_init();
@ -150,7 +150,7 @@ static void test_add_method_tag_to_unknown_op_id() {
census_tracing_shutdown();
}
static void test_trace_print() {
static void test_trace_print(void) {
census_op_id id;
int i;
const char* annotation_txt[4] = {"abc", "", "$%^ *()_"};

@ -73,7 +73,7 @@ static int compare_double(double a, double b, double epsilon) {
}
}
void empty_test() {
void empty_test(void) {
census_window_stats_sums result;
const gpr_timespec zero = {0, 0};
test_stat sum;
@ -88,7 +88,7 @@ void empty_test() {
census_window_stats_destroy(stats);
}
void one_interval_test() {
void one_interval_test(void) {
const test_stat value = {0.1, 4};
const double epsilon = 1e10 - 11;
gpr_timespec when = {0, 0};
@ -197,7 +197,7 @@ void one_interval_test() {
census_window_stats_destroy(stats);
}
void many_interval_test() {
void many_interval_test(void) {
gpr_timespec intervals[4];
const test_stat value = {123.45, 8};
const double epsilon = 1e10 - 11;
@ -258,7 +258,7 @@ void many_interval_test() {
census_window_stats_destroy(stats);
}
void rolling_time_test() {
void rolling_time_test(void) {
const test_stat value = {0.1, 4};
gpr_timespec when = {0, 0};
census_window_stats_sums result;
@ -282,7 +282,7 @@ void rolling_time_test() {
census_window_stats_destroy(stats);
}
#include <stdio.h>
void infinite_interval_test() {
void infinite_interval_test(void) {
const test_stat value = {0.1, 4};
gpr_timespec when = {0, 0};
census_window_stats_sums result;

@ -41,7 +41,7 @@
#define LOG_TEST() gpr_log(GPR_INFO, "%s", __FUNCTION__)
static void test_simple_int() {
static void test_simple_int(void) {
int x = 1;
gpr_cmdline *cl;
char *args[] = {(char *)__FUNCTION__, "-foo", "3"};
@ -56,7 +56,7 @@ static void test_simple_int() {
gpr_cmdline_destroy(cl);
}
static void test_eq_int() {
static void test_eq_int(void) {
int x = 1;
gpr_cmdline *cl;
char *args[] = {(char *)__FUNCTION__, "-foo=3"};
@ -71,7 +71,7 @@ static void test_eq_int() {
gpr_cmdline_destroy(cl);
}
static void test_2dash_int() {
static void test_2dash_int(void) {
int x = 1;
gpr_cmdline *cl;
char *args[] = {(char *)__FUNCTION__, "--foo", "3"};
@ -86,7 +86,7 @@ static void test_2dash_int() {
gpr_cmdline_destroy(cl);
}
static void test_2dash_eq_int() {
static void test_2dash_eq_int(void) {
int x = 1;
gpr_cmdline *cl;
char *args[] = {(char *)__FUNCTION__, "--foo=3"};
@ -101,7 +101,7 @@ static void test_2dash_eq_int() {
gpr_cmdline_destroy(cl);
}
static void test_simple_string() {
static void test_simple_string(void) {
char *x = NULL;
gpr_cmdline *cl;
char *args[] = {(char *)__FUNCTION__, "-foo", "3"};
@ -116,7 +116,7 @@ static void test_simple_string() {
gpr_cmdline_destroy(cl);
}
static void test_eq_string() {
static void test_eq_string(void) {
char *x = NULL;
gpr_cmdline *cl;
char *args[] = {(char *)__FUNCTION__, "-foo=3"};
@ -131,7 +131,7 @@ static void test_eq_string() {
gpr_cmdline_destroy(cl);
}
static void test_2dash_string() {
static void test_2dash_string(void) {
char *x = NULL;
gpr_cmdline *cl;
char *args[] = {(char *)__FUNCTION__, "--foo", "3"};
@ -146,7 +146,7 @@ static void test_2dash_string() {
gpr_cmdline_destroy(cl);
}
static void test_2dash_eq_string() {
static void test_2dash_eq_string(void) {
char *x = NULL;
gpr_cmdline *cl;
char *args[] = {(char *)__FUNCTION__, "--foo=3"};
@ -161,7 +161,7 @@ static void test_2dash_eq_string() {
gpr_cmdline_destroy(cl);
}
static void test_flag_on() {
static void test_flag_on(void) {
int x = 2;
gpr_cmdline *cl;
char *args[] = {(char *)__FUNCTION__, "--foo"};
@ -176,7 +176,7 @@ static void test_flag_on() {
gpr_cmdline_destroy(cl);
}
static void test_flag_no() {
static void test_flag_no(void) {
int x = 2;
gpr_cmdline *cl;
char *args[] = {(char *)__FUNCTION__, "--no-foo"};
@ -191,7 +191,7 @@ static void test_flag_no() {
gpr_cmdline_destroy(cl);
}
static void test_flag_val_1() {
static void test_flag_val_1(void) {
int x = 2;
gpr_cmdline *cl;
char *args[] = {(char *)__FUNCTION__, "--foo=1"};
@ -206,7 +206,7 @@ static void test_flag_val_1() {
gpr_cmdline_destroy(cl);
}
static void test_flag_val_0() {
static void test_flag_val_0(void) {
int x = 2;
gpr_cmdline *cl;
char *args[] = {(char *)__FUNCTION__, "--foo=0"};
@ -221,7 +221,7 @@ static void test_flag_val_0() {
gpr_cmdline_destroy(cl);
}
static void test_flag_val_true() {
static void test_flag_val_true(void) {
int x = 2;
gpr_cmdline *cl;
char *args[] = {(char *)__FUNCTION__, "--foo=true"};
@ -236,7 +236,7 @@ static void test_flag_val_true() {
gpr_cmdline_destroy(cl);
}
static void test_flag_val_false() {
static void test_flag_val_false(void) {
int x = 2;
gpr_cmdline *cl;
char *args[] = {(char *)__FUNCTION__, "--foo=false"};
@ -251,7 +251,7 @@ static void test_flag_val_false() {
gpr_cmdline_destroy(cl);
}
static void test_many() {
static void test_many(void) {
char *str = NULL;
int x = 0;
int flag = 2;

@ -36,7 +36,7 @@
#define LOG_TEST() gpr_log(GPR_INFO, "%s", __FUNCTION__);
static void test_no_op() {
static void test_no_op(void) {
gpr_histogram_destroy(gpr_histogram_create(0.01, 60e9));
}
@ -49,7 +49,7 @@ static void expect_percentile(gpr_histogram *h, double percentile,
GPR_ASSERT(got <= max_expect);
}
static void test_simple() {
static void test_simple(void) {
gpr_histogram *h;
LOG_TEST();
@ -66,7 +66,7 @@ static void test_simple() {
gpr_histogram_destroy(h);
}
static void test_percentile() {
static void test_percentile(void) {
gpr_histogram *h;
double last;
double i;
@ -111,7 +111,7 @@ static void test_percentile() {
gpr_histogram_destroy(h);
}
static void test_merge() {
static void test_merge(void) {
gpr_histogram *h1, *h2;
double last;
double i;

@ -48,7 +48,7 @@ static void join_host_port_expect(const char *host, int port,
gpr_free(buf);
}
static void test_join_host_port() {
static void test_join_host_port(void) {
join_host_port_expect("foo", 101, "foo:101");
join_host_port_expect("", 102, ":102");
join_host_port_expect("1::2", 103, "[1::2]:103");
@ -56,7 +56,7 @@ static void test_join_host_port() {
}
/* Garbage in, garbage out. */
static void test_join_host_port_garbage() {
static void test_join_host_port_garbage(void) {
join_host_port_expect("[foo]", 105, "[foo]:105");
join_host_port_expect("[::", 106, "[:::106");
join_host_port_expect("::]", 107, "[::]]:107");

@ -40,7 +40,7 @@
#define LOG_TEST_NAME() gpr_log(GPR_INFO, "%s", __FUNCTION__);
static void test_slice_malloc_returns_something_sensible() {
static void test_slice_malloc_returns_something_sensible(void) {
/* Calls gpr_slice_create for various lengths and verifies the internals for
consistency. */
size_t length;
@ -74,7 +74,7 @@ static void test_slice_malloc_returns_something_sensible() {
static void do_nothing(void *ignored) {}
static void test_slice_new_returns_something_sensible() {
static void test_slice_new_returns_something_sensible(void) {
gpr_uint8 x;
gpr_slice slice = gpr_slice_new(&x, 1, do_nothing);
@ -91,7 +91,7 @@ static void do_nothing_with_len_1(void *ignored, size_t len) {
do_nothing_with_len_1_calls++;
}
static void test_slice_new_with_len_returns_something_sensible() {
static void test_slice_new_with_len_returns_something_sensible(void) {
gpr_uint8 x;
gpr_slice slice = gpr_slice_new_with_len(&x, 1, do_nothing_with_len_1);
@ -198,7 +198,7 @@ static void test_slice_split_tail_works(int length) {
gpr_slice_unref(slice);
}
static void test_slice_from_copied_string_works() {
static void test_slice_from_copied_string_works(void) {
static const char *text = "HELLO WORLD!";
gpr_slice slice;

@ -44,7 +44,7 @@
#define LOG_TEST_NAME() gpr_log(GPR_INFO, "%s", __FUNCTION__)
static void test_strdup() {
static void test_strdup(void) {
static const char *src1 = "hello world";
char *dst1;
@ -64,7 +64,7 @@ static void expect_hexdump(const char *buf, size_t len, gpr_uint32 flags,
gpr_free(got);
}
static void test_hexdump() {
static void test_hexdump(void) {
LOG_TEST_NAME();
expect_hexdump("\x01", 1, 0, "01");
expect_hexdump("\x01", 1, GPR_HEXDUMP_PLAINTEXT, "01 '.'");
@ -85,7 +85,7 @@ static void test_pu32_succeed(const char *s, gpr_uint32 want) {
GPR_ASSERT(out == want);
}
static void test_parse_uint32() {
static void test_parse_uint32(void) {
LOG_TEST_NAME();
test_pu32_fail("-1");
@ -119,7 +119,7 @@ static void test_parse_uint32() {
test_pu32_fail("4294967299");
}
static void test_asprintf() {
static void test_asprintf(void) {
char *buf;
int i, j;

@ -222,7 +222,7 @@ static void test_sticky_infinities(void) {
}
}
static void test_similar() {
static void test_similar(void) {
GPR_ASSERT(1 == gpr_time_similar(gpr_inf_future, gpr_inf_future, gpr_time_0));
GPR_ASSERT(1 == gpr_time_similar(gpr_inf_past, gpr_inf_past, gpr_time_0));
GPR_ASSERT(0 == gpr_time_similar(gpr_inf_past, gpr_inf_future, gpr_time_0));

@ -46,7 +46,7 @@
#define LOG_TEST() gpr_log(GPR_INFO, "%s", __FUNCTION__)
static void test_create() {
static void test_create(void) {
grpc_byte_buffer *buffer;
grpc_byte_buffer_reader *reader;
gpr_slice empty = gpr_empty_slice();
@ -57,7 +57,7 @@ static void test_create() {
grpc_byte_buffer_destroy(buffer);
}
static void test_read_one_slice() {
static void test_read_one_slice(void) {
gpr_slice slice;
grpc_byte_buffer *buffer;
grpc_byte_buffer_reader *reader;
@ -79,7 +79,7 @@ static void test_read_one_slice() {
grpc_byte_buffer_destroy(buffer);
}
static void test_read_one_slice_malloc() {
static void test_read_one_slice_malloc(void) {
gpr_slice slice;
grpc_byte_buffer *buffer;
grpc_byte_buffer_reader *reader;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save