2008-06-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Made `begin' unsigned int.
	* src/GrowSegment.h
	* src/Piece.cc
	* src/Piece.h
	* src/PiecedSegment.cc
	* src/PiecedSegment.h
	* src/Segment.h
pull/1/head
Tatsuhiro Tsujikawa 2008-06-05 12:53:30 +00:00
parent 7d63daed22
commit ba158dbfc1
7 changed files with 16 additions and 6 deletions

View File

@ -1,3 +1,13 @@
2008-06-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Made `begin' unsigned int.
* src/GrowSegment.h
* src/Piece.cc
* src/Piece.h
* src/PiecedSegment.cc
* src/PiecedSegment.h
* src/Segment.h
2008-06-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Calculate piece hash when data is arrived if the data is arrived in

View File

@ -92,7 +92,7 @@ public:
#ifdef ENABLE_MESSAGE_DIGEST
virtual bool updateHash(size_t begin,
virtual bool updateHash(uint32_t begin,
const unsigned char* data, size_t dataLength)
{
return false;

View File

@ -225,7 +225,7 @@ void Piece::setHashAlgo(const std::string& algo)
_hashAlgo = algo;
}
bool Piece::updateHash(size_t begin, const unsigned char* data, size_t dataLength)
bool Piece::updateHash(uint32_t begin, const unsigned char* data, size_t dataLength)
{
if(_hashAlgo.empty()) {
return false;

View File

@ -140,7 +140,7 @@ public:
// Updates hash value. This function compares begin and private variable
// _nextBegin and only when they are equal, hash is updated eating data and
// returns true. Otherwise returns false.
bool updateHash(size_t begin, const unsigned char* data, size_t dataLength);
bool updateHash(uint32_t begin, const unsigned char* data, size_t dataLength);
bool isHashCalculated() const;

View File

@ -92,7 +92,7 @@ void PiecedSegment::updateWrittenLength(size_t bytes)
#ifdef ENABLE_MESSAGE_DIGEST
bool PiecedSegment::updateHash(size_t begin,
bool PiecedSegment::updateHash(uint32_t begin,
const unsigned char* data, size_t dataLength)
{
return _piece->updateHash(begin, data, dataLength);

View File

@ -85,7 +85,7 @@ public:
#ifdef ENABLE_MESSAGE_DIGEST
// `begin' is a offset inside this segment.
virtual bool updateHash(size_t begin,
virtual bool updateHash(uint32_t begin,
const unsigned char* data, size_t dataLength);
virtual bool isHashCalculated() const;

View File

@ -71,7 +71,7 @@ public:
#ifdef ENABLE_MESSAGE_DIGEST
// `begin' is a offset inside this segment.
virtual bool updateHash(size_t begin,
virtual bool updateHash(uint32_t begin,
const unsigned char* data, size_t dataLength) = 0;
virtual bool isHashCalculated() const = 0;