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:
parent
78695bbf19
commit
455d811b58
@ -140,8 +140,8 @@ bool QPicturePaintEngine::end()
|
|||||||
}
|
}
|
||||||
d->s << (quint32) d->pic_d->trecs; // write number of records
|
d->s << (quint32) d->pic_d->trecs; // write number of records
|
||||||
d->pic_d->pictb.seek(cs_start);
|
d->pic_d->pictb.seek(cs_start);
|
||||||
QByteArray buf = d->pic_d->pictb.buffer();
|
const QByteArray buf = d->pic_d->pictb.buffer();
|
||||||
quint16 cs = (quint16) qChecksum(buf.constData() + data_start, pos - data_start);
|
quint16 cs = (quint16) qChecksum(QByteArrayView(buf.constData() + data_start, pos - data_start));
|
||||||
d->s << cs; // write checksum
|
d->s << cs; // write checksum
|
||||||
d->pic_d->pictb.close();
|
d->pic_d->pictb.close();
|
||||||
setActive(false);
|
setActive(false);
|
||||||
|
@ -1038,10 +1038,10 @@ bool QPicturePrivate::checkFormat()
|
|||||||
int cs_start = sizeof(quint32); // pos of checksum word
|
int cs_start = sizeof(quint32); // pos of checksum word
|
||||||
int data_start = cs_start + sizeof(quint16);
|
int data_start = cs_start + sizeof(quint16);
|
||||||
quint16 cs,ccs;
|
quint16 cs,ccs;
|
||||||
QByteArray buf = pictb.buffer(); // pointer to data
|
const QByteArray buf = pictb.buffer(); // pointer to data
|
||||||
|
|
||||||
s >> cs; // read checksum
|
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) {
|
if (ccs != cs) {
|
||||||
qWarning("QPicturePaintEngine::checkFormat: Invalid checksum %x, %x expected",
|
qWarning("QPicturePaintEngine::checkFormat: Invalid checksum %x, %x expected",
|
||||||
ccs, cs);
|
ccs, cs);
|
||||||
|
Loading…
Reference in New Issue
Block a user