1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 09:37:56 +00:00

(trunk libT) a couple more minor -Wconversion warnings

This commit is contained in:
Charles Kerr 2010-07-01 05:39:54 +00:00
parent a5a1f38393
commit 4ad26f7910
3 changed files with 10 additions and 9 deletions

View file

@ -69,14 +69,13 @@ tr_getCurrentThread( void )
#endif
}
static int
tr_areThreadsEqual( tr_thread_id a,
tr_thread_id b )
static tr_bool
tr_areThreadsEqual( tr_thread_id a, tr_thread_id b )
{
#ifdef WIN32
return a == b;
#else
return pthread_equal( a, b );
return pthread_equal( a, b ) != 0;
#endif
}
@ -91,7 +90,7 @@ struct tr_thread
#endif
};
int
tr_bool
tr_amInThread( const tr_thread * t )
{
return tr_areThreadsEqual( tr_getCurrentThread( ), t->thread );

View file

@ -74,7 +74,7 @@ tr_thread* tr_threadNew( void ( *func )(void *), void * arg );
/** @brief Return nonzero if this function is being called from `thread'
@param thread the thread being tested */
int tr_amInThread( const tr_thread * );
tr_bool tr_amInThread( const tr_thread * );
/***
****

View file

@ -1172,7 +1172,7 @@ tr_torrentFiles( const tr_torrent * tor,
for( i=0; i<n; ++i, ++walk ) {
const uint64_t b = isSeed ? tor->info.files[i].length : fileBytesCompleted( tor, i );
walk->bytesCompleted = b;
walk->progress = tor->info.files[i].length > 0 ? ( (float)b / tor->info.files[i].length ) : 1.0;
walk->progress = tor->info.files[i].length > 0 ? ( b / tor->info.files[i].length ) : 1.0;
}
if( fileCount )
@ -1842,8 +1842,10 @@ setFileDND( tr_torrent * tor, tr_file_index_t fileIndex, int doDownload )
{
tr_file * file;
const int8_t dnd = !doDownload;
tr_piece_index_t firstPiece, firstPieceDND;
tr_piece_index_t lastPiece, lastPieceDND;
tr_piece_index_t firstPiece;
int8_t firstPieceDND;
tr_piece_index_t lastPiece;
int8_t lastPieceDND;
tr_file_index_t i;
assert( tr_isTorrent( tor ) );