making clang happy

This commit is contained in:
Uwe Rathmann 2017-10-30 08:08:58 +01:00
parent 324ed2f80c
commit 9caad94075
8 changed files with 18 additions and 51 deletions

View File

@ -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 )

View File

@ -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 )
{

View File

@ -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 );

View File

@ -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

View File

@ -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] );

View File

@ -18,7 +18,7 @@ class QRectF;
class QColor;
class QFont;
class QMarginsF;
class QMetaObject;
struct QMetaObject;
class QVariant;
class QDebug;

View File

@ -56,6 +56,10 @@ namespace
class LayoutStyleInfo final : public QAbstractLayoutStyleInfo
{
public:
LayoutStyleInfo()
{
}
virtual qreal spacing( Qt::Orientation ) const override
{
// later from the theme !!

View File

@ -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 ) );
}
}