Changeset 5682 for trunk/libtransmission/torrent.c
- Timestamp:
- Apr 24, 2008, 3:25:01 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/torrent.c
r5658 r5682 726 726 tr_file_stat * walk = files; 727 727 728 for( i=0; i<n; ++i, ++walk ) 729 { 730 const tr_file * file = tor->info.files + i; 731 732 walk->bytesCompleted = fileBytesCompleted( tor, i ); 733 734 walk->progress = file->length 735 ? walk->bytesCompleted / (float)file->length 736 : 1.0; 728 for( i=0; i<n; ++i, ++walk ) { 729 const uint64_t b = fileBytesCompleted( tor, i ); 730 walk->bytesCompleted = b; 731 walk->progress = tr_getRatio( b, tor->info.files[i].length ); 737 732 } 738 733 … … 778 773 } 779 774 780 void tr_torrentAmountFinished( const tr_torrent * tor, float * tab, int size ) 781 { 782 int i; 783 float interval; 775 void 776 tr_torrentAmountFinished( const tr_torrent * tor, float * tab, int size ) 777 { 784 778 tr_torrentLock( tor ); 785 786 interval = (float)tor->info.pieceCount / (float)size; 787 for( i = 0; i < size; i++ ) 788 { 789 int piece = i * interval; 790 tab[i] = tr_cpPercentBlocksInPiece( tor->completion, piece ); 791 } 792 779 tr_cpGetAmountDone( tor->completion, tab, size ); 793 780 tr_torrentUnlock( tor ); 794 781 }
Note: See TracChangeset
for help on using the changeset viewer.