[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] clean up comments and whitespace a bit



commit 0e4bdc400576ba71ae885e94d32adc0e79e8e7fc
Author: Roger Dingledine <arma@xxxxxxxxxxxxxx>
Date:   Wed Feb 18 19:27:02 2015 -0500

    clean up comments and whitespace a bit
---
 src/or/dirvote.c              |   12 +++++++-----
 src/or/entrynodes.h           |    6 +++---
 src/or/routerparse.c          |    2 +-
 src/test/test_guardfraction.c |   12 ++++++------
 4 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index f5694ba..7a5154d 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -1060,7 +1060,8 @@ update_total_bandwidth_weights(const routerstatus_t *rs,
    *    E' = E + (1-F)*B, if N has the exit flag
    *
    * In this block of code, we prepare the bandwidth values by setting
-   * the default_bandwidth to F*B and guardfraction_bandwidth to (1-F)*B. */
+   * the default_bandwidth to F*B and guardfraction_bandwidth to (1-F)*B.
+   */
   if (rs->has_guardfraction) {
     guardfraction_bandwidth_t guardfraction_bw;
 
@@ -1075,10 +1076,11 @@ update_total_bandwidth_weights(const routerstatus_t *rs,
   }
 
   /* Now calculate the total bandwidth weights with or without
-     guardfraction. Depending on the flags of the relay, add its
-     bandwidth to the appropriate weight pool. If it's a guard and
-     guardfraction is enabled, add its bandwidth to both pools as
-     indicated by the previous comment. */
+   * guardfraction. Depending on the flags of the relay, add its
+   * bandwidth to the appropriate weight pool. If it's a guard and
+   * guardfraction is enabled, add its bandwidth to both pools as
+   * indicated by the previous comment.
+   */
   *T += default_bandwidth;
   if (is_exit && is_guard) {
 
diff --git a/src/or/entrynodes.h b/src/or/entrynodes.h
index 35bd748..107a562 100644
--- a/src/or/entrynodes.h
+++ b/src/or/entrynodes.h
@@ -161,11 +161,11 @@ double pathbias_get_close_success_count(entry_guard_t *guard);
 double pathbias_get_use_success_count(entry_guard_t *guard);
 
 /** Contains the bandwidth of a relay as a guard and as a non-guard
- *  after the guardfraction has been considered.  */
+ *  after the guardfraction has been considered. */
 typedef struct guardfraction_bandwidth_t {
-  /* Bandwidth as a guard after guardfraction has been considered. */
+  /** Bandwidth as a guard after guardfraction has been considered. */
   int guard_bw;
-  /* Bandwidth as a non-guard after guardfraction has been considered. */
+  /** Bandwidth as a non-guard after guardfraction has been considered. */
   int non_guard_bw;
 } guardfraction_bandwidth_t;
 
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 0e8bf8d..5a9626f 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -1827,7 +1827,7 @@ routerstatus_parse_guardfraction(const char *guardfraction_str,
   }
 
   guardfraction = (uint32_t)tor_parse_ulong(end_of_header+1,
-                                         10, 0, 100, &ok, NULL);
+                                            10, 0, 100, &ok, NULL);
   if (!ok) {
     log_warn(LD_DIR, "Invalid GuardFraction %s", escaped(guardfraction_str));
     return -1;
diff --git a/src/test/test_guardfraction.c b/src/test/test_guardfraction.c
index e9cf890..57063c9 100644
--- a/src/test/test_guardfraction.c
+++ b/src/test/test_guardfraction.c
@@ -18,8 +18,8 @@
 #include "test.h"
 #include "test_helpers.h"
 
-/* Generate a vote_routerstatus_t for a router with identity digest
-   <b>digest_in_hex</b>. */
+/** Generate a vote_routerstatus_t for a router with identity digest
+ * <b>digest_in_hex</b>. */
 static vote_routerstatus_t *
 gen_vote_routerstatus_for_tests(const char *digest_in_hex, int is_guard)
 {
@@ -169,7 +169,7 @@ test_parse_guardfraction_file_bad(void *arg)
   tor_free(guardfraction_bad);
 }
 
-/* Make sure that our test guardfraction file gets parsed properly, and
+/** Make sure that our test guardfraction file gets parsed properly, and
  * its information are applied properly to our routerstatuses. */
 static void
 test_parse_guardfraction_file_good(void *arg)
@@ -263,7 +263,7 @@ test_get_guardfraction_bandwidth(void *arg)
 }
 
 /** Parse the GuardFraction element of the consensus, and make sure it
- *  gets parsed correctly. */
+ * gets parsed correctly. */
 static void
 test_parse_guardfraction_consensus(void *arg)
 {
@@ -337,8 +337,8 @@ test_parse_guardfraction_consensus(void *arg)
   ;
 }
 
-/* Make sure that we use GuardFraction information when we should,
-   according to the torrc option and consensus parameter. */
+/** Make sure that we use GuardFraction information when we should,
+ * according to the torrc option and consensus parameter. */
 static void
 test_should_apply_guardfraction(void *arg)
 {

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits