From 9fe66208e09484f6f006675a89165841d09d60cc Mon Sep 17 00:00:00 2001 From: Steve Baer Date: Mon, 27 Dec 2021 20:30:01 -0800 Subject: [PATCH] tune classes to remove need for clang_compiler macro --- opennurbs_extensions.h | 16 ++++++++-------- opennurbs_string_value.h | 2 +- opennurbs_system_compiler.h | 29 ----------------------------- 3 files changed, 9 insertions(+), 38 deletions(-) diff --git a/opennurbs_extensions.h b/opennurbs_extensions.h index 5543974e..bf236e59 100644 --- a/opennurbs_extensions.h +++ b/opennurbs_extensions.h @@ -2065,18 +2065,18 @@ public: std::shared_ptr ReadWriteReadModel() const; - private: - ONX_ModelTest::Type m_test_type = ONX_ModelTest::Type::Unset; +private: + ONX_ModelTest::Type m_test_type = ONX_ModelTest::Type::Unset; - ON_wString m_source_3dm_file_path; + ON_wString m_source_3dm_file_path; - // if set, used when printing the name of m_source_3dm_file_path in the text - // log so results from different computers can be compared. - ON_wString m_text_log_3dm_file_path; + // if set, used when printing the name of m_source_3dm_file_path in the text + // log so results from different computers can be compared. + ON_wString m_text_log_3dm_file_path; - unsigned int m_model_3dm_file_version[3]; + unsigned int m_model_3dm_file_version[3] = {0}; - unsigned int m_current_test_index = 0; + unsigned int m_current_test_index = 0; ONX_ModelTest::Result m_test_result = ONX_ModelTest::Result::Unset; ONX_ModelTest::Result m_test_results[7] = {}; diff --git a/opennurbs_string_value.h b/opennurbs_string_value.h index 95b712cc..b84e1d07 100644 --- a/opennurbs_string_value.h +++ b/opennurbs_string_value.h @@ -432,7 +432,7 @@ public: private: // parsing context unsigned int m_context_locale_id = 0; - ON::LengthUnitSystem m_context_length_unit_system; + ON::LengthUnitSystem m_context_length_unit_system = ON::LengthUnitSystem::None; ON_AngleValue::StringFormat m_string_format = ON_AngleValue::StringFormat::ExactDecimal; ON::AngleUnitSystem m_angle_unit_system = ON::AngleUnitSystem::Unset; diff --git a/opennurbs_system_compiler.h b/opennurbs_system_compiler.h index c03e7694..84ccd97d 100644 --- a/opennurbs_system_compiler.h +++ b/opennurbs_system_compiler.h @@ -235,8 +235,6 @@ // ///////////////////////////////////////////////////////////////////////////////////// -#define ON_CLANG_CONSTRUCTOR_BUG - #endif #endif @@ -275,33 +273,6 @@ #define ON_PRAGMA_WARNING_POP clang diagnostic pop // Apple CLang warning state pop #define ON_PRAGMA_WARNING_DISABLE_CLANG(ON_PRAGMA_WARNING_DISABLE_param) clang diagnostic ignored ON_PRAGMA_WARNING_DISABLE_param // Apple CLang warning disable -// clang has a bug that is fails to correctly construct statc const objects -// in the following case -// -// // header file -// class Blah -// { -// public: -// Blah() = default; -// ~Blah() = default; -// Blah(const Blah&) = default; -// Blah& operator=(const Blah&) = default; -// -// static const Blah Zero; -// -// int m_i = 0; -// }; -// -// ... -// -// // cpp file -// const Blah Blah::Zero; // correct C++ 11, Apple's clang fails as of February, 2015 -// const Blah Blah::Zero( Blah() ); // clang fails to use copy constructor -// const Blah Blah::Zero = Blah(); // clang can handle this -// -// When this bug is fixed, delete this define and the places -// in the code that use it. -#define ON_CLANG_CONSTRUCTOR_BUG #if defined(__has_feature) && __has_feature(cxx_noexcept) #undef ON_NOEXCEPT