(trunk libT) silence some unused variable warnings from gcc when building with -DNDEBUG
authorJordan Lee <jordan@transmissionbt.com>
Wed, 2 Feb 2011 05:18:33 +0000 (05:18 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Wed, 2 Feb 2011 05:18:33 +0000 (05:18 +0000)
libtransmission/peer-io.c
libtransmission/tr-dht.c
libtransmission/tr-udp.c

index 8ee75ca69dbb892ba3458dc45f89b1887d41822e..64091528bc4a4f38d2c52e841f00be93d7e711e9 100644 (file)
@@ -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;
 }
index 955ff27c1027a7e6e151f660d5016a2310e6e936..bf501afed7f2c8599afb994788e755dfdf3506c0 100644 (file)
@@ -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;
index 652a18ca5e8049611d8677a6d56004dfcf3f80f6..e6cb2f308f5a47c77f1d08d1165e92a7d61adc31 100644 (file)
@@ -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);