Found with GCC's -Wcast-qual.
Change-Id: Ia0aac2f09e9245339951ffff13c9589afabc7ade
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
uint qHash(const QQuickShaderEffectMaterialKey &key)
{
- uint hash = qHash((void *)key.className);
+ uint hash = qHash((const void *)key.className);
typedef QQuickShaderEffectMaterialKey Key;
for (int shaderType = 0; shaderType < Key::ShaderTypeCount; ++shaderType)
hash = hash * 31337 + qHash(key.sourceCode[shaderType]);
if (((const QMatrix4x4_Accessor &) localx).flagBits == 1) {
for (int i=0; i<vCount; ++i) {
Pt *p = (Pt *) vdata;
- p->x += ((QMatrix4x4_Accessor &) localx).m[3][0];
- p->y += ((QMatrix4x4_Accessor &) localx).m[3][1];
+ p->x += ((const QMatrix4x4_Accessor &) localx).m[3][0];
+ p->y += ((const QMatrix4x4_Accessor &) localx).m[3][1];
vdata += vSize;
}
} else if (((const QMatrix4x4_Accessor &) localx).flagBits > 1) {
if (attr.isVertexCoordinate)
dump << "* ";
for (int t=0; t<attr.tupleSize; ++t)
- dump << *(float *)(vd + offset + t * sizeof(float)) << " ";
+ dump << *(const float *)(vd + offset + t * sizeof(float)) << " ";
} else if (attr.type == GL_UNSIGNED_BYTE) {
dump << "ubyte ";
for (int t=0; t<attr.tupleSize; ++t)
- dump << *(unsigned char *)(vd + offset + t * sizeof(unsigned char)) << " ";
+ dump << *(const unsigned char *)(vd + offset + t * sizeof(unsigned char)) << " ";
}
dump << ") ";
offset += attr.tupleSize * size_of_type(attr.type);
for (int i=0; i<PageSize; ++i) blocks[i] = i;
}
- Type *at(uint index) const
+ const Type *at(uint index) const
+ {
+ return (Type *) &data[index * sizeof(Type)];
+ }
+
+ Type *at(uint index)
{
return (Type *) &data[index * sizeof(Type)];
}
d << "Geometry(null)";
return d;
}
- d << "GeometryNode(" << hex << (void *) n << dec;
+ d << "GeometryNode(" << hex << (const void *) n << dec;
const QSGGeometry *g = n->geometry();
d << "ClipNode(null)";
return d;
}
- d << "ClipNode(" << hex << (void *) n << dec;
+ d << "ClipNode(" << hex << (const void *) n << dec;
if (n->childCount())
d << "children=" << n->childCount();
}
const QMatrix4x4 m = n->matrix();
d << "TransformNode(";
- d << hex << (void *) n << dec;
+ d << hex << (const void *) n << dec;
if (m.isIdentity())
d << "identity";
else if (m.determinant() == 1 && m(0, 0) == 1 && m(1, 1) == 1 && m(2, 2) == 1)
return d;
}
d << "OpacityNode(";
- d << hex << (void *) n << dec;
+ d << hex << (const void *) n << dec;
d << "opacity=" << n->opacity()
<< "combined=" << n->combinedOpacity()
<< (n->isSubtreeBlocked() ? "*BLOCKED*" : "");
d << "RootNode(null)";
return d;
}
- d << "RootNode" << hex << (void *) n << (n->isSubtreeBlocked() ? "*BLOCKED*" : "");
+ d << "RootNode" << hex << (const void *) n << (n->isSubtreeBlocked() ? "*BLOCKED*" : "");
#ifdef QSG_RUNTIME_DESCRIPTION
d << QSGNodePrivate::description(n);
#endif
d << static_cast<const QSGOpacityNode *>(n);
break;
case QSGNode::RenderNodeType:
- d << "RenderNode(" << hex << (void *) n << dec
+ d << "RenderNode(" << hex << (const void *) n << dec
<< "flags=" << (int) n->flags() << dec
<< (n->isSubtreeBlocked() ? "*BLOCKED*" : "");
#ifdef QSG_RUNTIME_DESCRIPTION
d << ')';
break;
default:
- d << "Node(" << hex << (void *) n << dec
+ d << "Node(" << hex << (const void *) n << dec
<< "flags=" << (int) n->flags() << dec
<< (n->isSubtreeBlocked() ? "*BLOCKED*" : "");
#ifdef QSG_RUNTIME_DESCRIPTION
// Adds compatibility with Qt 5.3 and earlier's QSG_RENDER_TIMING
if (qEnvironmentVariableIsSet("QSG_RENDER_TIMING")) {
- ((QLoggingCategory &) QSG_LOG_TIME_GLYPH()).setEnabled(QtDebugMsg, true);
- ((QLoggingCategory &) QSG_LOG_TIME_TEXTURE()).setEnabled(QtDebugMsg, true);
- ((QLoggingCategory &) QSG_LOG_TIME_RENDERER()).setEnabled(QtDebugMsg, true);
- ((QLoggingCategory &) QSG_LOG_TIME_RENDERLOOP()).setEnabled(QtDebugMsg, true);
- ((QLoggingCategory &) QSG_LOG_TIME_COMPILATION()).setEnabled(QtDebugMsg, true);
+ const_cast<QLoggingCategory &>(QSG_LOG_TIME_GLYPH()).setEnabled(QtDebugMsg, true);
+ const_cast<QLoggingCategory &>(QSG_LOG_TIME_TEXTURE()).setEnabled(QtDebugMsg, true);
+ const_cast<QLoggingCategory &>(QSG_LOG_TIME_RENDERER()).setEnabled(QtDebugMsg, true);
+ const_cast<QLoggingCategory &>(QSG_LOG_TIME_RENDERLOOP()).setEnabled(QtDebugMsg, true);
+ const_cast<QLoggingCategory &>(QSG_LOG_TIME_COMPILATION()).setEnabled(QtDebugMsg, true);
}
}
// For compatibility with 5.3 and earlier's QSG_INFO environment variables
if (qEnvironmentVariableIsSet("QSG_INFO"))
- ((QLoggingCategory &) QSG_LOG_INFO()).setEnabled(QtDebugMsg, true);
+ const_cast<QLoggingCategory &>(QSG_LOG_INFO()).setEnabled(QtDebugMsg, true);
s_instance = QSGContext::createWindowManager();
void QActionAnimation::debugAnimation(QDebug d) const
{
- d << "ActionAnimation(" << hex << (void *) this << dec << ")";
+ d << "ActionAnimation(" << hex << (const void *) this << dec << ")";
if (animAction) {
int indentLevel = 1;
void QQuickBulkValueAnimator::debugAnimation(QDebug d) const
{
- d << "BulkValueAnimation(" << hex << (void *) this << dec << ")" << "duration:" << duration();
+ d << "BulkValueAnimation(" << hex << (const void *) this << dec << ")" << "duration:" << duration();
if (animValue) {
int indentLevel = 1;
void QSmoothedAnimation::debugAnimation(QDebug d) const
{
- d << "SmoothedAnimationJob(" << hex << (void *) this << dec << ")" << "duration:" << userDuration
+ d << "SmoothedAnimationJob(" << hex << (const void *) this << dec << ")" << "duration:" << userDuration
<< "velocity:" << velocity << "target:" << target.object() << "property:" << target.name()
<< "to:" << to << "current velocity:" << trackVelocity;
}
void QSpringAnimation::debugAnimation(QDebug d) const
{
- d << "SpringAnimationJob(" << hex << (void *) this << dec << ")" << "velocity:" << maxVelocity
+ d << "SpringAnimationJob(" << hex << (const void *) this << dec << ")" << "velocity:" << maxVelocity
<< "spring:" << spring << "damping:" << damping << "epsilon:" << epsilon << "modulus:" << modulus
<< "mass:" << mass << "target:" << target.object() << "property:" << target.name()
<< "to:" << to << "current velocity:" << velocity;
void QQuickTimeLine::debugAnimation(QDebug d) const
{
- d << "QuickTimeLine(" << hex << (void *) this << dec << ")";
+ d << "QuickTimeLine(" << hex << (const void *) this << dec << ")";
}
bool operator<(const QPair<int, Update> &lhs,