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/psyc | |
parent | 94a717fab18ed25e6bec4b349526212045f6ca70 (diff) | |
download | gnunet-7f937e3781f36538d9864fa841822eecdaf0bf27.tar.gz gnunet-7f937e3781f36538d9864fa841822eecdaf0bf27.zip |
Use statement exprs instead of local function
This change lets us compile with clang again.
Diffstat (limited to 'src/psyc')
-rw-r--r-- | src/psyc/psyc_api.c | 126 |
1 files changed, 56 insertions, 70 deletions
diff --git a/src/psyc/psyc_api.c b/src/psyc/psyc_api.c index 8e960c7be..45e4135a3 100644 --- a/src/psyc/psyc_api.c +++ b/src/psyc/psyc_api.c | |||
@@ -642,42 +642,35 @@ master_connect (struct GNUNET_PSYC_Master *mst) | |||
642 | { | 642 | { |
643 | struct GNUNET_PSYC_Channel *chn = &mst->chn; | 643 | struct GNUNET_PSYC_Channel *chn = &mst->chn; |
644 | 644 | ||
645 | GNUNET_MQ_hd_fixed_size (master_start_ack, | ||
646 | GNUNET_MESSAGE_TYPE_PSYC_MASTER_START_ACK, | ||
647 | struct GNUNET_PSYC_CountersResultMessage); | ||
648 | |||
649 | GNUNET_MQ_hd_var_size (master_join_request, | ||
650 | GNUNET_MESSAGE_TYPE_PSYC_JOIN_REQUEST, | ||
651 | struct GNUNET_PSYC_JoinRequestMessage); | ||
652 | |||
653 | GNUNET_MQ_hd_var_size (channel_message, | ||
654 | GNUNET_MESSAGE_TYPE_PSYC_MESSAGE, | ||
655 | struct GNUNET_PSYC_MessageHeader); | ||
656 | |||
657 | GNUNET_MQ_hd_fixed_size (channel_message_ack, | ||
658 | GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_ACK, | ||
659 | struct GNUNET_MessageHeader); | ||
660 | |||
661 | GNUNET_MQ_hd_var_size (channel_history_result, | ||
662 | GNUNET_MESSAGE_TYPE_PSYC_HISTORY_RESULT, | ||
663 | struct GNUNET_OperationResultMessage); | ||
664 | |||
665 | GNUNET_MQ_hd_var_size (channel_state_result, | ||
666 | GNUNET_MESSAGE_TYPE_PSYC_STATE_RESULT, | ||
667 | struct GNUNET_OperationResultMessage); | ||
668 | |||
669 | GNUNET_MQ_hd_var_size (channel_result, | ||
670 | GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE, | ||
671 | struct GNUNET_OperationResultMessage); | ||
672 | |||
673 | struct GNUNET_MQ_MessageHandler handlers[] = { | 645 | struct GNUNET_MQ_MessageHandler handlers[] = { |
674 | make_master_start_ack_handler (mst), | 646 | GNUNET_MQ_hd_fixed_size (master_start_ack, |
675 | make_master_join_request_handler (mst), | 647 | GNUNET_MESSAGE_TYPE_PSYC_MASTER_START_ACK, |
676 | make_channel_message_handler (chn), | 648 | struct GNUNET_PSYC_CountersResultMessage, |
677 | make_channel_message_ack_handler (chn), | 649 | mst), |
678 | make_channel_history_result_handler (chn), | 650 | GNUNET_MQ_hd_var_size (master_join_request, |
679 | make_channel_state_result_handler (chn), | 651 | GNUNET_MESSAGE_TYPE_PSYC_JOIN_REQUEST, |
680 | make_channel_result_handler (chn), | 652 | struct GNUNET_PSYC_JoinRequestMessage, |
653 | mst), | ||
654 | GNUNET_MQ_hd_var_size (channel_message, | ||
655 | GNUNET_MESSAGE_TYPE_PSYC_MESSAGE, | ||
656 | struct GNUNET_PSYC_MessageHeader, | ||
657 | chn), | ||
658 | GNUNET_MQ_hd_fixed_size (channel_message_ack, | ||
659 | GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_ACK, | ||
660 | struct GNUNET_MessageHeader, | ||
661 | chn), | ||
662 | GNUNET_MQ_hd_var_size (channel_history_result, | ||
663 | GNUNET_MESSAGE_TYPE_PSYC_HISTORY_RESULT, | ||
664 | struct GNUNET_OperationResultMessage, | ||
665 | chn), | ||
666 | GNUNET_MQ_hd_var_size (channel_state_result, | ||
667 | GNUNET_MESSAGE_TYPE_PSYC_STATE_RESULT, | ||
668 | struct GNUNET_OperationResultMessage, | ||
669 | chn), | ||
670 | GNUNET_MQ_hd_var_size (channel_result, | ||
671 | GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE, | ||
672 | struct GNUNET_OperationResultMessage, | ||
673 | chn), | ||
681 | GNUNET_MQ_handler_end () | 674 | GNUNET_MQ_handler_end () |
682 | }; | 675 | }; |
683 | 676 | ||
@@ -948,42 +941,35 @@ slave_connect (struct GNUNET_PSYC_Slave *slv) | |||
948 | { | 941 | { |
949 | struct GNUNET_PSYC_Channel *chn = &slv->chn; | 942 | struct GNUNET_PSYC_Channel *chn = &slv->chn; |
950 | 943 | ||
951 | GNUNET_MQ_hd_fixed_size (slave_join_ack, | ||
952 | GNUNET_MESSAGE_TYPE_PSYC_SLAVE_JOIN_ACK, | ||
953 | struct GNUNET_PSYC_CountersResultMessage); | ||
954 | |||
955 | GNUNET_MQ_hd_var_size (slave_join_decision, | ||
956 | GNUNET_MESSAGE_TYPE_PSYC_JOIN_DECISION, | ||
957 | struct GNUNET_PSYC_JoinDecisionMessage); | ||
958 | |||
959 | GNUNET_MQ_hd_var_size (channel_message, | ||
960 | GNUNET_MESSAGE_TYPE_PSYC_MESSAGE, | ||
961 | struct GNUNET_PSYC_MessageHeader); | ||
962 | |||
963 | GNUNET_MQ_hd_fixed_size (channel_message_ack, | ||
964 | GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_ACK, | ||
965 | struct GNUNET_MessageHeader); | ||
966 | |||
967 | GNUNET_MQ_hd_var_size (channel_history_result, | ||
968 | GNUNET_MESSAGE_TYPE_PSYC_HISTORY_RESULT, | ||
969 | struct GNUNET_OperationResultMessage); | ||
970 | |||
971 | GNUNET_MQ_hd_var_size (channel_state_result, | ||
972 | GNUNET_MESSAGE_TYPE_PSYC_STATE_RESULT, | ||
973 | struct GNUNET_OperationResultMessage); | ||
974 | |||
975 | GNUNET_MQ_hd_var_size (channel_result, | ||
976 | GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE, | ||
977 | struct GNUNET_OperationResultMessage); | ||
978 | |||
979 | struct GNUNET_MQ_MessageHandler handlers[] = { | 944 | struct GNUNET_MQ_MessageHandler handlers[] = { |
980 | make_slave_join_ack_handler (slv), | 945 | GNUNET_MQ_hd_fixed_size (slave_join_ack, |
981 | make_slave_join_decision_handler (slv), | 946 | GNUNET_MESSAGE_TYPE_PSYC_SLAVE_JOIN_ACK, |
982 | make_channel_message_handler (chn), | 947 | struct GNUNET_PSYC_CountersResultMessage, |
983 | make_channel_message_ack_handler (chn), | 948 | slv), |
984 | make_channel_history_result_handler (chn), | 949 | GNUNET_MQ_hd_var_size (slave_join_decision, |
985 | make_channel_state_result_handler (chn), | 950 | GNUNET_MESSAGE_TYPE_PSYC_JOIN_DECISION, |
986 | make_channel_result_handler (chn), | 951 | struct GNUNET_PSYC_JoinDecisionMessage, |
952 | slv), | ||
953 | GNUNET_MQ_hd_var_size (channel_message, | ||
954 | GNUNET_MESSAGE_TYPE_PSYC_MESSAGE, | ||
955 | struct GNUNET_PSYC_MessageHeader, | ||
956 | chn), | ||
957 | GNUNET_MQ_hd_fixed_size (channel_message_ack, | ||
958 | GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_ACK, | ||
959 | struct GNUNET_MessageHeader, | ||
960 | chn), | ||
961 | GNUNET_MQ_hd_var_size (channel_history_result, | ||
962 | GNUNET_MESSAGE_TYPE_PSYC_HISTORY_RESULT, | ||
963 | struct GNUNET_OperationResultMessage, | ||
964 | chn), | ||
965 | GNUNET_MQ_hd_var_size (channel_state_result, | ||
966 | GNUNET_MESSAGE_TYPE_PSYC_STATE_RESULT, | ||
967 | struct GNUNET_OperationResultMessage, | ||
968 | chn), | ||
969 | GNUNET_MQ_hd_var_size (channel_result, | ||
970 | GNUNET_MESSAGE_TYPE_PSYC_RESULT_CODE, | ||
971 | struct GNUNET_OperationResultMessage, | ||
972 | chn), | ||
987 | GNUNET_MQ_handler_end () | 973 | GNUNET_MQ_handler_end () |
988 | }; | 974 | }; |
989 | 975 | ||