aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-01-15 11:37:30 -0800
committerGravatar Craig Tiller <ctiller@google.com>2015-01-15 11:37:30 -0800
commit32946d37e05714d358f66fb4ff8a204ce53d8573 (patch)
treef87c481963d3db4209da8fa07919a83bd1347a24 /src
parentda2a953fd607933b2a56c55e713274377af38fd6 (diff)
() --> (void)
Diffstat (limited to 'src')
-rw-r--r--src/core/iomgr/alarm.c4
-rw-r--r--src/core/iomgr/alarm_internal.h6
-rw-r--r--src/core/iomgr/iomgr.c10
-rw-r--r--src/core/iomgr/iomgr.h4
-rw-r--r--src/core/iomgr/iomgr_internal.h8
-rw-r--r--src/core/iomgr/iomgr_posix.c4
-rw-r--r--src/core/iomgr/iomgr_posix.h4
-rw-r--r--src/core/iomgr/pollset_posix.c6
-rw-r--r--src/core/iomgr/pollset_posix.h2
-rw-r--r--src/core/iomgr/socket_utils_common_posix.c4
-rw-r--r--src/core/iomgr/socket_utils_posix.h2
-rw-r--r--src/core/iomgr/tcp_server.h2
-rw-r--r--src/core/iomgr/tcp_server_posix.c6
-rw-r--r--src/core/security/credentials.c2
-rw-r--r--src/core/statistics/census_init.c4
-rw-r--r--src/core/statistics/census_interface.h6
-rw-r--r--src/core/statistics/census_log.c10
-rw-r--r--src/core/statistics/census_log.h8
-rw-r--r--src/core/statistics/census_rpc_stats.c10
-rw-r--r--src/core/statistics/census_rpc_stats.h6
-rw-r--r--src/core/statistics/census_tracing.c14
-rw-r--r--src/core/statistics/census_tracing.h8
-rw-r--r--src/core/support/cpu.h4
-rw-r--r--src/core/support/cpu_linux.c4
-rw-r--r--src/core/support/cpu_posix.c4
-rw-r--r--src/core/support/log_linux.c2
-rw-r--r--src/core/support/log_posix.c2
-rw-r--r--src/core/support/slice.c2
-rw-r--r--src/core/support/string.c2
-rw-r--r--src/core/surface/completion_queue.c4
-rw-r--r--src/core/surface/init.c4
-rw-r--r--src/core/transport/chttp2/alpn.c2
-rw-r--r--src/core/transport/chttp2/alpn.h2
-rw-r--r--src/core/transport/chttp2/frame_settings.c2
-rw-r--r--src/core/transport/chttp2/frame_settings.h2
-rw-r--r--src/core/transport/chttp2/gen_hpack_tables.c14
-rw-r--r--src/core/transport/metadata.c2
-rw-r--r--src/core/transport/metadata.h2
38 files changed, 92 insertions, 92 deletions
diff --git a/src/core/iomgr/alarm.c b/src/core/iomgr/alarm.c
index 2664879323..5b80368e3a 100644
--- a/src/core/iomgr/alarm.c
+++ b/src/core/iomgr/alarm.c
@@ -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;
diff --git a/src/core/iomgr/alarm_internal.h b/src/core/iomgr/alarm_internal.h
index 12b6ab4286..5c6b869302 100644
--- a/src/core/iomgr/alarm_internal.h
+++ b/src/core/iomgr/alarm_internal.h
@@ -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_ */
diff --git a/src/core/iomgr/iomgr.c b/src/core/iomgr/iomgr.c
index 03f56a50a3..7f266ab235 100644
--- a/src/core/iomgr/iomgr.c
+++ b/src/core/iomgr/iomgr.c
@@ -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);
diff --git a/src/core/iomgr/iomgr.h b/src/core/iomgr/iomgr.h
index 16991a9b90..06dc2e5dbf 100644
--- a/src/core/iomgr/iomgr.h
+++ b/src/core/iomgr/iomgr.h
@@ -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 */
diff --git a/src/core/iomgr/iomgr_internal.h b/src/core/iomgr/iomgr_internal.h
index 5f72542777..e9962a0f66 100644
--- a/src/core/iomgr/iomgr_internal.h
+++ b/src/core/iomgr/iomgr_internal.h
@@ -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_ */
diff --git a/src/core/iomgr/iomgr_posix.c b/src/core/iomgr/iomgr_posix.c
index ff9195ec1d..61fec6bc53 100644
--- a/src/core/iomgr/iomgr_posix.c
+++ b/src/core/iomgr/iomgr_posix.c
@@ -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(); }
diff --git a/src/core/iomgr/iomgr_posix.h b/src/core/iomgr/iomgr_posix.h
index ca5af3e527..86973a050d 100644
--- a/src/core/iomgr/iomgr_posix.h
+++ b/src/core/iomgr/iomgr_posix.h
@@ -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_ */
diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c
index ff00e06429..6f1b3ced7d 100644
--- a/src/core/iomgr/pollset_posix.c
+++ b/src/core/iomgr/pollset_posix.c
@@ -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 */
diff --git a/src/core/iomgr/pollset_posix.h b/src/core/iomgr/pollset_posix.h
index f051079f5b..32a8f533ae 100644
--- a/src/core/iomgr/pollset_posix.h
+++ b/src/core/iomgr/pollset_posix.h
@@ -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,
diff --git a/src/core/iomgr/socket_utils_common_posix.c b/src/core/iomgr/socket_utils_common_posix.c
index 7f2b43f2ca..d65b025d70 100644
--- a/src/core/iomgr/socket_utils_common_posix.c
+++ b/src/core/iomgr/socket_utils_common_posix.c
@@ -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;
}
diff --git a/src/core/iomgr/socket_utils_posix.h b/src/core/iomgr/socket_utils_posix.h
index 9c5d93c2b4..a84457f01d 100644
--- a/src/core/iomgr/socket_utils_posix.h
+++ b/src/core/iomgr/socket_utils_posix.h
@@ -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.
diff --git a/src/core/iomgr/tcp_server.h b/src/core/iomgr/tcp_server.h
index d881e146b9..8ffd7d3569 100644
--- a/src/core/iomgr/tcp_server.h
+++ b/src/core/iomgr/tcp_server.h
@@ -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,
diff --git a/src/core/iomgr/tcp_server_posix.c b/src/core/iomgr/tcp_server_posix.c
index 753e24c38e..5762eb8a97 100644
--- a/src/core/iomgr/tcp_server_posix.c
+++ b/src/core/iomgr/tcp_server_posix.c
@@ -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;
}
diff --git a/src/core/security/credentials.c b/src/core/security/credentials.c
index d3bba0fb1f..ea1a6cd1c4 100644
--- a/src/core/security/credentials.c
+++ b/src/core/security/credentials.c
@@ -638,7 +638,7 @@ grpc_credentials *grpc_fake_transport_security_credentials_create(void) {
}
grpc_server_credentials *
-grpc_fake_transport_security_server_credentials_create() {
+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;
diff --git a/src/core/statistics/census_init.c b/src/core/statistics/census_init.c
index bcb9ff9ad4..cbf2089f3f 100644
--- a/src/core/statistics/census_init.c
+++ b/src/core/statistics/census_init.c
@@ -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();
diff --git a/src/core/statistics/census_interface.h b/src/core/statistics/census_interface.h
index af9c70c4fb..8e586382f7 100644
--- a/src/core/statistics/census_interface.h
+++ b/src/core/statistics/census_interface.h
@@ -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);
diff --git a/src/core/statistics/census_log.c b/src/core/statistics/census_log.c
index 56fa430bbd..404e92cc62 100644
--- a/src/core/statistics/census_log.c
+++ b/src/core/statistics/census_log.c
@@ -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);
}
diff --git a/src/core/statistics/census_log.h b/src/core/statistics/census_log.h
index fa9229b122..0d89df7992 100644
--- a/src/core/statistics/census_log.h
+++ b/src/core/statistics/census_log.h
@@ -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__ */
diff --git a/src/core/statistics/census_rpc_stats.c b/src/core/statistics/census_rpc_stats.c
index a1ac2abff3..2db3054a0d 100644
--- a/src/core/statistics/census_rpc_stats.c
+++ b/src/core/statistics/census_rpc_stats.c
@@ -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);
diff --git a/src/core/statistics/census_rpc_stats.h b/src/core/statistics/census_rpc_stats.h
index a9c999aa5c..81466907fd 100644
--- a/src/core/statistics/census_rpc_stats.h
+++ b/src/core/statistics/census_rpc_stats.h
@@ -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
}
diff --git a/src/core/statistics/census_tracing.c b/src/core/statistics/census_tracing.c
index 45302cd6ab..99091cf80b 100644
--- a/src/core/statistics/census_tracing.c
+++ b/src/core/statistics/census_tracing.c
@@ -93,11 +93,11 @@ 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 +164,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 +177,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 +189,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) {
diff --git a/src/core/statistics/census_tracing.h b/src/core/statistics/census_tracing.h
index 2285a5cd6b..604096ba54 100644
--- a/src/core/statistics/census_tracing.h
+++ b/src/core/statistics/census_tracing.h
@@ -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);
diff --git a/src/core/support/cpu.h b/src/core/support/cpu.h
index 2435ec0353..1c2dde74ee 100644
--- a/src/core/support/cpu.h
+++ b/src/core/support/cpu.h
@@ -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__ */
diff --git a/src/core/support/cpu_linux.c b/src/core/support/cpu_linux.c
index 922b61c3c5..d800628806 100644
--- a/src/core/support/cpu_linux.c
+++ b/src/core/support/cpu_linux.c
@@ -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));
diff --git a/src/core/support/cpu_posix.c b/src/core/support/cpu_posix.c
index 3dd1c548b0..2ea80807fc 100644
--- a/src/core/support/cpu_posix.c
+++ b/src/core/support/cpu_posix.c
@@ -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
diff --git a/src/core/support/log_linux.c b/src/core/support/log_linux.c
index 36fb4b5051..a0307e1a9a 100644
--- a/src/core/support/log_linux.c
+++ b/src/core/support/log_linux.c
@@ -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, ...) {
diff --git a/src/core/support/log_posix.c b/src/core/support/log_posix.c
index ee2705a2c2..1292c9e8c3 100644
--- a/src/core/support/log_posix.c
+++ b/src/core/support/log_posix.c
@@ -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, ...) {
diff --git a/src/core/support/slice.c b/src/core/support/slice.c
index fcdeb478fb..836a5a6c2a 100644
--- a/src/core/support/slice.c
+++ b/src/core/support/slice.c
@@ -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;
diff --git a/src/core/support/string.c b/src/core/support/string.c
index b1f0795846..7960547735 100644
--- a/src/core/support/string.c
+++ b/src/core/support/string.c
@@ -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;
}
diff --git a/src/core/surface/completion_queue.c b/src/core/surface/completion_queue.c
index b59c36e03a..0f09933fc0 100644
--- a/src/core/surface/completion_queue.c
+++ b/src/core/surface/completion_queue.c
@@ -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;
diff --git a/src/core/surface/init.c b/src/core/surface/init.c
index 832ec085c7..b5019eb03f 100644
--- a/src/core/surface/init.c
+++ b/src/core/surface/init.c
@@ -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();
}
diff --git a/src/core/transport/chttp2/alpn.c b/src/core/transport/chttp2/alpn.c
index 8107406f8b..bc4e789f60 100644
--- a/src/core/transport/chttp2/alpn.c
+++ b/src/core/transport/chttp2/alpn.c
@@ -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);
}
diff --git a/src/core/transport/chttp2/alpn.h b/src/core/transport/chttp2/alpn.h
index de4da8fedb..cb96f17831 100644
--- a/src/core/transport/chttp2/alpn.h
+++ b/src/core/transport/chttp2/alpn.h
@@ -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()) */
diff --git a/src/core/transport/chttp2/frame_settings.c b/src/core/transport/chttp2/frame_settings.c
index d8bc492870..3ca973c07b 100644
--- a/src/core/transport/chttp2/frame_settings.c
+++ b/src/core/transport/chttp2/frame_settings.c
@@ -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;
diff --git a/src/core/transport/chttp2/frame_settings.h b/src/core/transport/chttp2/frame_settings.h
index 855f9636bb..fc513913d9 100644
--- a/src/core/transport/chttp2/frame_settings.h
+++ b/src/core/transport/chttp2/frame_settings.h
@@ -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,
diff --git a/src/core/transport/chttp2/gen_hpack_tables.c b/src/core/transport/chttp2/gen_hpack_tables.c
index 3b9e8ed4dc..cd78fcc39a 100644
--- a/src/core/transport/chttp2/gen_hpack_tables.c
+++ b/src/core/transport/chttp2/gen_hpack_tables.c
@@ -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];
diff --git a/src/core/transport/metadata.c b/src/core/transport/metadata.c
index e8ab216671..6881b871ec 100644
--- a/src/core/transport/metadata.c
+++ b/src/core/transport/metadata.c
@@ -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.
*/
diff --git a/src/core/transport/metadata.h b/src/core/transport/metadata.h
index 943e65a981..ac845def37 100644
--- a/src/core/transport/metadata.h
+++ b/src/core/transport/metadata.h
@@ -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);