tighten formatting rules
[oweals/gnunet.git] / src / consensus / plugin_block_consensus.c
index 0cb64867e1d1227283f6468147b9badae185fb84..fb6da5bcd96732d86ebbe49a36580944477edb2b 100644 (file)
@@ -2,21 +2,21 @@
      This file is part of GNUnet
      Copyright (C) 2017 GNUnet e.V.
 
-     GNUnet is free software; you can redistribute it and/or modify
-     it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 3, or (at your
-     option) any later version.
+     GNUnet is free software: you can redistribute it and/or modify it
+     under the terms of the GNU Affero General Public License as published
+     by the Free Software Foundation, either version 3 of the License,
+     or (at your option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
      WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-     General Public License for more details.
+     Affero General Public License for more details.
 
-     You should have received a copy of the GNU General Public License
-     along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-     Boston, MA 02110-1301, USA.
-*/
+     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
@@ -58,13 +58,13 @@ block_plugin_consensus_evaluate (void *cls,
                                  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,
@@ -75,7 +75,8 @@ block_plugin_consensus_evaluate (void *cls,
                                 xquery,
                                 xquery_size,
                                 &ce[1],
-                                reply_block_size - sizeof (struct ConsensusElement));
+                                reply_block_size - sizeof(struct
+                                                          ConsensusElement));
 }
 
 
@@ -92,10 +93,10 @@ block_plugin_consensus_evaluate (void *cls,
  */
 static int
 block_plugin_consensus_get_key (void *cls,
-                               enum GNUNET_BLOCK_Type type,
-                               const void *block,
-                               size_t block_size,
-                              struct GNUNET_HashCode *key)
+                                enum GNUNET_BLOCK_Type type,
+                                const void *block,
+                                size_t block_size,
+                                struct GNUNET_HashCode *key)
 {
   return GNUNET_SYSERR;
 }
@@ -107,8 +108,7 @@ block_plugin_consensus_get_key (void *cls,
 void *
 libgnunet_plugin_block_consensus_init (void *cls)
 {
-  static enum GNUNET_BLOCK_Type types[] =
-  {
+  static enum GNUNET_BLOCK_Type types[] = {
     GNUNET_BLOCK_TYPE_CONSENSUS_ELEMENT,
     GNUNET_BLOCK_TYPE_ANY       /* end of list */
   };
@@ -128,10 +128,11 @@ libgnunet_plugin_block_consensus_init (void *cls)
 void *
 libgnunet_plugin_block_consensus_done (void *cls)
 {
-  struct GNUNET_TRANSPORT_PluginFunctions *api = cls;
+  struct GNUNET_BLOCK_PluginFunctions *api = cls;
 
   GNUNET_free (api);
   return NULL;
 }
 
+
 /* end of plugin_block_consensus.c */