[tor-commits] [tor/master] Rename routerstatus_has_changed to routerstatus_has_visibly_changed

teor at torproject.org teor at torproject.org
Mon Jan 20 05:53:03 UTC 2020


commit 152cbf2a5987128efc708f99b10cd6c8ad9862d8
Author: Nick Mathewson <nickm at torproject.org>
Date:   Fri Jan 17 09:22:12 2020 -0500

    Rename routerstatus_has_changed to routerstatus_has_visibly_changed
    
    This is an automated commit, generated by this command:
    
    ./scripts/maint/rename_c_identifier.py \
            routerstatus_has_changed routerstatus_has_visibly_changed
    
    It was generated with --no-verify, since it introduces a wide line.
    I'll fix it in a subsequent commit.
---
 src/feature/nodelist/fmt_routerstatus.c | 2 +-
 src/feature/nodelist/networkstatus.c    | 4 ++--
 src/feature/nodelist/networkstatus.h    | 2 +-
 src/feature/nodelist/routerstatus_st.h  | 2 +-
 src/test/test_nodelist.c                | 8 ++++----
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/feature/nodelist/fmt_routerstatus.c b/src/feature/nodelist/fmt_routerstatus.c
index dc44a6ef9..2026d0c58 100644
--- a/src/feature/nodelist/fmt_routerstatus.c
+++ b/src/feature/nodelist/fmt_routerstatus.c
@@ -125,7 +125,7 @@ routerstatus_format_entry(const routerstatus_t *rs, const char *version,
       /* Blow up more or less nicely if we didn't get anything or not the
        * thing we expected.
        * This should be kept in sync with the function
-       * routerstatus_has_changed and the struct routerstatus_t
+       * routerstatus_has_visibly_changed and the struct routerstatus_t
        */
       if (!desc) {
         char id[HEX_DIGEST_LEN+1];
diff --git a/src/feature/nodelist/networkstatus.c b/src/feature/nodelist/networkstatus.c
index 208efcef6..03edfe62b 100644
--- a/src/feature/nodelist/networkstatus.c
+++ b/src/feature/nodelist/networkstatus.c
@@ -1612,7 +1612,7 @@ networkstatus_consensus_has_ipv6(const or_options_t* options)
  * NS_CONTROL_PORT mode.
  **/
 STATIC int
-routerstatus_has_changed(const routerstatus_t *a, const routerstatus_t *b)
+routerstatus_has_visibly_changed(const routerstatus_t *a, const routerstatus_t *b)
 {
   tor_assert(tor_memeq(a->identity_digest, b->identity_digest, DIGEST_LEN));
 
@@ -1670,7 +1670,7 @@ notify_control_networkstatus_changed(const networkstatus_t *old_c,
                      tor_memcmp(rs_old->identity_digest,
                             rs_new->identity_digest, DIGEST_LEN),
                      smartlist_add(changed, (void*) rs_new)) {
-    if (routerstatus_has_changed(rs_old, rs_new))
+    if (routerstatus_has_visibly_changed(rs_old, rs_new))
       smartlist_add(changed, (void*)rs_new);
   } SMARTLIST_FOREACH_JOIN_END(rs_old, rs_new);
 
diff --git a/src/feature/nodelist/networkstatus.h b/src/feature/nodelist/networkstatus.h
index 7b63e30e9..705bb12b8 100644
--- a/src/feature/nodelist/networkstatus.h
+++ b/src/feature/nodelist/networkstatus.h
@@ -164,7 +164,7 @@ STATIC void warn_early_consensus(const networkstatus_t *c, const char *flavor,
 extern networkstatus_t *current_ns_consensus;
 extern networkstatus_t *current_md_consensus;
 #endif /* defined(TOR_UNIT_TESTS) */
-STATIC int routerstatus_has_changed(const routerstatus_t *a,
+STATIC int routerstatus_has_visibly_changed(const routerstatus_t *a,
                                     const routerstatus_t *b);
 #endif /* defined(NETWORKSTATUS_PRIVATE) */
 
diff --git a/src/feature/nodelist/routerstatus_st.h b/src/feature/nodelist/routerstatus_st.h
index eb6c3e5cf..735c754b3 100644
--- a/src/feature/nodelist/routerstatus_st.h
+++ b/src/feature/nodelist/routerstatus_st.h
@@ -18,7 +18,7 @@
  */
 struct routerstatus_t {
  /* This should be kept in sync with the function
- * routerstatus_has_changed and the printing function
+ * routerstatus_has_visibly_changed and the printing function
  * routerstatus_format_entry in NS_CONTROL_PORT mode.
  */
   time_t published_on; /**< When was this router published? */
diff --git a/src/test/test_nodelist.c b/src/test/test_nodelist.c
index d47cfc090..c568e3698 100644
--- a/src/test/test_nodelist.c
+++ b/src/test/test_nodelist.c
@@ -1282,21 +1282,21 @@ test_nodelist_routerstatus_has_changed(void *arg)
   STMT_END
 #define ASSERT_SAME() \
   STMT_BEGIN                                                    \
-    tt_assert(! routerstatus_has_changed(&rs_orig, &rs));       \
+    tt_assert(! routerstatus_has_visibly_changed(&rs_orig, &rs));       \
     FORMAT();                                                   \
     tt_str_op(fmt_orig, OP_EQ, fmt);                            \
     COPY();                                                     \
   STMT_END
 #define ASSERT_CHANGED() \
   STMT_BEGIN                                                    \
-    tt_assert(routerstatus_has_changed(&rs_orig, &rs));         \
+    tt_assert(routerstatus_has_visibly_changed(&rs_orig, &rs));         \
     FORMAT();                                                   \
     tt_str_op(fmt_orig, OP_NE, fmt);                            \
     COPY();                                                     \
   STMT_END
 #define ASSERT_CHANGED_NO_FORMAT() \
   STMT_BEGIN                                                    \
-    tt_assert(routerstatus_has_changed(&rs_orig, &rs));         \
+    tt_assert(routerstatus_has_visibly_changed(&rs_orig, &rs));         \
     COPY();                                                     \
   STMT_END
 
@@ -1432,6 +1432,6 @@ struct testcase_t nodelist_tests[] = {
   NODE(routerstatus_describe, 0),
   NODE(extend_info_describe, 0),
   NODE(router_get_verbose_nickname, 0),
-  NODE(routerstatus_has_changed, 0),
+  NODE(routerstatus_has_visibly_changed, 0),
   END_OF_TESTCASES
 };





More information about the tor-commits mailing list