chore(Poco): Resolve a lot of warnings, reported by g++ 13.

This commit is contained in:
Matej Kenda
2024-10-10 09:11:15 +02:00
parent 88c4958032
commit c038b52f36
13 changed files with 58 additions and 56 deletions

View File

@@ -137,7 +137,7 @@ private:
{
poco_assert (bufferSize > 0);
if (bufferSize > rangeLength)
if (bufferSize > static_cast<std::size_t>(rangeLength))
bufferSize = rangeLength;
Buffer<char> buffer(bufferSize);
@@ -153,8 +153,9 @@ private:
ostr.write(buffer.begin(), n);
if ((len < rangeLength) && istr && ostr)
{
if (bufferSize > (rangeLength - len))
bufferSize = rangeLength - len;
const std::size_t inputLen = rangeLength - len;
if (bufferSize > inputLen)
bufferSize = inputLen;
istr.read(buffer.begin(), bufferSize);
n = istr.gcount();
}
@@ -211,7 +212,7 @@ private:
{
istr.seekg(rangeStart, std::ios_base::beg);
istr.get(c);
while (istr && ostr && (len < rangeLength))
while (istr && ostr && (static_cast<std::streamsize>(len) < rangeLength))
{
ostr.put(c);
++len;

View File

@@ -71,7 +71,7 @@ public:
/// startInterval expires.
/// To start the timer, call the Start() method.
virtual ~Timer();
~Timer() override;
/// Stops and destroys the timer.
void start(const AbstractTimerCallback& method);
@@ -138,7 +138,7 @@ public:
/// longer to execute than the timer interval.
protected:
void run();
void run() override;
private:
long _startInterval;
@@ -181,19 +181,19 @@ class TimerCallback: public AbstractTimerCallback
/// to use this template class.
{
public:
typedef void (C::*Callback)(Timer&);
using Callback = void (C::*)(Timer &);
TimerCallback() = delete;
TimerCallback(C& object, Callback method): _pObject(&object), _method(method)
{
}
TimerCallback(const TimerCallback& callback): _pObject(callback._pObject), _method(callback._method)
TimerCallback(const TimerCallback& callback): AbstractTimerCallback(callback), _pObject(callback._pObject), _method(callback._method)
{
}
~TimerCallback()
{
}
~TimerCallback() override = default;
TimerCallback& operator = (const TimerCallback& callback)
{
@@ -205,19 +205,17 @@ public:
return *this;
}
void invoke(Timer& timer) const
void invoke(Timer& timer) const override
{
(_pObject->*_method)(timer);
}
AbstractTimerCallback* clone() const
AbstractTimerCallback* clone() const override
{
return new TimerCallback(*this);
}
private:
TimerCallback();
C* _pObject;
Callback _method;
};