jlouis used Coccinelle to scan transmission's source for redundant code that casts a type to its own type.
}
default:
{
- fprintf( stderr, "got opt [%d]\n", (int)c );
+ fprintf( stderr, "got opt [%d]\n", c );
showUsage( );
break;
}
#endif
gFd->public_socket_limit = socket_limit;
- tr_dbg( "socket limit is %d", (int)gFd->socket_limit );
+ tr_dbg( "socket limit is %d", gFd->socket_limit );
}
int
uint8_t peer_id[PEER_ID_LEN];
dbgmsg( handshake, "payload: need %d, got %zu",
- (int)HANDSHAKE_SIZE, evbuffer_get_length( inbuf ) );
+ HANDSHAKE_SIZE, evbuffer_get_length( inbuf ) );
if( evbuffer_get_length( inbuf ) < HANDSHAKE_SIZE )
return READ_LATER;
uint8_t hash[SHA_DIGEST_LENGTH];
dbgmsg( handshake, "payload: need %d, got %zu",
- (int)INCOMING_HANDSHAKE_LEN, evbuffer_get_length( inbuf ) );
+ INCOMING_HANDSHAKE_LEN, evbuffer_get_length( inbuf ) );
if( evbuffer_get_length( inbuf ) < INCOMING_HANDSHAKE_LEN )
return READ_LATER;
int len;
dbgmsg( handshake, "in readYa... need %d, have %zu",
- (int)KEY_LEN, evbuffer_get_length( inbuf ) );
+ KEY_LEN, evbuffer_get_length( inbuf ) );
if( evbuffer_get_length( inbuf ) < KEY_LEN )
return READ_LATER;
case JSON_T_FLOAT:
data->hasContent = TRUE;
- tr_bencInitReal( getNode( data ), (double)value->vu.float_value );
+ tr_bencInitReal( getNode( data ), value->vu.float_value );
break;
case JSON_T_NULL:
/* primary key: weight */
missing = tr_cpMissingBlocksInPiece( &tor->completion, a->index );
pending = a->requestCount;
- ia = missing > pending ? missing - pending : (int)(tor->blockCountInPiece + pending);
+ ia = missing > pending ? missing - pending : (tor->blockCountInPiece + pending);
missing = tr_cpMissingBlocksInPiece( &tor->completion, b->index );
pending = b->requestCount;
- ib = missing > pending ? missing - pending : (int)(tor->blockCountInPiece + pending);
+ ib = missing > pending ? missing - pending : (tor->blockCountInPiece + pending);
if( ia < ib ) return -1;
if( ia > ib ) return 1;
seconds = tv.tv_sec;
tr_localtime_r( &seconds, &now_tm );
strftime( tmp, sizeof( tmp ), "%H:%M:%S", &now_tm );
- milliseconds = (int)( tv.tv_usec / 1000 );
+ milliseconds = tv.tv_usec / 1000;
tr_snprintf( buf, buflen, "%s.%03d", tmp, milliseconds );
return buf;
void* tr_memdup( const void * src, size_t byteCount );
#define tr_new( struct_type, n_structs ) \
- ( (struct_type *) tr_malloc ( ( (size_t) sizeof ( struct_type ) ) * ( ( size_t) ( n_structs ) ) ) )
+ ( (struct_type *) tr_malloc ( sizeof ( struct_type ) * ( ( size_t) ( n_structs ) ) ) )
#define tr_new0( struct_type, n_structs ) \
- ( (struct_type *) tr_malloc0 ( ( (size_t) sizeof ( struct_type ) ) * ( ( size_t) ( n_structs ) ) ) )
+ ( (struct_type *) tr_malloc0 ( sizeof ( struct_type ) * ( ( size_t) ( n_structs ) ) ) )
#define tr_renew( struct_type, mem, n_structs ) \
- ( (struct_type *) realloc ( ( mem ), ( (size_t) sizeof ( struct_type ) ) * ( ( size_t) ( n_structs ) ) ) )
+ ( (struct_type *) realloc ( ( mem ), sizeof ( struct_type ) * ( ( size_t) ( n_structs ) ) ) )
void* tr_valloc( size_t bufLen );