X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/39601a7f74796aae377ad1520595f083fdafd7b6..4c9147881b2afa5881e9821196999b8aade9cd0d:/src/common/any.cpp diff --git a/src/common/any.cpp b/src/common/any.cpp index 9923d3ef07..ff7b1c8a30 100644 --- a/src/common/any.cpp +++ b/src/common/any.cpp @@ -105,20 +105,6 @@ wxAnyValueType::wxAnyValueType() g_wxAnyValueTypeGlobals->RegisterValueType(this); } -//------------------------------------------------------------------------- -// wxAny -//------------------------------------------------------------------------- - -void wxAny::AssignAny(const wxAny &any) -{ - if ( !any.m_type->IsSameType(m_type) ) - { - m_type->DeleteValue(m_buffer); - m_type = any.m_type; - } - m_type->CopyBuffer(any.m_buffer, m_buffer); -} - //------------------------------------------------------------------------- // Dynamic conversion member functions //------------------------------------------------------------------------- @@ -126,27 +112,23 @@ void wxAny::AssignAny(const wxAny &any) // // Define integer minimum and maximum as helpers #ifdef wxLongLong_t -const wxAnyBaseIntType UseIntMin = wxINT64_MIN; -const wxAnyBaseUintType UseIntMax = wxINT64_MAX; -const wxAnyBaseUintType UseUintMax = wxUINT64_MAX; + #define UseIntMin (wxINT64_MIN) + #define UseIntMax (wxINT64_MAX) + #define UseUintMax (wxUINT64_MAX) #else -const wxAnyBaseIntType UseIntMin = LONG_MIN; -const wxAnyBaseUintType UseUintMax = ULONG_MAX; -const wxAnyBaseUintType UseIntMax = LONG_MAX; + #define UseIntMin (LONG_MIN) + #define UseIntMax (LONG_MAX) + #define UseUintMax (ULONG_MAX) #endif +namespace +{ + const double UseIntMinF = static_cast(UseIntMin); -#ifndef __VISUALC6__ const double UseIntMaxF = static_cast(UseIntMax); const double UseUintMaxF = static_cast(UseUintMax); -#else -// VC6 doesn't implement conversion from unsigned __int64 to double -const wxAnyBaseIntType UseIntMax0 = static_cast(UseIntMax); -const wxAnyBaseIntType UseUintMax0 = static_cast(UseUintMax); -const double UseIntMaxF = static_cast(UseIntMax0); -const double UseUintMaxF = static_cast(UseUintMax0); -#endif +} // anonymous namespace bool wxAnyValueTypeImplInt::ConvertValue(const wxAnyValueBuffer& src, wxAnyValueType* dstType, @@ -353,6 +335,10 @@ WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImplString) WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImpl) WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImplDouble) +WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImpl) +//WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImpl) +//WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImpl) + //------------------------------------------------------------------------- // wxAnyNullValueType implementation //------------------------------------------------------------------------- @@ -368,12 +354,12 @@ class wxAnyValueTypeImpl : public wxAnyValueType { WX_DECLARE_ANY_VALUE_TYPE(wxAnyValueTypeImpl) public: + // Dummy implementations virtual void DeleteValue(wxAnyValueBuffer& buf) const { - buf.m_ptr = NULL; // This is important + wxUnusedVar(buf); } - // Dummy implementations virtual void CopyBuffer(const wxAnyValueBuffer& src, wxAnyValueBuffer& dst) const {