diff --git a/src/common/QskAspect.h b/src/common/QskAspect.h index 933d135e..87164eee 100644 --- a/src/common/QskAspect.h +++ b/src/common/QskAspect.h @@ -288,7 +288,7 @@ namespace QskAspect inline constexpr quint64 Aspect::value() const { - return *reinterpret_cast< const quint64* >( this ); + return *( const quint64* ) this; } inline bool Aspect::isAnimator() const @@ -398,7 +398,7 @@ namespace QskAspect inline constexpr Aspect operator|( Subcontrol subControl, const Aspect& aspect ) { - return subControl | aspect; + return aspect | subControl; } inline constexpr Aspect operator|( Type type, const Aspect& aspect ) diff --git a/src/common/QskBoxShapeMetrics.h b/src/common/QskBoxShapeMetrics.h index 78c0a8c4..36fc42b3 100644 --- a/src/common/QskBoxShapeMetrics.h +++ b/src/common/QskBoxShapeMetrics.h @@ -76,7 +76,7 @@ public: private: inline constexpr QskBoxShapeMetrics( Qt::SizeMode sizeMode, const QSizeF radii[4] ): - m_radii( { radii[0], radii[1], radii[2], radii[3] } ), + m_radii{ radii[0], radii[1], radii[2], radii[3] }, m_sizeMode( sizeMode ), m_aspectRatioMode( Qt::KeepAspectRatio ) { @@ -88,7 +88,7 @@ private: }; inline constexpr QskBoxShapeMetrics::QskBoxShapeMetrics(): - m_radii( { { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 } } ), + m_radii{ { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 } }, m_sizeMode( Qt::AbsoluteSize ), m_aspectRatioMode( Qt::KeepAspectRatio ) { @@ -101,8 +101,8 @@ inline QskBoxShapeMetrics::QskBoxShapeMetrics( qreal radius, Qt::SizeMode sizeMo inline constexpr QskBoxShapeMetrics::QskBoxShapeMetrics( qreal topLeft, qreal topRight, qreal bottomLeft, qreal bottomRight, Qt::SizeMode sizeMode ): - m_radii( { { topLeft, topLeft }, { topRight, topRight }, - { bottomLeft, bottomLeft }, { bottomRight, bottomRight } } ), + m_radii{ { topLeft, topLeft }, { topRight, topRight }, + { bottomLeft, bottomLeft }, { bottomRight, bottomRight } }, m_sizeMode( sizeMode ), m_aspectRatioMode( Qt::KeepAspectRatio ) { diff --git a/src/common/QskObjectCounter.cpp b/src/common/QskObjectCounter.cpp index 30bbd55d..3e91eb75 100644 --- a/src/common/QskObjectCounter.cpp +++ b/src/common/QskObjectCounter.cpp @@ -145,41 +145,26 @@ void QskObjectCounter::reset() int QskObjectCounter::created( ObjectType objectType ) const { - if ( objectType >= 0 && objectType < 2 ) - return m_counter[objectType].created; - - return 0; + return m_counter[objectType].created; } int QskObjectCounter::destroyed( ObjectType objectType ) const { - if ( objectType >= 0 && objectType < 2 ) - return m_counter[objectType].destroyed; - - return 0; + return m_counter[objectType].destroyed; } int QskObjectCounter::current( ObjectType objectType ) const { - if ( objectType >= 0 && objectType < 2 ) - return m_counter[objectType].current; - - return 0; + return m_counter[objectType].current; } int QskObjectCounter::maximum( ObjectType objectType ) const { - if ( objectType >= 0 && objectType < 2 ) - return m_counter[objectType].maximum; - - return 0; + return m_counter[objectType].maximum; } void QskObjectCounter::debugStatistics( QDebug debug, ObjectType objectType ) const { - if ( objectType < 0 || objectType >= 2 ) - return; - const Counter& c = m_counter[objectType]; QDebugStateSaver saver( debug ); diff --git a/src/controls/QskInputPanel.cpp b/src/controls/QskInputPanel.cpp index 4fa90132..7671bb93 100644 --- a/src/controls/QskInputPanel.cpp +++ b/src/controls/QskInputPanel.cpp @@ -181,15 +181,6 @@ static qreal qskRowStretch( const QskInputPanel::KeyRow& keyRow ) return stretch; } -static inline int qskKeyCount( const QskInputPanel::KeyDataRow& keyRow ) -{ - int keyCount = QskInputPanel::KeyCount; - while ( !keyRow[ keyCount - 1 ].key ) - --keyCount; - - return keyCount; -} - namespace { struct KeyCounter diff --git a/src/controls/QskSkinTransition.cpp b/src/controls/QskSkinTransition.cpp index 46797f3f..5016be76 100644 --- a/src/controls/QskSkinTransition.cpp +++ b/src/controls/QskSkinTransition.cpp @@ -416,7 +416,7 @@ void QskSkinTransition::process() qskSkinAnimator->reset(); - if ( ( m_animation.duration <= 0 ) || ( m_mask == QskAspect::Type( 0 ) ) ) + if ( ( m_animation.duration <= 0 ) || ( m_mask == 0 ) ) { // no animations, we can apply the changes updateSkin( m_skins[0], m_skins[1] ); diff --git a/src/controls/QskSkinnable.h b/src/controls/QskSkinnable.h index 26881238..c01a1117 100644 --- a/src/controls/QskSkinnable.h +++ b/src/controls/QskSkinnable.h @@ -18,7 +18,7 @@ class QRectF; class QColor; class QFont; class QMarginsF; -class QMetaObject; +struct QMetaObject; class QVariant; class QDebug; diff --git a/src/layouts/QskLayoutEngine.cpp b/src/layouts/QskLayoutEngine.cpp index 7a1d608c..5e0185ab 100644 --- a/src/layouts/QskLayoutEngine.cpp +++ b/src/layouts/QskLayoutEngine.cpp @@ -56,6 +56,10 @@ namespace class LayoutStyleInfo final : public QAbstractLayoutStyleInfo { public: + LayoutStyleInfo() + { + } + virtual qreal spacing( Qt::Orientation ) const override { // later from the theme !! diff --git a/src/nodes/QskBoxNode.cpp b/src/nodes/QskBoxNode.cpp index f4d2459a..a2d6958e 100644 --- a/src/nodes/QskBoxNode.cpp +++ b/src/nodes/QskBoxNode.cpp @@ -16,19 +16,6 @@ static QSGVertexColorMaterial qskMaterialVertex; -static inline bool qskHasAlpha( const QRgb* rgbValues ) -{ - return qAlpha( rgbValues[0] ) || qAlpha( rgbValues[1] ) - || qAlpha( rgbValues[2] ) || qAlpha( rgbValues[3] ); -} - -static inline bool qskIsMonochrome( const QRgb* rgbValues ) -{ - return ( rgbValues[0] == rgbValues[1] ) - && ( rgbValues[1] == rgbValues[2] ) - && ( rgbValues[2] == rgbValues[3] ); -} - static inline uint qskMetricsHash( const QskBoxShapeMetrics& shape, const QskBoxBorderMetrics& borderMetrics ) { @@ -190,7 +177,7 @@ void QskBoxNode::setMonochrome( bool on ) setMaterial( new QSGFlatColorMaterial() ); const QSGGeometry g( QSGGeometry::defaultAttributes_Point2D(), 0 ); - memcpy( &m_geometry, &g, sizeof( QSGGeometry ) ); + memcpy( (void *)&m_geometry, (void *)&g, sizeof( QSGGeometry ) ); } else { @@ -198,6 +185,6 @@ void QskBoxNode::setMonochrome( bool on ) delete material; const QSGGeometry g( QSGGeometry::defaultAttributes_ColoredPoint2D(), 0 ); - memcpy( &m_geometry, &g, sizeof( QSGGeometry ) ); + memcpy( (void *)&m_geometry, (void *)&g, sizeof( QSGGeometry ) ); } }