QPA plugins: Fix const correctness in old style casts
Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c946899b4ba15b Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
This commit is contained in:
parent
3d7a0111e3
commit
afe3e24711
@ -175,7 +175,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &specification,
|
|||||||
setObjectName(QLatin1String("Evdev Touch Handler"));
|
setObjectName(QLatin1String("Evdev Touch Handler"));
|
||||||
|
|
||||||
if (qEnvironmentVariableIsSet("QT_QPA_EVDEV_DEBUG"))
|
if (qEnvironmentVariableIsSet("QT_QPA_EVDEV_DEBUG"))
|
||||||
((QLoggingCategory &) qLcEvdevTouch()).setEnabled(QtDebugMsg, true);
|
const_cast<QLoggingCategory &>(qLcEvdevTouch()).setEnabled(QtDebugMsg, true);
|
||||||
|
|
||||||
// only the first device argument is used for now
|
// only the first device argument is used for now
|
||||||
QString spec = QString::fromLocal8Bit(qgetenv("QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS"));
|
QString spec = QString::fromLocal8Bit(qgetenv("QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS"));
|
||||||
|
@ -524,7 +524,7 @@ QImage ICOReader::iconAt(int index)
|
|||||||
|
|
||||||
iod->seek(iconEntry.dwImageOffset);
|
iod->seek(iconEntry.dwImageOffset);
|
||||||
|
|
||||||
const QByteArray pngMagic = QByteArray::fromRawData((char*)pngMagicData, sizeof(pngMagicData));
|
const QByteArray pngMagic = QByteArray::fromRawData((const char*)pngMagicData, sizeof(pngMagicData));
|
||||||
const bool isPngImage = (iod->read(pngMagic.size()) == pngMagic);
|
const bool isPngImage = (iod->read(pngMagic.size()) == pngMagic);
|
||||||
|
|
||||||
if (isPngImage) {
|
if (isPngImage) {
|
||||||
|
@ -97,7 +97,7 @@ bool QComposeInputContext::filterEvent(const QEvent *event)
|
|||||||
if ((m_tableState & TableGenerator::NoErrors) != TableGenerator::NoErrors)
|
if ((m_tableState & TableGenerator::NoErrors) != TableGenerator::NoErrors)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QKeyEvent *keyEvent = (QKeyEvent *)event;
|
const QKeyEvent *keyEvent = (const QKeyEvent *)event;
|
||||||
// should pass only the key presses
|
// should pass only the key presses
|
||||||
if (keyEvent->type() != QEvent::KeyPress) {
|
if (keyEvent->type() != QEvent::KeyPress) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -97,7 +97,7 @@ protected:
|
|||||||
that->format_atoms = m_clipboard->getDataInFormat(modeAtom, m_clipboard->atom(QXcbAtom::TARGETS));
|
that->format_atoms = m_clipboard->getDataInFormat(modeAtom, m_clipboard->atom(QXcbAtom::TARGETS));
|
||||||
|
|
||||||
if (format_atoms.size() > 0) {
|
if (format_atoms.size() > 0) {
|
||||||
xcb_atom_t *targets = (xcb_atom_t *) format_atoms.data();
|
const xcb_atom_t *targets = (const xcb_atom_t *) format_atoms.data();
|
||||||
int size = format_atoms.size() / sizeof(xcb_atom_t);
|
int size = format_atoms.size() / sizeof(xcb_atom_t);
|
||||||
|
|
||||||
for (int i = 0; i < size; ++i) {
|
for (int i = 0; i < size; ++i) {
|
||||||
@ -128,7 +128,7 @@ protected:
|
|||||||
(void)formats(); // trigger update of format list
|
(void)formats(); // trigger update of format list
|
||||||
|
|
||||||
QVector<xcb_atom_t> atoms;
|
QVector<xcb_atom_t> atoms;
|
||||||
xcb_atom_t *targets = (xcb_atom_t *) format_atoms.data();
|
const xcb_atom_t *targets = (const xcb_atom_t *) format_atoms.data();
|
||||||
int size = format_atoms.size() / sizeof(xcb_atom_t);
|
int size = format_atoms.size() / sizeof(xcb_atom_t);
|
||||||
atoms.reserve(size);
|
atoms.reserve(size);
|
||||||
for (int i = 0; i < size; ++i)
|
for (int i = 0; i < size; ++i)
|
||||||
|
@ -703,7 +703,7 @@ Q_XCB_EXPORT QDebug operator<<(QDebug debug, const QXcbScreen *screen)
|
|||||||
{
|
{
|
||||||
const QDebugStateSaver saver(debug);
|
const QDebugStateSaver saver(debug);
|
||||||
debug.nospace();
|
debug.nospace();
|
||||||
debug << "QXcbScreen(" << (void *)screen;
|
debug << "QXcbScreen(" << (const void *)screen;
|
||||||
if (screen) {
|
if (screen) {
|
||||||
debug << fixed << qSetRealNumberPrecision(1);
|
debug << fixed << qSetRealNumberPrecision(1);
|
||||||
debug << ", name=" << screen->name();
|
debug << ", name=" << screen->name();
|
||||||
|
@ -125,7 +125,7 @@ static void sm_setProperty(const QString &name, const QString &value)
|
|||||||
QByteArray v = value.toUtf8();
|
QByteArray v = value.toUtf8();
|
||||||
SmPropValue prop;
|
SmPropValue prop;
|
||||||
prop.length = v.length();
|
prop.length = v.length();
|
||||||
prop.value = (SmPointer) v.constData();
|
prop.value = (SmPointer) const_cast<char *>(v.constData());
|
||||||
sm_setProperty(name.toLatin1().data(), SmARRAY8, 1, &prop);
|
sm_setProperty(name.toLatin1().data(), SmARRAY8, 1, &prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user