Правка регистра

This commit is contained in:
2020-04-21 10:59:42 +03:00
parent 95a197a873
commit ab740f7795
6 changed files with 23 additions and 24 deletions

View File

@ -13,17 +13,17 @@ namespace base {
template< typename Enum >
struct EnableBitMaskOperators
{
static const bool enable = false;
static const bool k_Enable = false;
};
template< typename Enum >
typename std::enable_if< EnableBitMaskOperators< Enum >::enable, Enum >::type
typename std::enable_if< EnableBitMaskOperators< Enum >::k_Enable, Enum >::type
operator |( Enum lhs, Enum rhs )
{
using underlying = typename std::underlying_type< Enum >::type;
using Underlying = typename std::underlying_type< Enum >::type;
return( static_cast< Enum >(
static_cast< underlying >( lhs ) |
static_cast< underlying >( rhs )
static_cast< Underlying >( lhs ) |
static_cast< Underlying >( rhs )
) );
}
@ -52,7 +52,7 @@ operator |( Enum lhs, Enum rhs )
template<> \
struct myx::base::EnableBitMaskOperators< x > \
{ \
static const bool enable = true; \
static const bool k_Enable = true; \
};
#endif // ifndef MYX_BASE_ENUM_BITWISE_OPERATIONS_HPP_

View File

@ -10,8 +10,8 @@ namespace math {
bool almost_equal_ulps( const float a, const float b,
const int maxUlpsDiff )
{
float_cmp_t uA( a );
float_cmp_t uB( b );
FloatCmp uA( a );
FloatCmp uB( b );
// Если знаки разные, то числа не равны.
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access)
@ -46,8 +46,8 @@ bool almost_equal_ulps( const float a, const float b,
bool almost_equal_ulps( const double a, const double b,
const int maxUlpsDiff )
{
double_cmp_t uA( a );
double_cmp_t uB( b );
DoubleCmp uA( a );
DoubleCmp uB( b );
// Если знаки разные, то числа не равны.
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access)

View File

@ -18,8 +18,8 @@ bool almost_equal_ulps_and_abs( const float a, const float b,
return( true );
}
float_cmp_t uA( a );
float_cmp_t uB( b );
FloatCmp uA( a );
FloatCmp uB( b );
// Different signs means they do not match.
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access)
@ -51,8 +51,8 @@ bool almost_equal_ulps_and_abs( const double a, const double b,
return( true );
}
double_cmp_t uA( a );
double_cmp_t uB( b );
DoubleCmp uA( a );
DoubleCmp uB( b );
// Different signs means they do not match.
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access)

View File

@ -6,7 +6,7 @@
/**
* @brief Объединение для получения знака аргумента типа float.
*/
union float_cmp_t
union FloatCmp
{
int32_t i;
float f;
@ -14,7 +14,7 @@ union float_cmp_t
/**
* @brief Инициализация.
*/
explicit float_cmp_t( float num = 0.0F ) : f( num )
explicit FloatCmp( float num = 0.0F ) : f( num )
{
}
@ -30,7 +30,7 @@ union float_cmp_t
/**
* @brief Объединение для получения знака аргумента типа double.
*/
union double_cmp_t
union DoubleCmp
{
int64_t i;
double d;
@ -38,7 +38,7 @@ union double_cmp_t
/**
* @brief Инициализация.
*/
explicit double_cmp_t( double num = 0.0L ) : d( num )
explicit DoubleCmp( double num = 0.0L ) : d( num )
{
}

View File

@ -9,7 +9,7 @@ namespace myx {
namespace qt {
typedef QList< QTranslator* > QTranslatorsList;
using QTranslatorsList = QList< QTranslator* >;
void append_translators( QTranslatorsList& translators, const QString& appName ); // NOLINT