summaryrefslogtreecommitdiff
path: root/src/consensus
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-10-31 13:03:48 +0100
committerChristian Grothoff <christian@grothoff.org>2019-10-31 13:03:48 +0100
commit7e3cf5f461eb4fbb7581672bf0835da07c378136 (patch)
treebdc3874b7894242b095b892f1ed3e81a4d4f06c0 /src/consensus
parent01b480d6d026e0c537dc284a7e7df2c0320a3528 (diff)
tighten formatting rules
Diffstat (limited to 'src/consensus')
-rw-r--r--src/consensus/consensus_api.c2
-rw-r--r--src/consensus/gnunet-service-consensus.c27
-rw-r--r--src/consensus/plugin_block_consensus.c1
-rw-r--r--src/consensus/test_consensus_api.c2
4 files changed, 19 insertions, 13 deletions
diff --git a/src/consensus/consensus_api.c b/src/consensus/consensus_api.c
index c4350adaf..06b4c88ef 100644
--- a/src/consensus/consensus_api.c
+++ b/src/consensus/consensus_api.c
@@ -259,6 +259,7 @@ idc_adapter (void *cls)
GNUNET_free (i);
}
+
/**
* Insert an element in the set being reconsiled. Must not be called after
* "GNUNET_CONSENSUS_conclude".
@@ -344,4 +345,5 @@ GNUNET_CONSENSUS_destroy (struct GNUNET_CONSENSUS_Handle *consensus)
GNUNET_free (consensus);
}
+
/* end of consensus_api.c */
diff --git a/src/consensus/gnunet-service-consensus.c b/src/consensus/gnunet-service-consensus.c
index 8ef70eee8..160d352d7 100644
--- a/src/consensus/gnunet-service-consensus.c
+++ b/src/consensus/gnunet-service-consensus.c
@@ -100,7 +100,6 @@ struct TaskKey
};
-
struct SetKey
{
int set_kind GNUNET_PACKED;
@@ -403,7 +402,6 @@ struct SetHandle
};
-
/**
* A consensus session consists of one local client and the remote authorities.
*/
@@ -590,6 +588,7 @@ setname (uint16_t kind)
}
}
+
static const char *
rfnname (uint16_t kind)
{
@@ -605,6 +604,7 @@ rfnname (uint16_t kind)
}
}
+
static const char *
diffname (uint16_t kind)
{
@@ -622,6 +622,7 @@ diffname (uint16_t kind)
}
}
+
#ifdef GNUNET_EXTRA_LOGGING
@@ -635,6 +636,7 @@ debug_str_element (const struct GNUNET_SET_Element *el)
return GNUNET_h2s (&hash);
}
+
static const char *
debug_str_task_key (struct TaskKey *tk)
{
@@ -648,6 +650,7 @@ debug_str_task_key (struct TaskKey *tk)
return buf;
}
+
static const char *
debug_str_diff_key (struct DiffKey *dk)
{
@@ -660,6 +663,7 @@ debug_str_diff_key (struct DiffKey *dk)
return buf;
}
+
static const char *
debug_str_set_key (const struct SetKey *sk)
{
@@ -685,6 +689,7 @@ debug_str_rfn_key (const struct RfnKey *rk)
return buf;
}
+
#endif /* GNUNET_EXTRA_LOGGING */
@@ -1192,6 +1197,7 @@ set_result_cb (void *cls,
}
}
+
#ifdef EVIL
enum EvilnessType
@@ -1349,6 +1355,7 @@ cleanup:
free (evil_subtype_str);
}
+
#endif
@@ -1538,6 +1545,7 @@ put_diff (struct ConsensusSession *session,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
}
+
static void
put_set (struct ConsensusSession *session,
struct SetEntry *set)
@@ -1570,7 +1578,6 @@ put_rfn (struct ConsensusSession *session,
}
-
static void
task_cancel_reconcile (struct TaskEntry *task)
{
@@ -1676,6 +1683,8 @@ diff_destroy (struct DiffEntry *diff)
GNUNET_CONTAINER_multihashmap_destroy (diff->changes);
GNUNET_free (diff);
}
+
+
#endif
@@ -1882,7 +1891,6 @@ finish_step (struct Step *step)
}
-
/**
* Apply the result from one round of gradecasts (i.e. every peer
* should have gradecasted) to the peer's current set.
@@ -2326,8 +2334,7 @@ task_start_eval_echo (struct TaskEntry *task)
can't simply send "nothing" for the value. Thus we mark our 'confirm'
reconciliation as contested. Other peers might not know that the
leader is faulty, thus we still re-distribute in the confirmation
- round. */
- output_set->is_contested = GNUNET_YES;
+ round. */output_set->is_contested = GNUNET_YES;
}
switch (majority_vote)
@@ -2387,6 +2394,7 @@ task_start_finish (struct TaskEntry *task)
task);
}
+
static void
start_task (struct ConsensusSession *session, struct TaskEntry *task)
{
@@ -2403,8 +2411,6 @@ start_task (struct ConsensusSession *session, struct TaskEntry *task)
}
-
-
/*
* Run all steps of the session that don't any
* more dependencies.
@@ -2452,7 +2458,6 @@ run_ready_steps (struct ConsensusSession *session)
}
-
static void
finish_task (struct TaskEntry *task)
{
@@ -2703,7 +2708,6 @@ set_listen_cb (void *cls,
}
-
static void
put_task (struct GNUNET_CONTAINER_MultiHashMap *taskmap,
struct TaskEntry *t)
@@ -2754,7 +2758,6 @@ install_step_timeouts (struct ConsensusSession *session)
}
-
/*
* Arrange two peers in some canonical order.
*/
@@ -3134,7 +3137,6 @@ construct_task_graph (struct ConsensusSession *session)
step = NULL;
-
/* Byzantine union */
/* sequential repetitions of the gradecasts */
@@ -3193,7 +3195,6 @@ construct_task_graph (struct ConsensusSession *session)
}
-
/**
* Check join message.
*
diff --git a/src/consensus/plugin_block_consensus.c b/src/consensus/plugin_block_consensus.c
index 1caf4fc39..fb6da5bcd 100644
--- a/src/consensus/plugin_block_consensus.c
+++ b/src/consensus/plugin_block_consensus.c
@@ -134,4 +134,5 @@ libgnunet_plugin_block_consensus_done (void *cls)
return NULL;
}
+
/* end of plugin_block_consensus.c */
diff --git a/src/consensus/test_consensus_api.c b/src/consensus/test_consensus_api.c
index d32bc06ed..235a67484 100644
--- a/src/consensus/test_consensus_api.c
+++ b/src/consensus/test_consensus_api.c
@@ -44,6 +44,7 @@ conclude_done (void *cls)
GNUNET_SCHEDULER_shutdown ();
}
+
static void
on_new_element (void *cls,
const struct GNUNET_SET_Element *element)
@@ -51,6 +52,7 @@ on_new_element (void *cls,
elements_received++;
}
+
static void
insert_done (void *cls, int success)
{