Fix some signed/unsigned comparisoms.
This commit is contained in:
parent
06b089ba13
commit
ad7d6624de
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -64,7 +64,7 @@ public:
|
||||
|
||||
Package* getPackageById(const std::string& aId) const;
|
||||
|
||||
int ageInSeconds() const;
|
||||
unsigned int ageInSeconds() const;
|
||||
private:
|
||||
Catalog(Root* aRoot);
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user