Use signed integers for storing the random values
This commit is contained in:
parent
d712f22b21
commit
2ed1e6ee9d
|
@ -550,7 +550,7 @@ struct tr_refill_piece
|
||||||
{
|
{
|
||||||
tr_priority_t priority;
|
tr_priority_t priority;
|
||||||
int missingBlockCount;
|
int missingBlockCount;
|
||||||
uint16_t random;
|
int random;
|
||||||
uint32_t piece;
|
uint32_t piece;
|
||||||
uint32_t peerCount;
|
uint32_t peerCount;
|
||||||
};
|
};
|
||||||
|
@ -621,7 +621,7 @@ getPreferredPieces( Torrent * t,
|
||||||
setme->piece = piece;
|
setme->piece = piece;
|
||||||
setme->priority = inf->pieces[piece].priority;
|
setme->priority = inf->pieces[piece].priority;
|
||||||
setme->peerCount = 0;
|
setme->peerCount = 0;
|
||||||
setme->random = tr_stupidRandInt( UINT16_MAX );
|
setme->random = tr_stupidRandInt( INT_MAX );
|
||||||
setme->missingBlockCount = tr_cpMissingBlocksInPiece( tor->completion, piece );
|
setme->missingBlockCount = tr_cpMissingBlocksInPiece( tor->completion, piece );
|
||||||
|
|
||||||
for( k=0; k<peerCount; ++k ) {
|
for( k=0; k<peerCount; ++k ) {
|
||||||
|
|
Loading…
Reference in New Issue