diff --git a/src/common/QskAspect.cpp b/src/common/QskAspect.cpp index beb7d93f..4ec635a5 100644 --- a/src/common/QskAspect.cpp +++ b/src/common/QskAspect.cpp @@ -127,7 +127,7 @@ static QByteArray qskEnumString( const char* name, int value ) return key ? QByteArray( key ) : QString::number( value ).toLatin1(); } -QByteArray qskStateKey( const QMetaObject* metaObject, quint16 state ) +static QByteArray qskStateKey( const QMetaObject* metaObject, quint16 state ) { const auto& stateTable = qskAspectRegistry->stateTable; diff --git a/src/common/QskAspect.h b/src/common/QskAspect.h index d72a96a0..dc091045 100644 --- a/src/common/QskAspect.h +++ b/src/common/QskAspect.h @@ -168,8 +168,8 @@ namespace QskAspect ColorPrimitive colorPrimitive() const; MetricPrimitive metricPrimitive() const; - void setPrimitive( Type, int primitive ); - int primitive() const; + void setPrimitive( Type, uint primitive ); + uint primitive() const; void clearPrimitive(); const char* toPrintable() const; @@ -179,24 +179,24 @@ namespace QskAspect constexpr Aspect( uint subControl, uint type, bool isAnimator, uint primitive, uint placement, uint states ); + struct Bits + { + uint subControl : 12; + + uint type : 3; + bool isAnimator : 1; + + uint primitive : 7; + uint placement : 1; + uint reserved1 : 8; + + uint states : 16; + uint reserved2 : 16; + }; + union { - struct - { - uint subControl : 12; - - uint type : 3; - bool isAnimator : 1; - - uint primitive : 7; - uint placement : 1; - uint reserved1 : 8; - - uint states : 16; - uint reserved2 : 16; - - } m_bits; - + Bits m_bits; quint64 m_value; }; }; @@ -366,12 +366,12 @@ namespace QskAspect return static_cast< MetricPrimitive >( m_bits.primitive ); } - inline int Aspect::primitive() const + inline uint Aspect::primitive() const { return m_bits.primitive; } - inline void Aspect::setPrimitive( Type type, int primitive ) + inline void Aspect::setPrimitive( Type type, uint primitive ) { m_bits.type = type; m_bits.primitive = primitive;