Some more small changes to handle files > 2GB on 32bit platforms.

This commit is contained in:
Erik Fleischer 2015-07-04 20:22:08 +02:00
parent 23df30d7be
commit 0d73445e28
2 changed files with 3 additions and 3 deletions

View File

@ -22,7 +22,7 @@
size_t writeMemoryCallback(char *ptr, size_t size, size_t nmemb, void *userp) {
std::ostringstream *stream = (std::ostringstream*)userp;
size_t count = size * nmemb;
std::streamsize count = (std::streamsize) size * nmemb;
stream->write(ptr, count);
return count;
}

View File

@ -1804,9 +1804,9 @@ int Downloader::progressCallback(void *clientp, double dltotal, double dlnow, do
{
downloader->TimeAndSize.pop_front();
time_t time_first = downloader->TimeAndSize.front().first;
size_t size_first = downloader->TimeAndSize.front().second;
uintmax_t size_first = downloader->TimeAndSize.front().second;
time_t time_last = downloader->TimeAndSize.back().first;
size_t size_last = downloader->TimeAndSize.back().second;
uintmax_t size_last = downloader->TimeAndSize.back().second;
rate = (size_last - size_first) / static_cast<double>((time_last - time_first));
}