(trunk libT) a bit of futzing: remove a few more unnecessary casts from void*

This commit is contained in:
Jordan Lee 2011-03-03 21:51:11 +00:00
parent 0cf05fdffd
commit 020bde5ce6
3 changed files with 10 additions and 12 deletions

View File

@ -186,7 +186,7 @@ rebind_ipv6(tr_session *ss, tr_bool force)
static void
event_callback(int s, short type UNUSED, void *sv)
{
tr_session *ss = (tr_session*)sv;
tr_session *ss = sv;
unsigned char *buf;
struct sockaddr_storage from;
socklen_t fromlen;

View File

@ -101,7 +101,7 @@ static struct event *utp_timer = NULL;
static void
incoming(void *closure, struct UTPSocket *s)
{
tr_session *ss = (tr_session*)closure;
tr_session *ss = closure;
struct sockaddr_storage from_storage;
struct sockaddr *from = (struct sockaddr*)&from_storage;
socklen_t fromlen = sizeof(from_storage);
@ -137,7 +137,7 @@ void
tr_utpSendTo(void *closure, const unsigned char *buf, size_t buflen,
const struct sockaddr *to, socklen_t tolen)
{
tr_session *ss = (tr_session*)closure;
tr_session *ss = closure;
if(to->sa_family == AF_INET && ss->udp_socket)
sendto(ss->udp_socket, buf, buflen, 0, to, tolen);

View File

@ -360,10 +360,8 @@ tr_memdup( const void * src, size_t byteCount )
***/
void
tr_set_compare( const void * va,
size_t aCount,
const void * vb,
size_t bCount,
tr_set_compare( const void * va, size_t aCount,
const void * vb, size_t bCount,
int compare( const void * a, const void * b ),
size_t elementSize,
tr_set_func in_a_cb,
@ -371,8 +369,8 @@ tr_set_compare( const void * va,
tr_set_func in_both_cb,
void * userData )
{
const uint8_t * a = (const uint8_t *) va;
const uint8_t * b = (const uint8_t *) vb;
const uint8_t * a = va;
const uint8_t * b = vb;
const uint8_t * aend = a + elementSize * aCount;
const uint8_t * bend = b + elementSize * bCount;
@ -655,7 +653,7 @@ tr_buildPath( const char *first_element, ... )
element = first_element;
while( element ) {
bufLen += strlen( element ) + 1;
element = (const char*) va_arg( vl, const char* );
element = va_arg( vl, const char* );
}
pch = buf = tr_new( char, bufLen );
va_end( vl );
@ -668,7 +666,7 @@ tr_buildPath( const char *first_element, ... )
memcpy( pch, element, elementLen );
pch += elementLen;
*pch++ = TR_PATH_DELIMITER;
element = (const char*) va_arg( vl, const char* );
element = va_arg( vl, const char* );
}
va_end( vl );
@ -1216,7 +1214,7 @@ tr_removeElementFromArray( void * array,
size_t sizeof_element,
size_t nmemb )
{
char * a = (char*) array;
char * a = array;
memmove( a + sizeof_element * index_to_remove,
a + sizeof_element * ( index_to_remove + 1 ),