Unverified Commit 152cbf2a authored by Nick Mathewson's avatar Nick Mathewson 🥔 Committed by teor
Browse files

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.
parent c3633e6b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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];
+2 −2
Original line number Diff line number Diff line
@@ -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);

+1 −1
Original line number Diff line number Diff line
@@ -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) */

+1 −1
Original line number Diff line number Diff line
@@ -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? */
+4 −4
Original line number Diff line number Diff line
@@ -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
};