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/fs | |
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/fs')
-rw-r--r-- | src/fs/fs_download.c | 8 | ||||
-rw-r--r-- | src/fs/fs_list_indexed.c | 16 | ||||
-rw-r--r-- | src/fs/fs_publish.c | 24 | ||||
-rw-r--r-- | src/fs/fs_search.c | 8 | ||||
-rw-r--r-- | src/fs/fs_unindex.c | 8 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs.c | 24 |
6 files changed, 44 insertions, 44 deletions
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index 98c76882a..eacc3c2df 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c | |||
@@ -1325,12 +1325,12 @@ download_mq_error_handler (void *cls, | |||
1325 | static void | 1325 | static void |
1326 | do_reconnect (void *cls) | 1326 | do_reconnect (void *cls) |
1327 | { | 1327 | { |
1328 | GNUNET_MQ_hd_var_size (put, | ||
1329 | GNUNET_MESSAGE_TYPE_FS_PUT, | ||
1330 | struct ClientPutMessage); | ||
1331 | struct GNUNET_FS_DownloadContext *dc = cls; | 1328 | struct GNUNET_FS_DownloadContext *dc = cls; |
1332 | struct GNUNET_MQ_MessageHandler handlers[] = { | 1329 | struct GNUNET_MQ_MessageHandler handlers[] = { |
1333 | make_put_handler (dc), | 1330 | GNUNET_MQ_hd_var_size (put, |
1331 | GNUNET_MESSAGE_TYPE_FS_PUT, | ||
1332 | struct ClientPutMessage, | ||
1333 | dc), | ||
1334 | GNUNET_MQ_handler_end () | 1334 | GNUNET_MQ_handler_end () |
1335 | }; | 1335 | }; |
1336 | 1336 | ||
diff --git a/src/fs/fs_list_indexed.c b/src/fs/fs_list_indexed.c index 21385d40b..67183fce2 100644 --- a/src/fs/fs_list_indexed.c +++ b/src/fs/fs_list_indexed.c | |||
@@ -169,17 +169,17 @@ GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h, | |||
169 | GNUNET_FS_IndexedFileProcessor iterator, | 169 | GNUNET_FS_IndexedFileProcessor iterator, |
170 | void *iterator_cls) | 170 | void *iterator_cls) |
171 | { | 171 | { |
172 | GNUNET_MQ_hd_fixed_size (index_info_end, | ||
173 | GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_END, | ||
174 | struct GNUNET_MessageHeader); | ||
175 | GNUNET_MQ_hd_var_size (index_info, | ||
176 | GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_ENTRY, | ||
177 | struct IndexInfoMessage); | ||
178 | struct GNUNET_FS_GetIndexedContext *gic | 172 | struct GNUNET_FS_GetIndexedContext *gic |
179 | = GNUNET_new (struct GNUNET_FS_GetIndexedContext); | 173 | = GNUNET_new (struct GNUNET_FS_GetIndexedContext); |
180 | struct GNUNET_MQ_MessageHandler handlers[] = { | 174 | struct GNUNET_MQ_MessageHandler handlers[] = { |
181 | make_index_info_end_handler (gic), | 175 | GNUNET_MQ_hd_fixed_size (index_info_end, |
182 | make_index_info_handler (gic), | 176 | GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_END, |
177 | struct GNUNET_MessageHeader, | ||
178 | gic), | ||
179 | GNUNET_MQ_hd_var_size (index_info, | ||
180 | GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_ENTRY, | ||
181 | struct IndexInfoMessage, | ||
182 | gic), | ||
183 | GNUNET_MQ_handler_end () | 183 | GNUNET_MQ_handler_end () |
184 | }; | 184 | }; |
185 | struct GNUNET_MQ_Envelope *env; | 185 | struct GNUNET_MQ_Envelope *env; |
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c index 01305d678..5820c3d0c 100644 --- a/src/fs/fs_publish.c +++ b/src/fs/fs_publish.c | |||
@@ -795,16 +795,16 @@ static void | |||
795 | hash_for_index_cb (void *cls, | 795 | hash_for_index_cb (void *cls, |
796 | const struct GNUNET_HashCode *res) | 796 | const struct GNUNET_HashCode *res) |
797 | { | 797 | { |
798 | GNUNET_MQ_hd_fixed_size (index_start_ok, | ||
799 | GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK, | ||
800 | struct GNUNET_MessageHeader); | ||
801 | GNUNET_MQ_hd_var_size (index_start_failed, | ||
802 | GNUNET_MESSAGE_TYPE_FS_INDEX_START_FAILED, | ||
803 | struct GNUNET_MessageHeader); | ||
804 | struct GNUNET_FS_PublishContext *pc = cls; | 798 | struct GNUNET_FS_PublishContext *pc = cls; |
805 | struct GNUNET_MQ_MessageHandler handlers[] = { | 799 | struct GNUNET_MQ_MessageHandler handlers[] = { |
806 | make_index_start_ok_handler (pc), | 800 | GNUNET_MQ_hd_fixed_size (index_start_ok, |
807 | make_index_start_failed_handler (pc), | 801 | GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK, |
802 | struct GNUNET_MessageHeader, | ||
803 | pc), | ||
804 | GNUNET_MQ_hd_var_size (index_start_failed, | ||
805 | GNUNET_MESSAGE_TYPE_FS_INDEX_START_FAILED, | ||
806 | struct GNUNET_MessageHeader, | ||
807 | pc), | ||
808 | GNUNET_MQ_handler_end () | 808 | GNUNET_MQ_handler_end () |
809 | }; | 809 | }; |
810 | struct GNUNET_FS_FileInformation *p; | 810 | struct GNUNET_FS_FileInformation *p; |
@@ -1003,11 +1003,11 @@ loc_mq_error_handler (void *cls, | |||
1003 | static void | 1003 | static void |
1004 | create_loc_uri (struct GNUNET_FS_PublishContext *pc) | 1004 | create_loc_uri (struct GNUNET_FS_PublishContext *pc) |
1005 | { | 1005 | { |
1006 | GNUNET_MQ_hd_fixed_size (signature_response, | ||
1007 | GNUNET_MESSAGE_TYPE_FS_REQUEST_LOC_SIGNATURE, | ||
1008 | struct ResponseLocSignatureMessage); | ||
1009 | struct GNUNET_MQ_MessageHandler handlers[] = { | 1006 | struct GNUNET_MQ_MessageHandler handlers[] = { |
1010 | make_signature_response_handler (pc), | 1007 | GNUNET_MQ_hd_fixed_size (signature_response, |
1008 | GNUNET_MESSAGE_TYPE_FS_REQUEST_LOC_SIGNATURE, | ||
1009 | struct ResponseLocSignatureMessage, | ||
1010 | pc), | ||
1011 | GNUNET_MQ_handler_end () | 1011 | GNUNET_MQ_handler_end () |
1012 | }; | 1012 | }; |
1013 | struct GNUNET_MQ_Envelope *env; | 1013 | struct GNUNET_MQ_Envelope *env; |
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c index 8a3652e3f..7874bb6e0 100644 --- a/src/fs/fs_search.c +++ b/src/fs/fs_search.c | |||
@@ -1234,12 +1234,12 @@ search_mq_error_handler (void *cls, | |||
1234 | static void | 1234 | static void |
1235 | do_reconnect (void *cls) | 1235 | do_reconnect (void *cls) |
1236 | { | 1236 | { |
1237 | GNUNET_MQ_hd_var_size (result, | ||
1238 | GNUNET_MESSAGE_TYPE_FS_PUT, | ||
1239 | struct ClientPutMessage); | ||
1240 | struct GNUNET_FS_SearchContext *sc = cls; | 1237 | struct GNUNET_FS_SearchContext *sc = cls; |
1241 | struct GNUNET_MQ_MessageHandler handlers[] = { | 1238 | struct GNUNET_MQ_MessageHandler handlers[] = { |
1242 | make_result_handler (sc), | 1239 | GNUNET_MQ_hd_var_size (result, |
1240 | GNUNET_MESSAGE_TYPE_FS_PUT, | ||
1241 | struct ClientPutMessage, | ||
1242 | sc), | ||
1243 | GNUNET_MQ_handler_end () | 1243 | GNUNET_MQ_handler_end () |
1244 | }; | 1244 | }; |
1245 | 1245 | ||
diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c index f43725a59..2a024ecbb 100644 --- a/src/fs/fs_unindex.c +++ b/src/fs/fs_unindex.c | |||
@@ -288,11 +288,11 @@ unindex_mq_error_handler (void *cls, | |||
288 | static void | 288 | static void |
289 | unindex_finish (struct GNUNET_FS_UnindexContext *uc) | 289 | unindex_finish (struct GNUNET_FS_UnindexContext *uc) |
290 | { | 290 | { |
291 | GNUNET_MQ_hd_fixed_size (unindex_response, | ||
292 | GNUNET_MESSAGE_TYPE_FS_UNINDEX_OK, | ||
293 | struct GNUNET_MessageHeader); | ||
294 | struct GNUNET_MQ_MessageHandler handlers[] = { | 291 | struct GNUNET_MQ_MessageHandler handlers[] = { |
295 | make_unindex_response_handler (uc), | 292 | GNUNET_MQ_hd_fixed_size (unindex_response, |
293 | GNUNET_MESSAGE_TYPE_FS_UNINDEX_OK, | ||
294 | struct GNUNET_MessageHeader, | ||
295 | uc), | ||
296 | GNUNET_MQ_handler_end () | 296 | GNUNET_MQ_handler_end () |
297 | }; | 297 | }; |
298 | char *emsg; | 298 | char *emsg; |
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index bc0da09bc..4131b1670 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c | |||
@@ -617,22 +617,22 @@ static int | |||
617 | main_init (struct GNUNET_SERVER_Handle *server, | 617 | main_init (struct GNUNET_SERVER_Handle *server, |
618 | const struct GNUNET_CONFIGURATION_Handle *c) | 618 | const struct GNUNET_CONFIGURATION_Handle *c) |
619 | { | 619 | { |
620 | GNUNET_MQ_hd_var_size (p2p_get, | ||
621 | GNUNET_MESSAGE_TYPE_FS_GET, | ||
622 | struct GetMessage); | ||
623 | GNUNET_MQ_hd_var_size (p2p_put, | ||
624 | GNUNET_MESSAGE_TYPE_FS_PUT, | ||
625 | struct PutMessage); | ||
626 | GNUNET_MQ_hd_fixed_size (p2p_migration_stop, | ||
627 | GNUNET_MESSAGE_TYPE_FS_MIGRATION_STOP, | ||
628 | struct MigrationStopMessage); | ||
629 | struct GNUNET_MQ_MessageHandler no_p2p_handlers[] = { | 620 | struct GNUNET_MQ_MessageHandler no_p2p_handlers[] = { |
630 | GNUNET_MQ_handler_end () | 621 | GNUNET_MQ_handler_end () |
631 | }; | 622 | }; |
632 | struct GNUNET_MQ_MessageHandler p2p_handlers[] = { | 623 | struct GNUNET_MQ_MessageHandler p2p_handlers[] = { |
633 | make_p2p_get_handler (NULL), | 624 | GNUNET_MQ_hd_var_size (p2p_get, |
634 | make_p2p_put_handler (NULL), | 625 | GNUNET_MESSAGE_TYPE_FS_GET, |
635 | make_p2p_migration_stop_handler (NULL), | 626 | struct GetMessage, |
627 | NULL), | ||
628 | GNUNET_MQ_hd_var_size (p2p_put, | ||
629 | GNUNET_MESSAGE_TYPE_FS_PUT, | ||
630 | struct PutMessage, | ||
631 | NULL), | ||
632 | GNUNET_MQ_hd_fixed_size (p2p_migration_stop, | ||
633 | GNUNET_MESSAGE_TYPE_FS_MIGRATION_STOP, | ||
634 | struct MigrationStopMessage, | ||
635 | NULL), | ||
636 | GNUNET_MQ_handler_end () | 636 | GNUNET_MQ_handler_end () |
637 | }; | 637 | }; |
638 | static const struct GNUNET_SERVER_MessageHandler handlers[] = { | 638 | static const struct GNUNET_SERVER_MessageHandler handlers[] = { |