Changeset 11301


Ignore:
Timestamp:
Oct 11, 2010, 9:44:46 PM (11 years ago)
Author:
charles
Message:

(trunk) #3618 "FreeBSD 8.1 & GCC 4.2.1 compiler warnings" -- fix some compiler warnings.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/fdlimit.c

    r10998 r11301  
    232232
    233233int
    234 tr_prefetch( int fd, off_t offset, size_t count )
     234tr_prefetch( int fd UNUSED, off_t offset UNUSED, size_t count UNUSED )
    235235{
    236236#ifdef HAVE_POSIX_FADVISE
  • trunk/libtransmission/peer-mgr.c

    r11283 r11301  
    837837pieceListSort( Torrent * t, int mode )
    838838{
    839     int(*compar)(const void *, const void *);
    840 
    841839    assert( mode==PIECES_SORTED_BY_INDEX
    842840         || mode==PIECES_SORTED_BY_WEIGHT );
    843841
    844     switch( mode ) {
    845         case PIECES_SORTED_BY_WEIGHT: compar = comparePieceByWeight; break;
    846         case PIECES_SORTED_BY_INDEX: compar = comparePieceByIndex; break;
    847         default: assert( 0 && "unhandled" );  break;
    848     }
    849 
    850842    weightTorrent = t->tor;
    851     qsort( t->pieces, t->pieceCount,
    852            sizeof( struct weighted_piece ), compar );
     843
     844    if( mode == PIECES_SORTED_BY_WEIGHT )
     845        qsort( t->pieces, t->pieceCount, sizeof( struct weighted_piece ), comparePieceByWeight );
     846    else
     847        qsort( t->pieces, t->pieceCount, sizeof( struct weighted_piece ), comparePieceByIndex );
    853848}
    854849
  • trunk/libtransmission/torrent-magnet.c

    r11280 r11301  
    269269                    if( success && !tr_getBlockSize( info.pieceSize ) )
    270270                    {
    271                         tr_torrentSetLocalError( tor, _( "Magnet torrent's metadata is not usable" ) );
     271                        tr_torrentSetLocalError( tor, "%s", _( "Magnet torrent's metadata is not usable" ) );
    272272                        success = FALSE;
    273273                    }
  • trunk/libtransmission/torrent.c

    r11299 r11301  
    14851485    if( tor->preVerifyTotal && !tr_cpHaveTotal( &tor->completion ) )
    14861486    {
    1487         tr_torrentSetLocalError( tor, _( "No data found!  Reconnect any disconnected drives, use \"Set Location\", or restart the torrent to re-download." ) );
     1487        tr_torrentSetLocalError( tor, "%s", _( "No data found!  Reconnect any disconnected drives, use \"Set Location\", or restart the torrent to re-download." ) );
    14881488    }
    14891489    else
     
    15681568    if( tor->preVerifyTotal && !tr_cpHaveTotal( &tor->completion ) )
    15691569    {
    1570         tr_torrentSetLocalError( tor, _( "Can't find local data.  Try \"Set Location\" to find it, or restart the torrent to re-download." ) );
     1570        tr_torrentSetLocalError( tor, "%s", _( "Can't find local data.  Try \"Set Location\" to find it, or restart the torrent to re-download." ) );
    15711571    }
    15721572    else if( tor->startAfterVerify )
     
    16811681    tr_bencDictAddInt( d, "date", tr_time( ) );
    16821682
    1683     tr_torinf( tor, _( "Removing torrent" ) );
     1683    tr_torinf( tor, "%s", _( "Removing torrent" ) );
    16841684
    16851685    stopTorrent( tor );
  • trunk/third-party/dht/dht.c

    r10917 r11301  
    381381   root of the tree, so bits are numbered from the start. */
    382382
    383 static inline int
     383static int
    384384id_cmp(const unsigned char *restrict id1, const unsigned char *restrict id2)
    385385{
     
    12251225{
    12261226    int i, len;
    1227     struct storage *st = storage;
     1227    struct storage *st;
    12281228    unsigned char *ip;
    12291229    unsigned short port;
    1230 
    1231     st = find_storage(id);
    1232 
    1233     if(st == NULL) {
    1234         if(numstorage >= DHT_MAX_HASHES)
    1235             return -1;
    1236         st = calloc(1, sizeof(struct storage));
    1237         if(st == NULL) return -1;
    1238         memcpy(st->id, id, 20);
    1239         st->next = storage;
    1240         storage = st;
    1241         numstorage++;
    1242     }
    12431230
    12441231    if(sa->sa_family == AF_INET) {
     
    12521239        len = 16;
    12531240        port = ntohs(sin6->sin6_port);
     1241    } else {
     1242        return -1;
     1243    }
     1244
     1245    st = find_storage(id);
     1246
     1247    if(st == NULL) {
     1248        if(numstorage >= DHT_MAX_HASHES)
     1249            return -1;
     1250        st = calloc(1, sizeof(struct storage));
     1251        if(st == NULL) return -1;
     1252        memcpy(st->id, id, 20);
     1253        st->next = storage;
     1254        storage = st;
     1255        numstorage++;
    12541256    }
    12551257
Note: See TracChangeset for help on using the changeset viewer.