Чистка кода
This commit is contained in:
parent
44466b80de
commit
8f7a08bea6
@ -1,5 +1,5 @@
|
||||
---
|
||||
Checks: '-*,bugprone-*,cppcoreguidelines-*,google-*,clang-analyzer-*,misc-*,modernize-*,readability-*,performance-*,portability-*,readability-identifier-naming,-cppcoreguidelines-owning-memory'
|
||||
Checks: '-*,bugprone-*,cppcoreguidelines-*,google-*,clang-analyzer-*,misc-*,modernize-*,readability-*,performance-*,portability-*,readability-identifier-naming,-cppcoreguidelines-owning-memory,-modernize-use-trailing-return-type'
|
||||
CheckOptions:
|
||||
- key: readability-identifier-naming.AbstractClassCase
|
||||
value: CamelCase
|
||||
|
@ -59,12 +59,11 @@ void Paths::setLogDirectory( const QString& logDirectory )
|
||||
}
|
||||
|
||||
|
||||
Paths::Paths( const QString& configFileExtension ) :
|
||||
m_configFileExtension( configFileExtension )
|
||||
|
||||
Paths::Paths( QString configFileExtension ) :
|
||||
m_prefixDirectory ( "/opt/" + QCoreApplication::organizationName().toLower() +
|
||||
"/" + QCoreApplication::applicationName().toLower() ),
|
||||
m_configFileExtension( std::move( configFileExtension ) )
|
||||
{
|
||||
m_prefixDirectory = "/opt/" + QCoreApplication::organizationName().toLower() +
|
||||
"/" + QCoreApplication::applicationName().toLower();
|
||||
auto pd = m_prefixDirectory.absolutePath();
|
||||
m_binaryDirectory = pd + "/bin";
|
||||
m_configDirectory = pd + "/etc";
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
* @brief Конструктор
|
||||
* @param configFileExtension Расширение для файла настройки
|
||||
*/
|
||||
Paths( const QString& configFileExtension = "conf" );
|
||||
Paths( QString configFileExtension = "conf" );
|
||||
/**
|
||||
* @brief Получение пути к базовому каталогу
|
||||
*/
|
||||
|
@ -14,6 +14,7 @@ bool almost_equal_ulps( const float a, const float b,
|
||||
float_cmp_t uB( b );
|
||||
|
||||
// Если знаки разные, то числа не равны.
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access)
|
||||
if ( uA.negative() != uB.negative() )
|
||||
{
|
||||
// Кроме случая, когда +0==-0
|
||||
@ -32,6 +33,7 @@ bool almost_equal_ulps( const float a, const float b,
|
||||
}
|
||||
|
||||
// Разница в младших битах.
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access)
|
||||
auto ulpsDiff = std::abs( uA.i - uB.i );
|
||||
if ( ulpsDiff <= maxUlpsDiff )
|
||||
{
|
||||
@ -48,6 +50,7 @@ bool almost_equal_ulps( const double a, const double b,
|
||||
double_cmp_t uB( b );
|
||||
|
||||
// Если знаки разные, то числа не равны.
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access)
|
||||
if ( uA.negative() != uB.negative() )
|
||||
{
|
||||
// Кроме случая, когда +0==-0
|
||||
@ -66,6 +69,7 @@ bool almost_equal_ulps( const double a, const double b,
|
||||
}
|
||||
|
||||
// Разница в младших битах.
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access)
|
||||
auto ulpsDiff = std::abs( uA.i - uB.i );
|
||||
if ( ulpsDiff <= maxUlpsDiff )
|
||||
{
|
||||
|
@ -22,12 +22,14 @@ bool almost_equal_ulps_and_abs( const float a, const float b,
|
||||
float_cmp_t uB( b );
|
||||
|
||||
// Different signs means they do not match.
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access)
|
||||
if ( uA.negative() != uB.negative() )
|
||||
{
|
||||
return( false );
|
||||
}
|
||||
|
||||
// Find the difference in ULPs.
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access)
|
||||
int ulpsDiff = std::abs( uA.i - uB.i );
|
||||
if ( ulpsDiff <= maxUlpsDiff )
|
||||
{
|
||||
@ -53,12 +55,14 @@ bool almost_equal_ulps_and_abs( const double a, const double b,
|
||||
double_cmp_t uB( b );
|
||||
|
||||
// Different signs means they do not match.
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access)
|
||||
if ( uA.negative() != uB.negative() )
|
||||
{
|
||||
return( false );
|
||||
}
|
||||
|
||||
// Find the difference in ULPs.
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-union-access)
|
||||
auto ulpsDiff = std::abs( uA.i - uB.i );
|
||||
if ( ulpsDiff <= maxUlpsDiff )
|
||||
{
|
||||
|
@ -13,8 +13,8 @@ void append_translators( QTranslatorsList& translators, const QString& appName )
|
||||
{
|
||||
auto* translator = new QTranslator( qApp );
|
||||
|
||||
if ( translator->load( QLocale(), appName, QStringLiteral( "_" ),
|
||||
QStringLiteral( ":/qm" ) ) )
|
||||
if ( translator->load( QLocale(),
|
||||
appName, QStringLiteral( "_" ), QStringLiteral( ":/qm" ) ) )
|
||||
{
|
||||
translators.append( translator );
|
||||
}
|
||||
@ -50,7 +50,7 @@ void append_translators( QTranslatorsList& translators, const QString& appName )
|
||||
{
|
||||
qApp->installTranslator( i );
|
||||
}
|
||||
} // install_translators
|
||||
} // append_translators
|
||||
|
||||
} // namespace qt
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user