@@ -37,7 +37,7 @@ template <typename Type>
37
37
typename app::NumericAttributeTraits<Type>::WorkingType
38
38
ConvertDefaultValueToWorkingValue (const EmberAfDefaultAttributeValue & defaultValue)
39
39
{
40
- if (sizeof (typename app::NumericAttributeTraits<Type>::WorkingType) <= 2 )
40
+ if constexpr (sizeof (typename app::NumericAttributeTraits<Type>::WorkingType) <= 2 )
41
41
{
42
42
return static_cast <typename app::NumericAttributeTraits<Type>::WorkingType>(defaultValue.defaultValue );
43
43
}
@@ -48,10 +48,10 @@ ConvertDefaultValueToWorkingValue(const EmberAfDefaultAttributeValue & defaultVa
48
48
}
49
49
50
50
// / IsOnlyOneValuePopulated
51
- // / @brief Helper function to verify if only one value is populated in a given AttributeValuePairType
51
+ // / @brief Helper function to verify that exactly one value is populated in a given AttributeValuePairType
52
52
// / @param AttributeValuePairType & type AttributeValuePairType to verify
53
53
// / @return bool true if only one value is populated, false otherwise
54
- bool IsOnlyOneValuePopulated (const AttributeValuePairType & type)
54
+ bool IsExactlyOneValuePopulated (const AttributeValuePairType & type)
55
55
{
56
56
int count = 0 ;
57
57
if (type.valueUnsigned8 .HasValue ())
@@ -80,7 +80,7 @@ bool IsOnlyOneValuePopulated(const AttributeValuePairType & type)
80
80
// / @param[in] metadata EmberAfAttributeMetadata
81
81
// /
82
82
template <typename Type>
83
- void CapAttributeID (typename app::NumericAttributeTraits<Type>::WorkingType & Value , const EmberAfAttributeMetadata * metadata)
83
+ void CapAttributeValue (typename app::NumericAttributeTraits<Type>::WorkingType & value , const EmberAfAttributeMetadata * metadata)
84
84
{
85
85
using IntType = app::NumericAttributeTraits<Type>;
86
86
using WorkingType = typename IntType::WorkingType;
@@ -89,7 +89,7 @@ void CapAttributeID(typename app::NumericAttributeTraits<Type>::WorkingType & Va
89
89
WorkingType minValue;
90
90
uint16_t bitWidth = static_cast <uint16_t >(emberAfAttributeSize (metadata) * 8 );
91
91
92
- // Min/Max Value capps for the OddSize integers
92
+ // Min/Max Value caps for the OddSize integers
93
93
if (metadata->IsSignedIntegerAttribute ())
94
94
{
95
95
// We use emberAfAttributeSize for cases like INT24S, INT40S, INT48S, INT56S where numeric_limits<WorkingType>::max()
0 commit comments