Changeset 10273


Ignore:
Timestamp:
Feb 23, 2010, 6:05:18 AM (11 years ago)
Author:
charles
Message:

(trunk libT) dead code removal -- the buffer & buflen arguments to tr_ioTestPiece() were unused

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/inout.c

    r10023 r10273  
    291291recalculateHash( tr_torrent       * tor,
    292292                 tr_piece_index_t   pieceIndex,
    293                  void             * buffer,
    294                  size_t             buflen,
    295293                 uint8_t          * setme )
    296294{
     
    298296    uint32_t offset = 0;
    299297    tr_bool  success = TRUE;
    300     uint8_t  stackbuf[MAX_STACK_ARRAY_SIZE];
     298    uint8_t  buffer[MAX_STACK_ARRAY_SIZE];
     299    const size_t buflen = MAX_STACK_ARRAY_SIZE;
    301300    SHA_CTX  sha;
    302 
    303     /* fallback buffer */
    304     if( ( buffer == NULL ) || ( buflen < 1 ) )
    305     {
    306         buffer = stackbuf;
    307         buflen = sizeof( stackbuf );
    308     }
    309301
    310302    assert( tor != NULL );
     
    335327
    336328tr_bool
    337 tr_ioTestPiece( tr_torrent        * tor,
    338                 tr_piece_index_t    pieceIndex,
    339                 void              * buffer,
    340                 size_t              buflen )
     329tr_ioTestPiece( tr_torrent * tor, tr_piece_index_t piece )
    341330{
    342331    uint8_t hash[SHA_DIGEST_LENGTH];
    343332
    344     return recalculateHash( tor, pieceIndex, buffer, buflen, hash )
    345            && !memcmp( hash, tor->info.pieces[pieceIndex].hash, SHA_DIGEST_LENGTH );
    346 }
     333    return recalculateHash( tor, piece, hash )
     334           && !memcmp( hash, tor->info.pieces[piece].hash, SHA_DIGEST_LENGTH );
     335}
  • trunk/libtransmission/inout.h

    r9868 r10273  
    5353/**
    5454 * @brief Test to see if the piece matches its metainfo's SHA1 checksum.
    55  *
    56  * @param optionalBuffer if calling tr_ioTestPiece() repeatedly, you can
    57  *                       get best performance by providing a buffer with
    58  *                       tor->info.pieceSize bytes.
    5955 */
    6056tr_bool tr_ioTestPiece( tr_torrent       * tor,
    61                         tr_piece_index_t   piece,
    62                         void             * optionalBuffer,
    63                         size_t             optionalBufferLen );
     57                        tr_piece_index_t   piece );
    6458
    6559
  • trunk/libtransmission/peer-mgr.c

    r10270 r10273  
    13361336                {
    13371337                    const tr_piece_index_t p = e->pieceIndex;
    1338                     const tr_bool ok = tr_ioTestPiece( tor, p, NULL, 0 );
     1338                    const tr_bool ok = tr_ioTestPiece( tor, p );
    13391339
    13401340                    if( !ok )
Note: See TracChangeset for help on using the changeset viewer.