diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-12-08 00:03:25 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-12-09 21:39:43 +0900 |
| commit | 9d15d732edd512a3ff03147da459feaddde511fe (patch) | |
| tree | 4206d8328e73cdf57e88830fb6b5f64c18f39f73 /src/DefaultBtProgressInfoFile.cc | |
| parent | 12988e5282ef52a2806cbaca9f4074698f35e399 (diff) | |
Use int32_t for piece length instead of size_t
Diffstat (limited to 'src/DefaultBtProgressInfoFile.cc')
| -rw-r--r-- | src/DefaultBtProgressInfoFile.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/DefaultBtProgressInfoFile.cc b/src/DefaultBtProgressInfoFile.cc index 9fa32b1c..0698f85a 100644 --- a/src/DefaultBtProgressInfoFile.cc +++ b/src/DefaultBtProgressInfoFile.cc @@ -309,7 +309,7 @@ void DefaultBtProgressInfoFile::load() array_ptr<unsigned char> savedBitfield(new unsigned char[bitfieldLength]); READ_CHECK(fp, static_cast<unsigned char*>(savedBitfield), bitfieldLength); - if(pieceLength == dctx_->getPieceLength()) { + if(pieceLength == static_cast<uint32_t>(dctx_->getPieceLength())) { pieceStorage_->setBitfield(savedBitfield, bitfieldLength); uint32_t numInFlightPiece; @@ -333,7 +333,7 @@ void DefaultBtProgressInfoFile::load() if(version >= 1) { length = ntohl(length); } - if(!(length <=dctx_->getPieceLength())) { + if(!(length <= static_cast<uint32_t>(dctx_->getPieceLength()))) { throw DL_ABORT_EX(fmt("piece length out of range: %u", length)); } SharedHandle<Piece> piece(new Piece(index, length)); |
