uncrustify as demanded.
[oweals/gnunet.git] / src / consensus / plugin_block_consensus.c
index ca19b7c8d135c0b646c6b0ba1b94e22bd9d224bb..a90b451d2dbde30ee7114ed8573f2e36108576d5 100644 (file)
      WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      Affero General Public License for more details.
-    
+
      You should have received a copy of the GNU Affero General Public License
      along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
      SPDX-License-Identifier: AGPL3.0-or-later
-*/
+ */
 
 /**
  * @file consensus/plugin_block_consensus.c
  * @return characterization of result
  */
 static enum GNUNET_BLOCK_EvaluationResult
-block_plugin_consensus_evaluate (void *cls,
-                                 struct GNUNET_BLOCK_Context *ctx,
-                                 enum GNUNET_BLOCK_Type type,
-                                 struct GNUNET_BLOCK_Group *group,
-                                 enum GNUNET_BLOCK_EvaluationOptions eo,
-                                 const struct GNUNET_HashCode *query,
-                                 const void *xquery,
-                                 size_t xquery_size,
-                                 const void *reply_block,
-                                 size_t reply_block_size)
+block_plugin_consensus_evaluate(void *cls,
+                                struct GNUNET_BLOCK_Context *ctx,
+                                enum GNUNET_BLOCK_Type type,
+                                struct GNUNET_BLOCK_Group *group,
+                                enum GNUNET_BLOCK_EvaluationOptions eo,
+                                const struct GNUNET_HashCode *query,
+                                const void *xquery,
+                                size_t xquery_size,
+                                const void *reply_block,
+                                size_t reply_block_size)
 {
-  if (reply_block_size < sizeof (struct ConsensusElement))
+  if (reply_block_size < sizeof(struct ConsensusElement))
     return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
 
   const struct ConsensusElement *ce = reply_block;
 
-  if ( (0 != ce->marker) ||
-       (0 == ce->payload_type ) )
+  if ((0 != ce->marker) ||
+      (0 == ce->payload_type))
     return GNUNET_BLOCK_EVALUATION_OK_MORE;
 
-  return GNUNET_BLOCK_evaluate (ctx,
-                                type,
-                                group,
-                                eo,
-                                query,
-                                xquery,
-                                xquery_size,
-                                &ce[1],
-                                reply_block_size - sizeof (struct ConsensusElement));
+  return GNUNET_BLOCK_evaluate(ctx,
+                               type,
+                               group,
+                               eo,
+                               query,
+                               xquery,
+                               xquery_size,
+                               &ce[1],
+                               reply_block_size - sizeof(struct ConsensusElement));
 }
 
 
@@ -91,11 +91,11 @@ block_plugin_consensus_evaluate (void *cls,
  *         (or if extracting a key from a block of this type does not work)
  */
 static int
-block_plugin_consensus_get_key (void *cls,
+block_plugin_consensus_get_key(void *cls,
                                enum GNUNET_BLOCK_Type type,
                                const void *block,
                                size_t block_size,
-                              struct GNUNET_HashCode *key)
+                               struct GNUNET_HashCode *key)
 {
   return GNUNET_SYSERR;
 }
@@ -105,7 +105,7 @@ block_plugin_consensus_get_key (void *cls,
  * Entry point for the plugin.
  */
 void *
-libgnunet_plugin_block_consensus_init (void *cls)
+libgnunet_plugin_block_consensus_init(void *cls)
 {
   static enum GNUNET_BLOCK_Type types[] =
   {
@@ -114,7 +114,7 @@ libgnunet_plugin_block_consensus_init (void *cls)
   };
   struct GNUNET_BLOCK_PluginFunctions *api;
 
-  api = GNUNET_new (struct GNUNET_BLOCK_PluginFunctions);
+  api = GNUNET_new(struct GNUNET_BLOCK_PluginFunctions);
   api->evaluate = &block_plugin_consensus_evaluate;
   api->get_key = &block_plugin_consensus_get_key;
   api->types = types;
@@ -126,11 +126,11 @@ libgnunet_plugin_block_consensus_init (void *cls)
  * Exit point from the plugin.
  */
 void *
-libgnunet_plugin_block_consensus_done (void *cls)
+libgnunet_plugin_block_consensus_done(void *cls)
 {
   struct GNUNET_BLOCK_PluginFunctions *api = cls;
 
-  GNUNET_free (api);
+  GNUNET_free(api);
   return NULL;
 }