summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
Diffstat (limited to 'package')
-rw-r--r--package/inc/ZipOutputStream.hxx3
-rw-r--r--package/source/zipapi/ZipOutputStream.cxx6
-rw-r--r--package/source/zippackage/ZipPackageStream.cxx3
3 files changed, 7 insertions, 5 deletions
diff --git a/package/inc/ZipOutputStream.hxx b/package/inc/ZipOutputStream.hxx
index aeb7ab1f86e8..f55ef59a8880 100644
--- a/package/inc/ZipOutputStream.hxx
+++ b/package/inc/ZipOutputStream.hxx
@@ -25,6 +25,7 @@
#include "ByteChucker.hxx"
#include <comphelper/threadpool.hxx>
+#include <cstddef>
#include <vector>
struct ZipEntry;
@@ -85,7 +86,7 @@ private:
public:
void reduceScheduledThreadTasksToGivenNumberOrLess(
- sal_Int32 nThreadTasks);
+ std::size_t nThreadTasks);
const std::shared_ptr<comphelper::ThreadTaskTag>& getThreadTaskTag() const { return mpThreadTaskTag; }
};
diff --git a/package/source/zipapi/ZipOutputStream.cxx b/package/source/zipapi/ZipOutputStream.cxx
index a4d67fcfd54a..33321627b6f9 100644
--- a/package/source/zipapi/ZipOutputStream.cxx
+++ b/package/source/zipapi/ZipOutputStream.cxx
@@ -143,13 +143,13 @@ void ZipOutputStream::consumeFinishedScheduledThreadTaskEntries()
m_aEntries = aNonFinishedEntries;
}
-void ZipOutputStream::reduceScheduledThreadTasksToGivenNumberOrLess(sal_Int32 nThreadTasks)
+void ZipOutputStream::reduceScheduledThreadTasksToGivenNumberOrLess(std::size_t nThreadTasks)
{
- while(static_cast< sal_Int32 >(m_aEntries.size()) > nThreadTasks)
+ while(m_aEntries.size() > nThreadTasks)
{
consumeFinishedScheduledThreadTaskEntries();
- if(static_cast< sal_Int32 >(m_aEntries.size()) > nThreadTasks)
+ if(m_aEntries.size() > nThreadTasks)
{
osl::Thread::wait(std::chrono::microseconds(100));
}
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index c4f94806b9b8..b63bf24eaf4f 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -57,6 +57,7 @@
#include <PackageConstants.hxx>
#include <algorithm>
+#include <cstddef>
using namespace com::sun::star::packages::zip::ZipConstants;
using namespace com::sun::star::packages::zip;
@@ -771,7 +772,7 @@ bool ZipPackageStream::saveChild(
// cores and allow 4-times the amount for having the queue well filled. The
// 2nd parameter is the time to wait between cleanups in 10th of a second.
// Both values may be added to the configuration settings if needed.
- static sal_Int32 nAllowedTasks(comphelper::ThreadPool::getPreferredConcurrency() * 4);
+ static std::size_t nAllowedTasks(comphelper::ThreadPool::getPreferredConcurrency() * 4); //TODO: overflow
rZipOut.reduceScheduledThreadTasksToGivenNumberOrLess(nAllowedTasks);
// Start a new thread task deflating this zip entry