diff --git a/libtransmission/bencode.c b/libtransmission/bencode.c index bd497ea77..d1f9c7fc6 100644 --- a/libtransmission/bencode.c +++ b/libtransmission/bencode.c @@ -377,7 +377,7 @@ benc_val_t * tr_bencDictAdd( benc_val_t * dict, const char * key ) assert( dict->val.l.count + 2 <= dict->val.l.alloc ); keyval = dict->val.l.vals + dict->val.l.count++; - tr_bencInitStr( keyval, key, -1, 1 ); + tr_bencInitStr( keyval, (char*)key, -1, 1 ); itemval = dict->val.l.vals + dict->val.l.count++; tr_bencInit( itemval, TYPE_INT ); diff --git a/libtransmission/peerparse.h b/libtransmission/peerparse.h index 76189fffb..abac020ac 100644 --- a/libtransmission/peerparse.h +++ b/libtransmission/peerparse.h @@ -354,7 +354,7 @@ static int parsePiece( tr_torrent_t * tor, tr_peer_t * peer, pieces in our announce data, as it could give us a misleadingly bad share ratio . (Ticket #263) */ const int byteCount = tr_pieceSize( index ); - if( tor->downloadedCur >= byteCount ) + if( tor->downloadedCur >= (uint64_t)byteCount ) tor->downloadedCur -= byteCount; return ret; diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index c344c9919..9f10d4d61 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -707,8 +707,8 @@ fileBytesCompleted ( const tr_torrent_t * tor, int fileIndex ) assert( (int)firstBlock < tor->blockCount ); assert( (int)lastBlock < tor->blockCount ); assert( firstBlock <= lastBlock ); - assert( TOR_BLOCK_PIECE( tor, firstBlock ) == file->firstPiece ); - assert( TOR_BLOCK_PIECE( tor, lastBlock ) == file->lastPiece ); + assert( (int)TOR_BLOCK_PIECE( tor, firstBlock ) == file->firstPiece ); + assert( (int)TOR_BLOCK_PIECE( tor, lastBlock ) == file->lastPiece ); if( firstBlock == lastBlock ) { diff --git a/libtransmission/utils.c b/libtransmission/utils.c index 7ece232f4..c9a40245c 100644 --- a/libtransmission/utils.c +++ b/libtransmission/utils.c @@ -588,8 +588,6 @@ void tr_bitfieldAdd( tr_bitfield_t * bitfield, size_t nth ) { assert( bitfield != NULL ); - assert( 0 <= nth); - assert( 0 <= BIN(nth) ); assert( BIN(nth) < bitfield->len ); bitfield->bits[ BIN(nth) ] |= BIT(nth); } @@ -611,7 +609,7 @@ tr_bitfieldRem( tr_bitfield_t * bitfield, { if( bitfield != NULL ) { - const int bin = BIN(nth); + const size_t bin = BIN(nth); assert( bin < bitfield->len ); bitfield->bits[bin] &= ~BIT(nth); }