From bd18a7210b728cab6f9cebc35cf0b4a05c50a47f Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Wed, 4 Jan 2012 10:05:41 +0100 Subject: Avoid unused variable warning when building without DEBUG. Spotted by Sam Hartman. --- lib/tcp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/tcp.c b/lib/tcp.c index ce071cd..77365c0 100644 --- a/lib/tcp.c +++ b/lib/tcp.c @@ -158,17 +158,21 @@ tcp_event_cb (struct bufferevent *bev, short events, void *user_data) { struct rs_packet *pkt = (struct rs_packet *) user_data; struct rs_connection *conn = NULL; - struct rs_peer *p = NULL; int sockerr = 0; #if defined (RS_ENABLE_TLS) unsigned long tlserr = 0; #endif +#if defined (DEBUG) + struct rs_peer *p = NULL; +#endif assert (pkt); assert (pkt->conn); - assert (pkt->conn->active_peer); conn = pkt->conn; +#if defined (DEBUG) + assert (pkt->conn->active_peer); p = conn->active_peer; +#endif conn->is_connecting = 0; if (events & BEV_EVENT_CONNECTED) -- cgit v1.1