Add cast to int to fix error when building with Qt 6

master
Michael Schwarz 2025-12-12 13:02:42 +01:00 committed by GitHub
parent 7ae4c77c54
commit 0dcd6e9dfe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -137,7 +137,10 @@ void SunSpecModel::readNextBlockDataPart()
{ {
const auto startAddress = m_modbusStartRegister + m_partialBlockData.size(); const auto startAddress = m_modbusStartRegister + m_partialBlockData.size();
// Model header has length 2. // Model header has length 2.
const auto readSize = static_cast<quint16>(std::min(125, m_modelLength + 2 - m_partialBlockData.size())); const auto readSize = static_cast<quint16>(std::min(125, static_cast<int>(m_modelLength + 2 - m_partialBlockData.size())));
Still in progress?
if (startAddress == m_lastStartAddress && readSize == m_lastReadSize) { if (startAddress == m_lastStartAddress && readSize == m_lastReadSize) {
qCWarning(dcSunSpecModelData()) << "Last read yielded no data. Not trying to read the same data again."; qCWarning(dcSunSpecModelData()) << "Last read yielded no data. Not trying to read the same data again.";