Fix some signed/unsigned comparisoms.

This commit is contained in:
James Turner 2013-02-28 19:45:19 +00:00
parent 06b089ba13
commit ad7d6624de
4 changed files with 7 additions and 6 deletions

View File

@ -338,7 +338,7 @@ public:
}
char flags = zlibInflateBuffer[3];
int gzipHeaderSize = GZIP_HEADER_SIZE;
unsigned int gzipHeaderSize = GZIP_HEADER_SIZE;
if (flags & GZIP_HEADER_FEXTRA) {
gzipHeaderSize += 2;
if (zlib.avail_in < gzipHeaderSize) {

View File

@ -238,11 +238,12 @@ void Catalog::writeTimestamp()
f << m_retrievedTime << std::endl;
}
int Catalog::ageInSeconds() const
unsigned int Catalog::ageInSeconds() const
{
time_t now;
time(&now);
return ::difftime(now, m_retrievedTime);
int diff = ::difftime(now, m_retrievedTime);
return (diff < 0) ? 0 : diff;
}
std::string Catalog::getLocalisedString(const SGPropertyNode* aRoot, const char* aName) const

View File

@ -64,7 +64,7 @@ public:
Package* getPackageById(const std::string& aId) const;
int ageInSeconds() const;
unsigned int ageInSeconds() const;
private:
Catalog(Root* aRoot);

View File

@ -119,8 +119,8 @@ private:
unz_file_info fileInfo;
unzGetCurrentFileInfo(zip, &fileInfo,
buffer, bufferSize,
NULL, NULL, /* extra field */
NULL, NULL /* comment field */);
NULL, 0, /* extra field */
NULL, 0 /* comment field */);
std::string name(buffer);
// no absolute paths, no 'up' traversals