Changeset 11881


Ignore:
Timestamp:
Feb 12, 2011, 5:27:47 PM (12 years ago)
Author:
jordan
Message:

(trunk) #4019 "Minor patch, kill useless casts in transmission source." -- fixed. patch by jlouis

jlouis used Coccinelle to scan transmission's source for redundant code that casts a type to its own type.

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/remote.c

    r11865 r11881  
    22782278            default:
    22792279            {
    2280                 fprintf( stderr, "got opt [%d]\n", (int)c );
     2280                fprintf( stderr, "got opt [%d]\n", c );
    22812281                showUsage( );
    22822282                break;
  • trunk/libtransmission/fdlimit.c

    r11863 r11881  
    794794    gFd->public_socket_limit = socket_limit;
    795795
    796     tr_dbg( "socket limit is %d", (int)gFd->socket_limit );
     796    tr_dbg( "socket limit is %d", gFd->socket_limit );
    797797}
    798798
  • trunk/libtransmission/handshake.c

    r11709 r11881  
    266266
    267267    dbgmsg( handshake, "payload: need %d, got %zu",
    268             (int)HANDSHAKE_SIZE, evbuffer_get_length( inbuf ) );
     268            HANDSHAKE_SIZE, evbuffer_get_length( inbuf ) );
    269269
    270270    if( evbuffer_get_length( inbuf ) < HANDSHAKE_SIZE )
     
    609609
    610610    dbgmsg( handshake, "payload: need %d, got %zu",
    611             (int)INCOMING_HANDSHAKE_LEN, evbuffer_get_length( inbuf ) );
     611            INCOMING_HANDSHAKE_LEN, evbuffer_get_length( inbuf ) );
    612612
    613613    if( evbuffer_get_length( inbuf ) < INCOMING_HANDSHAKE_LEN )
     
    758758
    759759    dbgmsg( handshake, "in readYa... need %d, have %zu",
    760             (int)KEY_LEN, evbuffer_get_length( inbuf ) );
     760            KEY_LEN, evbuffer_get_length( inbuf ) );
    761761    if( evbuffer_get_length( inbuf ) < KEY_LEN )
    762762        return READ_LATER;
  • trunk/libtransmission/json.c

    r11709 r11881  
    9292        case JSON_T_FLOAT:
    9393            data->hasContent = TRUE;
    94             tr_bencInitReal( getNode( data ), (double)value->vu.float_value );
     94            tr_bencInitReal( getNode( data ), value->vu.float_value );
    9595            break;
    9696
  • trunk/libtransmission/peer-mgr.c

    r11783 r11881  
    804804    missing = tr_cpMissingBlocksInPiece( &tor->completion, a->index );
    805805    pending = a->requestCount;
    806     ia = missing > pending ? missing - pending : (int)(tor->blockCountInPiece + pending);
     806    ia = missing > pending ? missing - pending : (tor->blockCountInPiece + pending);
    807807    missing = tr_cpMissingBlocksInPiece( &tor->completion, b->index );
    808808    pending = b->requestCount;
    809     ib = missing > pending ? missing - pending : (int)(tor->blockCountInPiece + pending);
     809    ib = missing > pending ? missing - pending : (tor->blockCountInPiece + pending);
    810810    if( ia < ib ) return -1;
    811811    if( ia > ib ) return 1;
  • trunk/libtransmission/utils.c

    r11798 r11881  
    202202    tr_localtime_r( &seconds, &now_tm );
    203203    strftime( tmp, sizeof( tmp ), "%H:%M:%S", &now_tm );
    204     milliseconds = (int)( tv.tv_usec / 1000 );
     204    milliseconds = tv.tv_usec / 1000;
    205205    tr_snprintf( buf, buflen, "%s.%03d", tmp, milliseconds );
    206206
  • trunk/libtransmission/utils.h

    r11775 r11881  
    324324
    325325#define tr_new( struct_type, n_structs )           \
    326     ( (struct_type *) tr_malloc ( ( (size_t) sizeof ( struct_type ) ) * ( ( size_t) ( n_structs ) ) ) )
     326    ( (struct_type *) tr_malloc ( sizeof ( struct_type ) * ( ( size_t) ( n_structs ) ) ) )
    327327
    328328#define tr_new0( struct_type, n_structs )          \
    329     ( (struct_type *) tr_malloc0 ( ( (size_t) sizeof ( struct_type ) ) * ( ( size_t) ( n_structs ) ) ) )
     329    ( (struct_type *) tr_malloc0 ( sizeof ( struct_type ) * ( ( size_t) ( n_structs ) ) ) )
    330330
    331331#define tr_renew( struct_type, mem, n_structs )    \
    332     ( (struct_type *) realloc ( ( mem ), ( (size_t) sizeof ( struct_type ) ) * ( ( size_t) ( n_structs ) ) ) )
     332    ( (struct_type *) realloc ( ( mem ), sizeof ( struct_type ) * ( ( size_t) ( n_structs ) ) ) )
    333333
    334334void* tr_valloc( size_t bufLen );
Note: See TracChangeset for help on using the changeset viewer.