From 87f4c854d859116337cd1dc4da820c9494e9e78e Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Wed, 6 May 2020 17:59:39 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=B4=D0=BC=D0=BE=D0=B4=D1=83?= =?UTF-8?q?=D0=BB=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmake/cmlib | 2 +- cmake/etc/uncrustify | 2 +- cmake/find | 2 +- examples/filesystem/01_minimal/minimal.cpp | 4 ++-- l10n/example-qt-translators_ru_RU.ts | 13 ------------- src/myx/base/enum_bitmask_operations.hpp | 5 +++-- src/myx/base/limits.hpp | 6 +++--- src/myx/filesystem/paths.cpp | 2 +- src/myx/filesystem/paths.hpp | 4 ++-- src/myx/filesystem/paths_mt.cpp | 8 ++++---- src/myx/filesystem/paths_mt.hpp | 4 ++-- 11 files changed, 20 insertions(+), 32 deletions(-) diff --git a/cmake/cmlib b/cmake/cmlib index 9df1889..23be253 160000 --- a/cmake/cmlib +++ b/cmake/cmlib @@ -1 +1 @@ -Subproject commit 9df188963e5980d305dd50d721978ccdd997a8c3 +Subproject commit 23be253a8db87d51c25a67ffc41c452e5b8f58d5 diff --git a/cmake/etc/uncrustify b/cmake/etc/uncrustify index 0cd764f..959608f 160000 --- a/cmake/etc/uncrustify +++ b/cmake/etc/uncrustify @@ -1 +1 @@ -Subproject commit 0cd764fc187ab3b66cb31a5549f13b3336858894 +Subproject commit 959608f6b5d8c6e4add9f9e7422109bc6b795a5f diff --git a/cmake/find b/cmake/find index d0bc6e7..00bbf68 160000 --- a/cmake/find +++ b/cmake/find @@ -1 +1 @@ -Subproject commit d0bc6e71e9c613eaaecca62eaf445d647f5216ed +Subproject commit 00bbf686cdb5bd32ba7105bec1234c85aee6f0aa diff --git a/examples/filesystem/01_minimal/minimal.cpp b/examples/filesystem/01_minimal/minimal.cpp index 5616bcc..1460a61 100644 --- a/examples/filesystem/01_minimal/minimal.cpp +++ b/examples/filesystem/01_minimal/minimal.cpp @@ -11,8 +11,8 @@ namespace MF = myx::filesystem; // Переменные для защиты экземпляра класса MF::PathsMT -std::atomic< MF::PathsMT* > MF::PathsMT::mInstance; -std::mutex MF::PathsMT::mMutex; +std::atomic< MF::PathsMT* > MF::PathsMT::sInstance; +std::mutex MF::PathsMT::sMutex; int main( int argc, char** argv ) diff --git a/l10n/example-qt-translators_ru_RU.ts b/l10n/example-qt-translators_ru_RU.ts index a8264a7..f62cf2e 100644 --- a/l10n/example-qt-translators_ru_RU.ts +++ b/l10n/example-qt-translators_ru_RU.ts @@ -1,17 +1,4 @@ - - QObject - - - Yes - Да - - - - Cancel - Отмена - - diff --git a/src/myx/base/enum_bitmask_operations.hpp b/src/myx/base/enum_bitmask_operations.hpp index 12a8d56..573bac1 100644 --- a/src/myx/base/enum_bitmask_operations.hpp +++ b/src/myx/base/enum_bitmask_operations.hpp @@ -12,7 +12,7 @@ namespace base { template< typename Enum > struct EnableBitMaskOperators { - static const bool k_Enable = false; + static const bool kEnable = false; }; template< typename Enum > @@ -47,11 +47,12 @@ operator |( Enum lhs, Enum rhs ) * ENABLE_BITMASK_OPERATORS(ns::Permissions) */ +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) #define ENABLE_BITMASK_OPERATORS( x ) \ template<> \ struct myx::base::EnableBitMaskOperators< x > \ { \ - static const bool k_Enable = true; \ + static const bool kEnable = true; \ }; #endif // ifndef MYX_BASE_ENUM_BITWISE_OPERATIONS_HPP_ diff --git a/src/myx/base/limits.hpp b/src/myx/base/limits.hpp index 53c02d1..3f5d390 100644 --- a/src/myx/base/limits.hpp +++ b/src/myx/base/limits.hpp @@ -12,17 +12,17 @@ namespace base { /** * @brief Константа, представляющая значение, не являющееся числом, для типа float */ -constexpr float k_FloatNAN { std::numeric_limits< float >::quiet_NaN() }; +constexpr float kFloatNAN { std::numeric_limits< float >::quiet_NaN() }; /** * @brief Константа, представляющая значение, не являющееся числом, для типа double */ -constexpr double k_DoubleNAN { std::numeric_limits< double >::quiet_NaN() }; +constexpr double kDoubleNAN { std::numeric_limits< double >::quiet_NaN() }; /** * @brief Константа, представляющая значение, не являющееся числом, для типа long double */ -constexpr double k_LongDoubleNAN { std::numeric_limits< long double >::quiet_NaN() }; +constexpr double kLongDoubleNAN { std::numeric_limits< long double >::quiet_NaN() }; } // namespace base diff --git a/src/myx/filesystem/paths.cpp b/src/myx/filesystem/paths.cpp index dc5b611..8811210 100644 --- a/src/myx/filesystem/paths.cpp +++ b/src/myx/filesystem/paths.cpp @@ -21,7 +21,7 @@ namespace filesystem { MYXLIB_INLINE Paths::Paths() = default; -MYXLIB_INLINE Paths::HierarchyType Paths::getHierarchyType() +MYXLIB_INLINE Paths::HierarchyType Paths::getHierarchyType() // V2008 { QRegExp binUnityRegexp( "/s*bin/unity$" ); QRegExp binRegexp( "/s*bin$" ); diff --git a/src/myx/filesystem/paths.hpp b/src/myx/filesystem/paths.hpp index 6cb93be..e542094 100644 --- a/src/myx/filesystem/paths.hpp +++ b/src/myx/filesystem/paths.hpp @@ -102,8 +102,8 @@ public: */ static Paths& instance() { - static Paths p; - return( p ); + static Paths sPaths; + return( sPaths ); } diff --git a/src/myx/filesystem/paths_mt.cpp b/src/myx/filesystem/paths_mt.cpp index b0c5e86..b1adf3c 100644 --- a/src/myx/filesystem/paths_mt.cpp +++ b/src/myx/filesystem/paths_mt.cpp @@ -23,15 +23,15 @@ MYXLIB_INLINE PathsMT::PathsMT() = default; MYXLIB_INLINE PathsMT& PathsMT::instance() { - volatile PathsMT* localInstance = mInstance.load( std::memory_order_acquire ); + volatile PathsMT* localInstance = sInstance.load( std::memory_order_acquire ); if ( localInstance == nullptr ) { - std::lock_guard< std::mutex > myLock( mMutex ); - localInstance = mInstance.load( std::memory_order_relaxed ); + std::lock_guard< std::mutex > myLock( sMutex ); + localInstance = sInstance.load( std::memory_order_relaxed ); if ( localInstance == nullptr ) // -V1036 { localInstance = new PathsMT(); - mInstance.store( const_cast< PathsMT* >( localInstance ), std::memory_order_release ); // NOLINT + sInstance.store( const_cast< PathsMT* >( localInstance ), std::memory_order_release ); // NOLINT } } return( const_cast< PathsMT& >( *localInstance ) ); // NOLINT diff --git a/src/myx/filesystem/paths_mt.hpp b/src/myx/filesystem/paths_mt.hpp index 3a5b7fd..3247c75 100644 --- a/src/myx/filesystem/paths_mt.hpp +++ b/src/myx/filesystem/paths_mt.hpp @@ -31,8 +31,8 @@ class PathsMT : public Paths PathsMT(); ~PathsMT() = default; - static std::atomic< PathsMT* > mInstance; - static std::mutex mMutex; + static std::atomic< PathsMT* > sInstance; + static std::mutex sMutex; public: