From: Jordan Lee Date: Wed, 2 Feb 2011 05:18:33 +0000 (+0000) Subject: (trunk libT) silence some unused variable warnings from gcc when building with -DNDEBUG X-Git-Tag: 2.20b4~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fc1c5fe55347eb9771fbd200ddcd17a4f6eb918a;p=transmission (trunk libT) silence some unused variable warnings from gcc when building with -DNDEBUG --- diff --git a/libtransmission/peer-io.c b/libtransmission/peer-io.c index 8ee75ca69..64091528b 100644 --- a/libtransmission/peer-io.c +++ b/libtransmission/peer-io.c @@ -772,8 +772,7 @@ evbuffer_peek_all( struct evbuffer * buf, size_t * setme_vecCount ) const size_t byteCount = evbuffer_get_length( buf ); const int vecCount = evbuffer_peek( buf, byteCount, NULL, NULL, 0 ); struct evbuffer_iovec * iovec = tr_new0( struct evbuffer_iovec, vecCount ); - const int n = evbuffer_peek( buf, byteCount, NULL, iovec, vecCount ); - assert( vecCount == n ); + assert( vecCount == evbuffer_peek( buf, byteCount, NULL, iovec, vecCount ) ); *setme_vecCount = vecCount; return iovec; } diff --git a/libtransmission/tr-dht.c b/libtransmission/tr-dht.c index 955ff27c1..bf501afed 100644 --- a/libtransmission/tr-dht.c +++ b/libtransmission/tr-dht.c @@ -586,11 +586,10 @@ tr_dhtCallback(unsigned char *buf, int buflen, struct sockaddr *from, socklen_t fromlen, void *sv ) { - tr_session *ss = (tr_session*)sv; time_t tosleep; int rc; - assert(tr_isSession(ss)); + assert(tr_isSession(sv)); if(sv != session) return; diff --git a/libtransmission/tr-udp.c b/libtransmission/tr-udp.c index 652a18ca5..e6cb2f308 100644 --- a/libtransmission/tr-udp.c +++ b/libtransmission/tr-udp.c @@ -112,15 +112,14 @@ rebind_ipv6(tr_session *ss, tr_bool force) } static void -event_callback(int s, short type, void *sv) +event_callback(int s, short type UNUSED, void *sv) { - tr_session *ss = (tr_session*)sv; unsigned char *buf; struct sockaddr_storage from; socklen_t fromlen; int rc; - assert(tr_isSession(ss)); + assert(tr_isSession(sv)); assert(type == EV_READ); buf = malloc(4096);