diff --git a/simgear/io/HTTPClient.cxx b/simgear/io/HTTPClient.cxx index 7a32ab49..5e32d2cb 100644 --- a/simgear/io/HTTPClient.cxx +++ b/simgear/io/HTTPClient.cxx @@ -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) { diff --git a/simgear/package/Catalog.cxx b/simgear/package/Catalog.cxx index bc9b6e59..92164fd1 100644 --- a/simgear/package/Catalog.cxx +++ b/simgear/package/Catalog.cxx @@ -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 diff --git a/simgear/package/Catalog.hxx b/simgear/package/Catalog.hxx index 49fd2af6..d49f725a 100644 --- a/simgear/package/Catalog.hxx +++ b/simgear/package/Catalog.hxx @@ -64,7 +64,7 @@ public: Package* getPackageById(const std::string& aId) const; - int ageInSeconds() const; + unsigned int ageInSeconds() const; private: Catalog(Root* aRoot); diff --git a/simgear/package/Install.cxx b/simgear/package/Install.cxx index eb186dc9..b471d965 100644 --- a/simgear/package/Install.cxx +++ b/simgear/package/Install.cxx @@ -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