diff options
author | David Barksdale <amatus.amongus@gmail.com> | 2016-08-18 00:03:29 +0000 |
---|---|---|
committer | David Barksdale <amatus.amongus@gmail.com> | 2016-08-18 00:03:29 +0000 |
commit | 7f937e3781f36538d9864fa841822eecdaf0bf27 (patch) | |
tree | 318eb592dae2bbf59d094f5df140c24a4b6184c9 /src/core | |
parent | 94a717fab18ed25e6bec4b349526212045f6ca70 (diff) |
Use statement exprs instead of local function
This change lets us compile with clang again.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/core_api.c | 50 | ||||
-rw-r--r-- | src/core/core_api_2.c | 40 | ||||
-rw-r--r-- | src/core/core_api_monitor_peers.c | 8 | ||||
-rw-r--r-- | src/core/gnunet-service-core_kx.c | 32 | ||||
-rw-r--r-- | src/core/test_core_api.c | 16 | ||||
-rw-r--r-- | src/core/test_core_api_reliability.c | 16 | ||||
-rw-r--r-- | src/core/test_core_api_send_to_self.c | 8 | ||||
-rw-r--r-- | src/core/test_core_quota_compliance.c | 16 |
8 files changed, 93 insertions, 93 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c index caf614afc1..6055b99c1a 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c @@ -767,31 +767,31 @@ handle_send_ready (void *cls, static void reconnect (struct GNUNET_CORE_Handle *h) { - GNUNET_MQ_hd_fixed_size (init_reply, - GNUNET_MESSAGE_TYPE_CORE_INIT_REPLY, - struct InitReplyMessage); - GNUNET_MQ_hd_fixed_size (connect_notify, - GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT, - struct ConnectNotifyMessage); - GNUNET_MQ_hd_fixed_size (disconnect_notify, - GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT, - struct DisconnectNotifyMessage); - GNUNET_MQ_hd_var_size (notify_inbound, - GNUNET_MESSAGE_TYPE_CORE_NOTIFY_INBOUND, - struct NotifyTrafficMessage); - GNUNET_MQ_hd_var_size (notify_outbound, - GNUNET_MESSAGE_TYPE_CORE_NOTIFY_OUTBOUND, - struct NotifyTrafficMessage); - GNUNET_MQ_hd_fixed_size (send_ready, - GNUNET_MESSAGE_TYPE_CORE_SEND_READY, - struct SendMessageReady); - struct GNUNET_MQ_MessageHandler handlers[] = { - make_init_reply_handler (h), - make_connect_notify_handler (h), - make_disconnect_notify_handler (h), - make_notify_inbound_handler (h), - make_notify_outbound_handler (h), - make_send_ready_handler (h), + struct GNUNET_MQ_MessageHandler handlers[] = { + GNUNET_MQ_hd_fixed_size (init_reply, + GNUNET_MESSAGE_TYPE_CORE_INIT_REPLY, + struct InitReplyMessage, + h), + GNUNET_MQ_hd_fixed_size (connect_notify, + GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT, + struct ConnectNotifyMessage, + h), + GNUNET_MQ_hd_fixed_size (disconnect_notify, + GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT, + struct DisconnectNotifyMessage, + h), + GNUNET_MQ_hd_var_size (notify_inbound, + GNUNET_MESSAGE_TYPE_CORE_NOTIFY_INBOUND, + struct NotifyTrafficMessage, + h), + GNUNET_MQ_hd_var_size (notify_outbound, + GNUNET_MESSAGE_TYPE_CORE_NOTIFY_OUTBOUND, + struct NotifyTrafficMessage, + h), + GNUNET_MQ_hd_fixed_size (send_ready, + GNUNET_MESSAGE_TYPE_CORE_SEND_READY, + struct SendMessageReady, + h), GNUNET_MQ_handler_end () }; struct InitMessage *init; diff --git a/src/core/core_api_2.c b/src/core/core_api_2.c index 536fe597c8..d810bf2ec7 100644 --- a/src/core/core_api_2.c +++ b/src/core/core_api_2.c @@ -700,27 +700,27 @@ handle_send_ready (void *cls, static void reconnect (struct GNUNET_CORE_Handle *h) { - GNUNET_MQ_hd_fixed_size (init_reply, - GNUNET_MESSAGE_TYPE_CORE_INIT_REPLY, - struct InitReplyMessage); - GNUNET_MQ_hd_fixed_size (connect_notify, - GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT, - struct ConnectNotifyMessage); - GNUNET_MQ_hd_fixed_size (disconnect_notify, - GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT, - struct DisconnectNotifyMessage); - GNUNET_MQ_hd_var_size (notify_inbound, - GNUNET_MESSAGE_TYPE_CORE_NOTIFY_INBOUND, - struct NotifyTrafficMessage); - GNUNET_MQ_hd_fixed_size (send_ready, - GNUNET_MESSAGE_TYPE_CORE_SEND_READY, - struct SendMessageReady); struct GNUNET_MQ_MessageHandler handlers[] = { - make_init_reply_handler (h), - make_connect_notify_handler (h), - make_disconnect_notify_handler (h), - make_notify_inbound_handler (h), - make_send_ready_handler (h), + GNUNET_MQ_hd_fixed_size (init_reply, + GNUNET_MESSAGE_TYPE_CORE_INIT_REPLY, + struct InitReplyMessage, + h), + GNUNET_MQ_hd_fixed_size (connect_notify, + GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT, + struct ConnectNotifyMessage, + h), + GNUNET_MQ_hd_fixed_size (disconnect_notify, + GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT, + struct DisconnectNotifyMessage, + h), + GNUNET_MQ_hd_var_size (notify_inbound, + GNUNET_MESSAGE_TYPE_CORE_NOTIFY_INBOUND, + struct NotifyTrafficMessage, + h), + GNUNET_MQ_hd_fixed_size (send_ready, + GNUNET_MESSAGE_TYPE_CORE_SEND_READY, + struct SendMessageReady, + h), GNUNET_MQ_handler_end () }; struct InitMessage *init; diff --git a/src/core/core_api_monitor_peers.c b/src/core/core_api_monitor_peers.c index bafcd3e942..1455eb2b01 100644 --- a/src/core/core_api_monitor_peers.c +++ b/src/core/core_api_monitor_peers.c @@ -114,11 +114,11 @@ handle_receive_info (void *cls, static void reconnect (struct GNUNET_CORE_MonitorHandle *mh) { - GNUNET_MQ_hd_fixed_size (receive_info, - GNUNET_MESSAGE_TYPE_CORE_MONITOR_NOTIFY, - struct MonitorNotifyMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_receive_info_handler (mh), + GNUNET_MQ_hd_fixed_size (receive_info, + GNUNET_MESSAGE_TYPE_CORE_MONITOR_NOTIFY, + struct MonitorNotifyMessage, + mh), GNUNET_MQ_handler_end () }; struct GNUNET_MQ_Envelope *env; diff --git a/src/core/gnunet-service-core_kx.c b/src/core/gnunet-service-core_kx.c index b2949a6888..6f6786d891 100644 --- a/src/core/gnunet-service-core_kx.c +++ b/src/core/gnunet-service-core_kx.c @@ -1814,23 +1814,23 @@ int GSC_KX_init (struct GNUNET_CRYPTO_EddsaPrivateKey *pk, struct GNUNET_SERVER_Handle *server) { - GNUNET_MQ_hd_fixed_size (ephemeral_key, - GNUNET_MESSAGE_TYPE_CORE_EPHEMERAL_KEY, - struct EphemeralKeyMessage); - GNUNET_MQ_hd_fixed_size (ping, - GNUNET_MESSAGE_TYPE_CORE_PING, - struct PingMessage); - GNUNET_MQ_hd_fixed_size (pong, - GNUNET_MESSAGE_TYPE_CORE_PONG, - struct PongMessage); - GNUNET_MQ_hd_var_size (encrypted, - GNUNET_MESSAGE_TYPE_CORE_ENCRYPTED_MESSAGE, - struct EncryptedMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_ephemeral_key_handler (NULL), - make_ping_handler (NULL), - make_pong_handler (NULL), - make_encrypted_handler (NULL), + GNUNET_MQ_hd_fixed_size (ephemeral_key, + GNUNET_MESSAGE_TYPE_CORE_EPHEMERAL_KEY, + struct EphemeralKeyMessage, + NULL), + GNUNET_MQ_hd_fixed_size (ping, + GNUNET_MESSAGE_TYPE_CORE_PING, + struct PingMessage, + NULL), + GNUNET_MQ_hd_fixed_size (pong, + GNUNET_MESSAGE_TYPE_CORE_PONG, + struct PongMessage, + NULL), + GNUNET_MQ_hd_var_size (encrypted, + GNUNET_MESSAGE_TYPE_CORE_ENCRYPTED_MESSAGE, + struct EncryptedMessage, + NULL), GNUNET_MQ_handler_end() }; diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c index 772ded991b..650c89cda8 100644 --- a/src/core/test_core_api.c +++ b/src/core/test_core_api.c @@ -225,12 +225,12 @@ static void init_notify (void *cls, const struct GNUNET_PeerIdentity *my_identity) { - GNUNET_MQ_hd_fixed_size (test, - MTYPE, - struct GNUNET_MessageHeader); struct PeerContext *p = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - make_test_handler (NULL), + GNUNET_MQ_hd_fixed_size (test, + MTYPE, + struct GNUNET_MessageHeader, + NULL); GNUNET_MQ_handler_end () }; @@ -298,11 +298,11 @@ run (void *cls, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { - GNUNET_MQ_hd_fixed_size (test, - MTYPE, - struct GNUNET_MessageHeader); struct GNUNET_MQ_MessageHandler handlers[] = { - make_test_handler (NULL), + GNUNET_MQ_hd_fixed_size (test, + MTYPE, + struct GNUNET_MessageHeader, + NULL); GNUNET_MQ_handler_end () }; diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c index d7d4a6bd6d..4d8d540282 100644 --- a/src/core/test_core_api_reliability.c +++ b/src/core/test_core_api_reliability.c @@ -322,12 +322,12 @@ static void init_notify (void *cls, const struct GNUNET_PeerIdentity *my_identity) { - GNUNET_MQ_hd_var_size (test, - MTYPE, - struct TestMessage); struct PeerContext *p = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - make_test_handler (NULL), + GNUNET_MQ_hd_var_size (test, + MTYPE, + struct TestMessage, + NULL); GNUNET_MQ_handler_end () }; @@ -442,11 +442,11 @@ run (void *cls, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { - GNUNET_MQ_hd_fixed_size (test, - MTYPE, - struct TestMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_test_handler (NULL), + GNUNET_MQ_hd_fixed_size (test, + MTYPE, + struct TestMessage, + NULL); GNUNET_MQ_handler_end () }; diff --git a/src/core/test_core_api_send_to_self.c b/src/core/test_core_api_send_to_self.c index 111aea900d..d29da651b3 100644 --- a/src/core/test_core_api_send_to_self.c +++ b/src/core/test_core_api_send_to_self.c @@ -150,11 +150,11 @@ run (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_TESTING_Peer *peer) { - GNUNET_MQ_hd_fixed_size (test, - GNUNET_MESSAGE_TYPE_DUMMY, - struct GNUNET_MessageHeader); struct GNUNET_MQ_MessageHandler handlers[] = { - make_test_handler (NULL), + GNUNET_MQ_hd_fixed_size (test, + GNUNET_MESSAGE_TYPE_DUMMY, + struct GNUNET_MessageHeader, + NULL), GNUNET_MQ_handler_end () }; diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c index 31063b814d..4dee958f2d 100644 --- a/src/core/test_core_quota_compliance.c +++ b/src/core/test_core_quota_compliance.c @@ -461,12 +461,12 @@ static void init_notify (void *cls, const struct GNUNET_PeerIdentity *my_identity) { - GNUNET_MQ_hd_fixed_size (test, - MTYPE, - struct TestMessage); struct PeerContext *p = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - make_test_handler (NULL), + GNUNET_MQ_hd_fixed_size (test, + MTYPE, + struct TestMessage, + NULL), GNUNET_MQ_handler_end () }; @@ -593,11 +593,11 @@ run (void *cls, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { - GNUNET_MQ_hd_fixed_size (test, - MTYPE, - struct TestMessage); struct GNUNET_MQ_MessageHandler handlers[] = { - make_test_handler (NULL), + GNUNET_MQ_hd_fixed_size (test, + MTYPE, + struct TestMessage, + NULL), GNUNET_MQ_handler_end () }; |