summaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorDavid Barksdale <amatus.amongus@gmail.com>2016-08-18 00:03:29 +0000
committerDavid Barksdale <amatus.amongus@gmail.com>2016-08-18 00:03:29 +0000
commit7f937e3781f36538d9864fa841822eecdaf0bf27 (patch)
tree318eb592dae2bbf59d094f5df140c24a4b6184c9 /src/transport
parent94a717fab18ed25e6bec4b349526212045f6ca70 (diff)
Use statement exprs instead of local function
This change lets us compile with clang again.
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/gnunet-transport-profiler.c8
-rw-r--r--src/transport/gnunet-transport.c8
-rw-r--r--src/transport/transport-testing-main.c16
-rw-r--r--src/transport/transport_api_address_to_string.c8
-rw-r--r--src/transport/transport_api_blacklist.c8
-rw-r--r--src/transport/transport_api_core.c48
-rw-r--r--src/transport/transport_api_hello_get.c8
-rw-r--r--src/transport/transport_api_monitor_peers.c16
-rw-r--r--src/transport/transport_api_monitor_plugins.c16
9 files changed, 68 insertions, 68 deletions
diff --git a/src/transport/gnunet-transport-profiler.c b/src/transport/gnunet-transport-profiler.c
index 6e2ac6121..dceff7e3b 100644
--- a/src/transport/gnunet-transport-profiler.c
+++ b/src/transport/gnunet-transport-profiler.c
@@ -509,11 +509,11 @@ run (void *cls,
const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *mycfg)
{
- GNUNET_MQ_hd_var_size (dummy,
- GNUNET_MESSAGE_TYPE_DUMMY,
- struct GNUNET_MessageHeader);
struct GNUNET_MQ_MessageHandler handlers[] = {
- make_dummy_handler (NULL),
+ GNUNET_MQ_hd_var_size (dummy,
+ GNUNET_MESSAGE_TYPE_DUMMY,
+ struct GNUNET_MessageHeader,
+ NULL),
GNUNET_MQ_handler_end ()
};
diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c
index fc0eada7a..aceaceb87 100644
--- a/src/transport/gnunet-transport.c
+++ b/src/transport/gnunet-transport.c
@@ -1517,9 +1517,6 @@ run (void *cls,
const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *mycfg)
{
- GNUNET_MQ_hd_var_size (dummy,
- GNUNET_MESSAGE_TYPE_DUMMY,
- struct GNUNET_MessageHeader);
int counter = 0;
ret = 1;
@@ -1630,7 +1627,10 @@ run (void *cls,
else if (benchmark_receive) /* -b: Benchmark receiving */
{
struct GNUNET_MQ_MessageHandler handlers[] = {
- make_dummy_handler (NULL),
+ GNUNET_MQ_hd_var_size (dummy,
+ GNUNET_MESSAGE_TYPE_DUMMY,
+ struct GNUNET_MessageHeader,
+ NULL),
GNUNET_MQ_handler_end ()
};
diff --git a/src/transport/transport-testing-main.c b/src/transport/transport-testing-main.c
index bba37eee8..a79d81cb9 100644
--- a/src/transport/transport-testing-main.c
+++ b/src/transport/transport-testing-main.c
@@ -442,12 +442,6 @@ connect_check_run (void *cls,
const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
- GNUNET_MQ_hd_var_size (test,
- GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE,
- struct GNUNET_TRANSPORT_TESTING_TestMessage);
- GNUNET_MQ_hd_var_size (test2,
- GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE2,
- struct GNUNET_TRANSPORT_TESTING_TestMessage);
struct GNUNET_TRANSPORT_TESTING_ConnectCheckContext *ccc = cls;
int ok;
@@ -461,8 +455,14 @@ connect_check_run (void *cls,
for (unsigned int i=0;i<ccc->num_peers;i++)
{
struct GNUNET_MQ_MessageHandler handlers[] = {
- make_test_handler (NULL),
- make_test2_handler (NULL),
+ GNUNET_MQ_hd_var_size (test,
+ GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE,
+ struct GNUNET_TRANSPORT_TESTING_TestMessage,
+ NULL),
+ GNUNET_MQ_hd_var_size (test2,
+ GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE2,
+ struct GNUNET_TRANSPORT_TESTING_TestMessage,
+ NULL),
GNUNET_MQ_handler_end()
};
ccc->p[i] = GNUNET_TRANSPORT_TESTING_start_peer (ccc->tth,
diff --git a/src/transport/transport_api_address_to_string.c b/src/transport/transport_api_address_to_string.c
index a2cad07b0..fd30230f7 100644
--- a/src/transport/transport_api_address_to_string.c
+++ b/src/transport/transport_api_address_to_string.c
@@ -182,13 +182,13 @@ GNUNET_TRANSPORT_address_to_string (const struct GNUNET_CONFIGURATION_Handle *cf
GNUNET_TRANSPORT_AddressToStringCallback aluc,
void *aluc_cls)
{
- GNUNET_MQ_hd_var_size (reply,
- GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_TO_STRING_REPLY,
- struct AddressToStringResultMessage);
struct GNUNET_TRANSPORT_AddressToStringContext *alc
= GNUNET_new (struct GNUNET_TRANSPORT_AddressToStringContext);
struct GNUNET_MQ_MessageHandler handlers[] = {
- make_reply_handler (alc),
+ GNUNET_MQ_hd_var_size (reply,
+ GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_TO_STRING_REPLY,
+ struct AddressToStringResultMessage,
+ alc),
GNUNET_MQ_handler_end ()
};
size_t alen;
diff --git a/src/transport/transport_api_blacklist.c b/src/transport/transport_api_blacklist.c
index 2835e225f..4b758f9dc 100644
--- a/src/transport/transport_api_blacklist.c
+++ b/src/transport/transport_api_blacklist.c
@@ -120,11 +120,11 @@ mq_error_handler (void *cls,
static void
reconnect (struct GNUNET_TRANSPORT_Blacklist *br)
{
- GNUNET_MQ_hd_fixed_size (query,
- GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_QUERY,
- struct BlacklistMessage);
struct GNUNET_MQ_MessageHandler handlers[] = {
- make_query_handler (br),
+ GNUNET_MQ_hd_fixed_size (query,
+ GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_QUERY,
+ struct BlacklistMessage,
+ br),
GNUNET_MQ_handler_end ()
};
struct GNUNET_MQ_Envelope *env;
diff --git a/src/transport/transport_api_core.c b/src/transport/transport_api_core.c
index 6be9500fb..0705552f9 100644
--- a/src/transport/transport_api_core.c
+++ b/src/transport/transport_api_core.c
@@ -748,32 +748,32 @@ handle_set_quota (void *cls,
static void
reconnect (void *cls)
{
- GNUNET_MQ_hd_var_size (hello,
- GNUNET_MESSAGE_TYPE_HELLO,
- struct GNUNET_MessageHeader);
- GNUNET_MQ_hd_fixed_size (connect,
- GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT,
- struct ConnectInfoMessage);
- GNUNET_MQ_hd_fixed_size (disconnect,
- GNUNET_MESSAGE_TYPE_TRANSPORT_DISCONNECT,
- struct DisconnectInfoMessage);
- GNUNET_MQ_hd_fixed_size (send_ok,
- GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_OK,
- struct SendOkMessage);
- GNUNET_MQ_hd_var_size (recv,
- GNUNET_MESSAGE_TYPE_TRANSPORT_RECV,
- struct InboundMessage);
- GNUNET_MQ_hd_fixed_size (set_quota,
- GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA,
- struct QuotaSetMessage);
struct GNUNET_TRANSPORT_CoreHandle *h = cls;
struct GNUNET_MQ_MessageHandler handlers[] = {
- make_hello_handler (h),
- make_connect_handler (h),
- make_disconnect_handler (h),
- make_send_ok_handler (h),
- make_recv_handler (h),
- make_set_quota_handler (h),
+ GNUNET_MQ_hd_var_size (hello,
+ GNUNET_MESSAGE_TYPE_HELLO,
+ struct GNUNET_MessageHeader,
+ h),
+ GNUNET_MQ_hd_fixed_size (connect,
+ GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT,
+ struct ConnectInfoMessage,
+ h),
+ GNUNET_MQ_hd_fixed_size (disconnect,
+ GNUNET_MESSAGE_TYPE_TRANSPORT_DISCONNECT,
+ struct DisconnectInfoMessage,
+ h),
+ GNUNET_MQ_hd_fixed_size (send_ok,
+ GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_OK,
+ struct SendOkMessage,
+ h),
+ GNUNET_MQ_hd_var_size (recv,
+ GNUNET_MESSAGE_TYPE_TRANSPORT_RECV,
+ struct InboundMessage,
+ h),
+ GNUNET_MQ_hd_fixed_size (set_quota,
+ GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA,
+ struct QuotaSetMessage,
+ h),
GNUNET_MQ_handler_end ()
};
struct GNUNET_MQ_Envelope *env;
diff --git a/src/transport/transport_api_hello_get.c b/src/transport/transport_api_hello_get.c
index ec7b544d6..9c3a3e786 100644
--- a/src/transport/transport_api_hello_get.c
+++ b/src/transport/transport_api_hello_get.c
@@ -167,12 +167,12 @@ mq_error_handler (void *cls,
static void
reconnect (void *cls)
{
- GNUNET_MQ_hd_var_size (hello,
- GNUNET_MESSAGE_TYPE_HELLO,
- struct GNUNET_MessageHeader);
struct GNUNET_TRANSPORT_HelloGetHandle *ghh = cls;
struct GNUNET_MQ_MessageHandler handlers[] = {
- make_hello_handler (ghh),
+ GNUNET_MQ_hd_var_size (hello,
+ GNUNET_MESSAGE_TYPE_HELLO,
+ struct GNUNET_MessageHeader,
+ ghh),
GNUNET_MQ_handler_end ()
};
struct GNUNET_MQ_Envelope *env;
diff --git a/src/transport/transport_api_monitor_peers.c b/src/transport/transport_api_monitor_peers.c
index a5c70fcfa..345f2ad60 100644
--- a/src/transport/transport_api_monitor_peers.c
+++ b/src/transport/transport_api_monitor_peers.c
@@ -344,16 +344,16 @@ mq_error_handler (void *cls,
static void
do_peer_connect (void *cls)
{
- GNUNET_MQ_hd_var_size (response,
- GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PEER_RESPONSE,
- struct PeerIterateResponseMessage);
- GNUNET_MQ_hd_fixed_size (response_end,
- GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PEER_RESPONSE_END,
- struct GNUNET_MessageHeader);
struct GNUNET_TRANSPORT_PeerMonitoringContext *pal_ctx = cls;
struct GNUNET_MQ_MessageHandler handlers[] = {
- make_response_handler (pal_ctx),
- make_response_end_handler (pal_ctx),
+ GNUNET_MQ_hd_var_size (response,
+ GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PEER_RESPONSE,
+ struct PeerIterateResponseMessage,
+ pal_ctx),
+ GNUNET_MQ_hd_fixed_size (response_end,
+ GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PEER_RESPONSE_END,
+ struct GNUNET_MessageHeader,
+ pal_ctx),
GNUNET_MQ_handler_end ()
};
struct PeerMonitorMessage *msg;
diff --git a/src/transport/transport_api_monitor_plugins.c b/src/transport/transport_api_monitor_plugins.c
index 01ec2074a..7547a3402 100644
--- a/src/transport/transport_api_monitor_plugins.c
+++ b/src/transport/transport_api_monitor_plugins.c
@@ -372,16 +372,16 @@ mq_error_handler (void *cls,
static void
do_plugin_connect (void *cls)
{
- GNUNET_MQ_hd_var_size (event,
- GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_EVENT,
- struct TransportPluginMonitorMessage);
- GNUNET_MQ_hd_fixed_size (sync,
- GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_SYNC,
- struct GNUNET_MessageHeader);
struct GNUNET_TRANSPORT_PluginMonitor *pm = cls;
struct GNUNET_MQ_MessageHandler handlers[] = {
- make_event_handler (pm),
- make_sync_handler (pm),
+ GNUNET_MQ_hd_var_size (event,
+ GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_EVENT,
+ struct TransportPluginMonitorMessage,
+ pm),
+ GNUNET_MQ_hd_fixed_size (sync,
+ GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_SYNC,
+ struct GNUNET_MessageHeader,
+ pm),
GNUNET_MQ_handler_end ()
};
struct GNUNET_MessageHeader *msg;