aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2018-08-24 10:39:10 +0200
committerJulius Bünger <buenger@mytum.de>2018-08-24 10:39:10 +0200
commit2cb60679f6078d53477859aedbee1210edfb8327 (patch)
tree93591698fe7515623a7c4e64c6f23ebc00c23e04
parent19762ee38c596516abb811c727d80196679b79e0 (diff)
downloadgnunet-2cb60679f6078d53477859aedbee1210edfb8327.tar.gz
gnunet-2cb60679f6078d53477859aedbee1210edfb8327.zip
Refactor code cosmetically (rps profiler)
-rw-r--r--src/rps/gnunet-rps-profiler.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/src/rps/gnunet-rps-profiler.c b/src/rps/gnunet-rps-profiler.c
index 277688b56..a40a067ae 100644
--- a/src/rps/gnunet-rps-profiler.c
+++ b/src/rps/gnunet-rps-profiler.c
@@ -960,6 +960,7 @@ shutdown_op (void *cls)
960{ 960{
961 unsigned int i; 961 unsigned int i;
962 struct OpListEntry *entry; 962 struct OpListEntry *entry;
963 (void) cls;
963 964
964 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 965 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
965 "Shutdown task scheduled, going down.\n"); 966 "Shutdown task scheduled, going down.\n");
@@ -999,6 +1000,8 @@ shutdown_op (void *cls)
999static void 1000static void
1000trigger_shutdown (void *cls) 1001trigger_shutdown (void *cls)
1001{ 1002{
1003 (void) cls;
1004
1002 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 1005 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1003 "Shutdown was triggerd by timeout, going down.\n"); 1006 "Shutdown was triggerd by timeout, going down.\n");
1004 shutdown_task = NULL; 1007 shutdown_task = NULL;
@@ -1013,6 +1016,7 @@ static void
1013post_test_op (void *cls) 1016post_test_op (void *cls)
1014{ 1017{
1015 unsigned int i; 1018 unsigned int i;
1019 (void) cls;
1016 1020
1017 post_test_task = NULL; 1021 post_test_task = NULL;
1018 post_test = GNUNET_YES; 1022 post_test = GNUNET_YES;
@@ -1080,6 +1084,7 @@ info_cb (void *cb_cls,
1080 const char *emsg) 1084 const char *emsg)
1081{ 1085{
1082 struct OpListEntry *entry = (struct OpListEntry *) cb_cls; 1086 struct OpListEntry *entry = (struct OpListEntry *) cb_cls;
1087 (void) op;
1083 1088
1084 if (GNUNET_YES == in_shutdown || GNUNET_YES == post_test) 1089 if (GNUNET_YES == in_shutdown || GNUNET_YES == post_test)
1085 { 1090 {
@@ -1238,11 +1243,16 @@ stat_disconnect_adapter (void *cls, void *op_result)
1238 * operation has executed successfully. 1243 * operation has executed successfully.
1239 */ 1244 */
1240static void 1245static void
1241stat_complete_cb (void *cls, struct GNUNET_TESTBED_Operation *op, 1246stat_complete_cb (void *cls,
1242 void *ca_result, const char *emsg ) 1247 struct GNUNET_TESTBED_Operation *op,
1248 void *ca_result,
1249 const char *emsg )
1243{ 1250{
1244 //struct GNUNET_STATISTICS_Handle *sh = ca_result; 1251 //struct GNUNET_STATISTICS_Handle *sh = ca_result;
1245 //struct RPSPeer *peer = (struct RPSPeer *) cls; 1252 //struct RPSPeer *peer = (struct RPSPeer *) cls;
1253 (void) cls;
1254 (void) op;
1255 (void) ca_result;
1246 1256
1247 if (NULL != emsg) 1257 if (NULL != emsg)
1248 { 1258 {
@@ -1552,6 +1562,7 @@ churn_cb (void *cls,
1552{ 1562{
1553 // FIXME 1563 // FIXME
1554 struct OpListEntry *entry = cls; 1564 struct OpListEntry *entry = cls;
1565 (void) op;
1555 1566
1556 if (GNUNET_YES == in_shutdown || GNUNET_YES == post_test) 1567 if (GNUNET_YES == in_shutdown || GNUNET_YES == post_test)
1557 { 1568 {
@@ -1687,6 +1698,7 @@ churn (void *cls)
1687 double prob_go_offline; 1698 double prob_go_offline;
1688 double portion_go_online; 1699 double portion_go_online;
1689 double portion_go_offline; 1700 double portion_go_offline;
1701 (void) cls;
1690 1702
1691 if (GNUNET_YES == in_shutdown || GNUNET_YES == post_test) 1703 if (GNUNET_YES == in_shutdown || GNUNET_YES == post_test)
1692 { 1704 {
@@ -1866,6 +1878,7 @@ file_name_cb (void *cls, const char *filename)
1866 struct GNUNET_CRYPTO_AuthKey auth_key; 1878 struct GNUNET_CRYPTO_AuthKey auth_key;
1867 const char *key_char; 1879 const char *key_char;
1868 uint32_t i; 1880 uint32_t i;
1881 (void) cls;
1869 1882
1870 key_char = filename + 20; /* Length of "/tmp/rps/sampler_el-" */ 1883 key_char = filename + 20; /* Length of "/tmp/rps/sampler_el-" */
1871 tofile (filename, "--------------------------\n"); 1884 tofile (filename, "--------------------------\n");
@@ -1913,8 +1926,8 @@ static uint32_t binom (uint32_t n, uint32_t k)
1913{ 1926{
1914 //GNUNET_assert (n >= k); 1927 //GNUNET_assert (n >= k);
1915 if (k > n) return 0; 1928 if (k > n) return 0;
1916 if (0 > n) return 0; 1929 if (0 > n) return 0; /* just for clarity - always false */
1917 if (0 > k) return 0; 1930 if (0 > k) return 0; /* just for clarity - always false */
1918 if (0 == k) return 1; 1931 if (0 == k) return 1;
1919 return fac (n) 1932 return fac (n)
1920 / 1933 /
@@ -2258,7 +2271,7 @@ void view_update_cb (void *cls,
2258 "%" PRIu64 " %" PRIu32 "", 2271 "%" PRIu64 " %" PRIu32 "",
2259 rps_peer->index, 2272 rps_peer->index,
2260 view_size); 2273 view_size);
2261 for (int i = 0; i < view_size; i++) 2274 for (uint64_t i = 0; i < view_size; i++)
2262 { 2275 {
2263 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2276 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2264 "\t%s\n", GNUNET_i2s (&peers[i])); 2277 "\t%s\n", GNUNET_i2s (&peers[i]));
@@ -2575,6 +2588,9 @@ test_run (void *cls,
2575{ 2588{
2576 unsigned int i; 2589 unsigned int i;
2577 struct OpListEntry *entry; 2590 struct OpListEntry *entry;
2591 (void) cls;
2592 (void) h;
2593 (void) links_failed;
2578 2594
2579 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "RUN was called\n"); 2595 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "RUN was called\n");
2580 2596
@@ -2666,11 +2682,14 @@ test_run (void *cls,
2666 */ 2682 */
2667static void 2683static void
2668run (void *cls, 2684run (void *cls,
2669 char *const *args, 2685 char *const *args,
2670 const char *cfgfile, 2686 const char *cfgfile,
2671 const struct GNUNET_CONFIGURATION_Handle *cfg) 2687 const struct GNUNET_CONFIGURATION_Handle *cfg)
2672{ 2688{
2673 //int ret_value; 2689 //int ret_value;
2690 (void) cls;
2691 (void) args;
2692 (void) cfgfile;
2674 2693
2675 /* Defaults for tests */ 2694 /* Defaults for tests */
2676 churn_task = NULL; 2695 churn_task = NULL;