Silence GCC 8 warnings in QString
qtbase/src/corelib/tools/qstring.cpp:3539:67: error: ‘void* memcpy(void*, const void*, size_t)’ copying an object of non-trivial type ‘class QChar’ from an array of ‘short unsigned int’ [-Werror=class-memaccess] memcpy(uc, d->data() + copystart, size * sizeof(QChar)); Change-Id: Ic601bed1a1f9e1b6f0ac1f9e58f1dcadb50ad724 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
parent
b34942710c
commit
77582f1f10
@ -3536,14 +3536,14 @@ QString& QString::replace(const QRegExp &rx, const QString &after)
|
|||||||
while (i < pos) {
|
while (i < pos) {
|
||||||
int copyend = replacements[i].pos;
|
int copyend = replacements[i].pos;
|
||||||
int size = copyend - copystart;
|
int size = copyend - copystart;
|
||||||
memcpy(uc, d->data() + copystart, size * sizeof(QChar));
|
memcpy(static_cast<void*>(uc), static_cast<const void *>(d->data() + copystart), size * sizeof(QChar));
|
||||||
uc += size;
|
uc += size;
|
||||||
memcpy(uc, after.d->data(), al * sizeof(QChar));
|
memcpy(static_cast<void *>(uc), static_cast<const void *>(after.d->data()), al * sizeof(QChar));
|
||||||
uc += al;
|
uc += al;
|
||||||
copystart = copyend + replacements[i].length;
|
copystart = copyend + replacements[i].length;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
memcpy(uc, d->data() + copystart, (d->size - copystart) * sizeof(QChar));
|
memcpy(static_cast<void *>(uc), static_cast<const void *>(d->data() + copystart), (d->size - copystart) * sizeof(QChar));
|
||||||
newstring.resize(newlen);
|
newstring.resize(newlen);
|
||||||
*this = newstring;
|
*this = newstring;
|
||||||
caretMode = QRegExp::CaretWontMatch;
|
caretMode = QRegExp::CaretWontMatch;
|
||||||
@ -5766,7 +5766,7 @@ QString QString::rightJustified(int width, QChar fill, bool truncate) const
|
|||||||
while (padlen--)
|
while (padlen--)
|
||||||
* uc++ = fill;
|
* uc++ = fill;
|
||||||
if (len)
|
if (len)
|
||||||
memcpy(uc, d->data(), sizeof(QChar)*len);
|
memcpy(static_cast<void *>(uc), static_cast<const void *>(d->data()), sizeof(QChar)*len);
|
||||||
} else {
|
} else {
|
||||||
if (truncate)
|
if (truncate)
|
||||||
result = left(width);
|
result = left(width);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user