Skip to content

Commit

Permalink
Pull in a number of changes from mcneel/opennurbs#28
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Jan 21, 2022
1 parent 658da69 commit f50dd0d
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/other/openNURBS/opennurbs_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -2133,7 +2133,7 @@ class ON_CLASS ON
// the values. The reason for the gaps between the enum
// values is to leave room for future snaps with prededence
// falling between existing snaps
enum osnap_mode
enum osnap_mode: unsigned int
{
os_none = 0,
os_near = 2,
Expand Down Expand Up @@ -2409,7 +2409,7 @@ class ON_CLASS ON_COMPONENT_INDEX
// Do not change these values; they are stored in 3dm archives
// and provide a persistent way to indentify components of
// complex objects.
enum TYPE
enum TYPE: unsigned int
{
invalid_type = 0,

Expand Down
4 changes: 2 additions & 2 deletions src/other/openNURBS/opennurbs_file_utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3302,13 +3302,13 @@ void ON_ContentHash::Dump(

const ON_wString content_time
= ( m_content_time <= 0 )
? L"unknown"
? static_cast<ON_wString>(L"unknown")
: SecondsSinceJanOne1970UTCToString(m_content_time);
text_log.Print(L"Content last modified time = %ls\n",static_cast<const wchar_t*>(content_time));

const ON_wString hash_time
= ( m_hash_time <= 0 )
? L"unknown"
? static_cast<ON_wString>(L"unknown")
: SecondsSinceJanOne1970UTCToString(m_hash_time);
text_log.Print(L"Content hash calculated time = %ls\n",static_cast<const wchar_t*>(content_time));

Expand Down
9 changes: 3 additions & 6 deletions src/other/openNURBS/opennurbs_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,10 @@ class ON_CLASS ON_Lock
// needs to have dll-interface to be used by clients of class 'ON_Lock'
// m_lock_value is private and all code that manages m_lock_value is explicitly implemented in the DLL.
private:
#if defined(ON_COMPILER_CLANG)
std::atomic<int> m_lock_value;
#if defined(ON_CLANG_CONSTRUCTOR_BUG_INIT)
std::atomic<int> m_lock_value;
#else
//std::atomic<int> m_lock_value = ON_Lock::UnlockedValue;

// https://discourse.mcneel.com/t/on-compiler-gnu-support-for-opennurbs/77308
std::atomic<int> m_lock_value { ON_Lock::UnlockedValue };
std::atomic<int> m_lock_value = ON_Lock::UnlockedValue;
#endif
#pragma ON_PRAGMA_WARNING_POP
};
Expand Down
2 changes: 1 addition & 1 deletion src/other/openNURBS/opennurbs_object_history.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ON_Value
// The VALUE_TYPE enum values must never be changed
// because the values are used to determine the parameter
// type during file reading. Additions can be made.
enum VALUE_TYPE
enum VALUE_TYPE: unsigned int
{
no_value_type = 0,

Expand Down
4 changes: 2 additions & 2 deletions src/other/openNURBS/opennurbs_statics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ static ON_SHA1_Hash ON_SHA1_Hash_EmptyContentHash()
const ON_SHA1_Hash ON_SHA1_Hash::EmptyContentHash = ON_SHA1_Hash_EmptyContentHash();
const ON_SHA1_Hash ON_SHA1_Hash::ZeroDigest ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_SHA1_Hash);

const ONX_ModelTest ONX_ModelTest::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ONX_ModelTest);
const ONX_ModelTest ONX_ModelTest::Unset = ONX_ModelTest();

// Works with Microsoft's CL, fails for Apple's CLang
//// const struct ON_UnicodeErrorParameters ON_UnicodeErrorParameters::MaskErrors = { 0, 0xFFFFFFFF, ON_UnicodeCodePoint::ON_ReplacementCharacter };
Expand Down Expand Up @@ -744,7 +744,7 @@ const ON_AngleUnitName ON_AngleUnitName::None ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_A
const ON_LengthValue ON_LengthValue::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_LengthValue);
const ON_LengthValue ON_LengthValue::Zero = ON_LengthValue::Create(0.0, ON::LengthUnitSystem::None, 0, ON_LengthValue::StringFormat::CleanDecimal);

const ON_AngleValue ON_AngleValue::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_AngleValue);
const ON_AngleValue ON_AngleValue::Unset = ON_AngleValue();
const ON_AngleValue ON_AngleValue::Zero = ON_AngleValue::Create(0.0, ON::AngleUnitSystem::None, 0, ON_AngleValue::StringFormat::CleanDecimal );

const ON_ScaleValue ON_ScaleValue::Unset ON_CLANG_CONSTRUCTOR_BUG_INIT(ON_ScaleValue);
Expand Down
2 changes: 2 additions & 0 deletions src/other/openNURBS/opennurbs_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,8 @@ typedef ON__UINT32 wchar_t;
#pragma ON_PRAGMA_WARNING_BEFORE_DIRTY_INCLUDE
#if defined(ON_RUNTIME_ANDROID) || defined(ON_RUNTIME_LINUX)
#include "android_uuid/uuid.h"
#elif defined(ON_RUNTIME_WIN)
#include <Rpc.h>
#else
#include <uuid/uuid.h>
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/other/openNURBS/opennurbs_version_number.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ const ON_String ON_VersionNumberToString(
str_version =
(0 != version_number)
? ON_String::FormatToString("0x%08X", version_number)
: "0";
: static_cast<ON_String>("0");
}

return str_version;
Expand Down

0 comments on commit f50dd0d

Please sign in to comment.