Remove unused old_state var in connection_or.c

connection_or_change_state() saved an old_state to pass to
channel_tls_handle_state_change_on_orconn(), which promptly cast it to
void.  Remove this unused variable and parameter.
This commit is contained in:
Taylor Yu 2018-12-13 17:18:49 -06:00
parent e4109020e9
commit 308dde0c38
3 changed files with 1 additions and 9 deletions

View File

@ -950,7 +950,6 @@ channel_tls_listener_describe_transport_method(channel_listener_t *chan_l)
void
channel_tls_handle_state_change_on_orconn(channel_tls_t *chan,
or_connection_t *conn,
uint8_t old_state,
uint8_t state)
{
channel_t *base_chan;
@ -959,8 +958,6 @@ channel_tls_handle_state_change_on_orconn(channel_tls_t *chan,
tor_assert(conn);
tor_assert(conn->chan == chan);
tor_assert(chan->conn == conn);
/* Shut the compiler up without triggering -Wtautological-compare */
(void)old_state;
base_chan = TLS_CHAN_TO_BASE(chan);

View File

@ -49,7 +49,6 @@ channel_tls_t * channel_tls_from_base(channel_t *chan);
void channel_tls_handle_cell(cell_t *cell, or_connection_t *conn);
void channel_tls_handle_state_change_on_orconn(channel_tls_t *chan,
or_connection_t *conn,
uint8_t old_state,
uint8_t state);
void channel_tls_handle_var_cell(var_cell_t *var_cell,
or_connection_t *conn);

View File

@ -408,16 +408,12 @@ connection_or_report_broken_states(int severity, int domain)
static void
connection_or_change_state(or_connection_t *conn, uint8_t state)
{
uint8_t old_state;
tor_assert(conn);
old_state = conn->base_.state;
conn->base_.state = state;
if (conn->chan)
channel_tls_handle_state_change_on_orconn(conn->chan, conn,
old_state, state);
channel_tls_handle_state_change_on_orconn(conn->chan, conn, state);
}
/** Return the number of circuits using an or_connection_t; this used to