From 8cc2bc95891cb47263671f0fdf6c2fa0e63999f6 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Wed, 27 Jun 2012 13:48:42 +0000 Subject: [PATCH] - Reorder iterator arguments --- src/mesh/mesh_block_lib.c | 12 ++++++------ src/mesh/mesh_block_lib.h | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/mesh/mesh_block_lib.c b/src/mesh/mesh_block_lib.c index b9c187e37..3ab5d5a47 100644 --- a/src/mesh/mesh_block_lib.c +++ b/src/mesh/mesh_block_lib.c @@ -66,25 +66,25 @@ int GNUNET_MESH_regex_block_check (const struct MeshRegexBlock *block, size_t size) { - return GNUNET_MESH_regex_block_iterate(NULL, block, size, &check_edge); + return GNUNET_MESH_regex_block_iterate(block, size, &check_edge, NULL); } /** * Iterate over all edges of a block of a regex state. * - * @param cls Closure for the iterator. * @param block Block to iterate over. * @param size Size of block. * @param iterator Function to call on each edge in the block. + * @param iter_cls Closure for the iterator. * * @return How many bytes of block have been processed */ int -GNUNET_MESH_regex_block_iterate (void *cls, - const struct MeshRegexBlock *block, +GNUNET_MESH_regex_block_iterate (const struct MeshRegexBlock *block, size_t size, - GNUNET_MESH_EgdeIterator iterator) + GNUNET_MESH_EgdeIterator iterator, + void *iter_cls) { struct MeshRegexEdge *edge; unsigned int n; @@ -115,7 +115,7 @@ GNUNET_MESH_regex_block_iterate (void *cls, return GNUNET_SYSERR; aux = (char *) &edge[1]; // Skip edge block if (NULL != iterator) - if (GNUNET_NO == iterator (cls, aux, n_token, &edge->key)) + if (GNUNET_NO == iterator (iter_cls, aux, n_token, &edge->key)) return GNUNET_OK; aux = &aux[n_token]; // Skip edge token } diff --git a/src/mesh/mesh_block_lib.h b/src/mesh/mesh_block_lib.h index 47e63289c..ac8a09956 100644 --- a/src/mesh/mesh_block_lib.h +++ b/src/mesh/mesh_block_lib.h @@ -69,18 +69,18 @@ typedef int (*GNUNET_MESH_EgdeIterator)(void *cls, /** * Iterate over all edges of a block of a regex state. * - * @param cls Closure for the iterator. * @param block Block to iterate over. * @param size Size of block. * @param iterator Function to call on each edge in the block. + * @param iter_cls Closure for the iterator. * * @return GNUNET_SYSERR if an error has been encountered, GNUNET_OK otherwise */ int -GNUNET_MESH_regex_block_iterate (void *cls, - const struct MeshRegexBlock *block, +GNUNET_MESH_regex_block_iterate (const struct MeshRegexBlock *block, size_t size, - GNUNET_MESH_EgdeIterator iterator); + GNUNET_MESH_EgdeIterator iterator, + void *iter_cls); #if 0 /* keep Emacsens' auto-indent happy */ { -- 2.25.1