1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-22 14:10:34 +00:00

(trunk libT) remove dead variable pieceBytesRead from verify.c. Reported by Longinus00

This commit is contained in:
Charles Kerr 2010-10-12 15:52:20 +00:00
parent b91ddc4a27
commit 5c46cdb161

View file

@ -54,7 +54,6 @@ verifyTorrent( tr_torrent * tor, tr_bool * stopFlag )
tr_bool hadPiece = 0; tr_bool hadPiece = 0;
time_t lastSleptAt = 0; time_t lastSleptAt = 0;
uint32_t piecePos = 0; uint32_t piecePos = 0;
uint32_t pieceBytesRead = 0;
tr_file_index_t fileIndex = 0; tr_file_index_t fileIndex = 0;
tr_file_index_t prevFileIndex = !fileIndex; tr_file_index_t prevFileIndex = !fileIndex;
tr_piece_index_t pieceIndex = 0; tr_piece_index_t pieceIndex = 0;
@ -103,12 +102,10 @@ verifyTorrent( tr_torrent * tor, tr_bool * stopFlag )
const ssize_t numRead = tr_pread( fd, buffer, bytesThisPass, filePos ); const ssize_t numRead = tr_pread( fd, buffer, bytesThisPass, filePos );
if( numRead == (ssize_t)bytesThisPass ) if( numRead == (ssize_t)bytesThisPass )
SHA1_Update( &sha, buffer, numRead ); SHA1_Update( &sha, buffer, numRead );
if( numRead > 0 ) {
pieceBytesRead += numRead;
#if defined HAVE_POSIX_FADVISE && defined POSIX_FADV_DONTNEED #if defined HAVE_POSIX_FADVISE && defined POSIX_FADV_DONTNEED
if( numRead > 0 )
posix_fadvise( fd, filePos, bytesThisPass, POSIX_FADV_DONTNEED ); posix_fadvise( fd, filePos, bytesThisPass, POSIX_FADV_DONTNEED );
#endif #endif
}
} }
/* move our offsets */ /* move our offsets */
@ -150,7 +147,6 @@ verifyTorrent( tr_torrent * tor, tr_bool * stopFlag )
SHA1_Init( &sha ); SHA1_Init( &sha );
++pieceIndex; ++pieceIndex;
piecePos = 0; piecePos = 0;
pieceBytesRead = 0;
} }
/* if we're finishing a file... */ /* if we're finishing a file... */