Fix compiler warnings from using deprecated qChecksum overload

Change-Id: Ib7a6d0e752dc662a42abe38f2010da3f2b4626f1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Volker Hilsheimer 2020-09-04 09:20:56 +02:00
parent 78695bbf19
commit 455d811b58
2 changed files with 4 additions and 4 deletions

View File

@ -140,8 +140,8 @@ bool QPicturePaintEngine::end()
}
d->s << (quint32) d->pic_d->trecs; // write number of records
d->pic_d->pictb.seek(cs_start);
QByteArray buf = d->pic_d->pictb.buffer();
quint16 cs = (quint16) qChecksum(buf.constData() + data_start, pos - data_start);
const QByteArray buf = d->pic_d->pictb.buffer();
quint16 cs = (quint16) qChecksum(QByteArrayView(buf.constData() + data_start, pos - data_start));
d->s << cs; // write checksum
d->pic_d->pictb.close();
setActive(false);

View File

@ -1038,10 +1038,10 @@ bool QPicturePrivate::checkFormat()
int cs_start = sizeof(quint32); // pos of checksum word
int data_start = cs_start + sizeof(quint16);
quint16 cs,ccs;
QByteArray buf = pictb.buffer(); // pointer to data
const QByteArray buf = pictb.buffer(); // pointer to data
s >> cs; // read checksum
ccs = (quint16) qChecksum(buf.constData() + data_start, buf.size() - data_start);
ccs = (quint16) qChecksum(QByteArrayView(buf.constData() + data_start, buf.size() - data_start));
if (ccs != cs) {
qWarning("QPicturePaintEngine::checkFormat: Invalid checksum %x, %x expected",
ccs, cs);