diff --git a/src/coreclr/debug/daccess/stdafx.h b/src/coreclr/debug/daccess/stdafx.h index bff6a4f660379b..e439a01b9fe7e6 100644 --- a/src/coreclr/debug/daccess/stdafx.h +++ b/src/coreclr/debug/daccess/stdafx.h @@ -18,8 +18,6 @@ // and there's no reason why DAC should be forbidden from using it. #define DO_NOT_DISABLE_RAND -#define USE_COM_CONTEXT_DEF - #include #include #include diff --git a/src/coreclr/debug/ee/stdafx.h b/src/coreclr/debug/ee/stdafx.h index 4a07384047d0a7..5fecaecb9bc86d 100644 --- a/src/coreclr/debug/ee/stdafx.h +++ b/src/coreclr/debug/ee/stdafx.h @@ -7,8 +7,6 @@ // //***************************************************************************** -#define USE_COM_CONTEXT_DEF - #include #include #include diff --git a/src/coreclr/md/ceefilegen/stdafx.h b/src/coreclr/md/ceefilegen/stdafx.h index 4026a47f14107d..db15968905ac15 100644 --- a/src/coreclr/md/ceefilegen/stdafx.h +++ b/src/coreclr/md/ceefilegen/stdafx.h @@ -8,7 +8,6 @@ // Common include file for utility code. //***************************************************************************** -#define _CRT_DEPENDENCY_ //this code depends on the crt file functions #include #include #include diff --git a/src/coreclr/unwinder/stdafx.h b/src/coreclr/unwinder/stdafx.h index 8decdc68562bd4..4b9c1de9e5a6d8 100644 --- a/src/coreclr/unwinder/stdafx.h +++ b/src/coreclr/unwinder/stdafx.h @@ -8,8 +8,6 @@ // and there's no reason why DAC should be forbidden from using it. #define DO_NOT_DISABLE_RAND -#define USE_COM_CONTEXT_DEF - #include #include diff --git a/src/coreclr/vm/common.h b/src/coreclr/vm/common.h index 756ef7e0817fbb..54c17e3594bb3a 100644 --- a/src/coreclr/vm/common.h +++ b/src/coreclr/vm/common.h @@ -14,45 +14,10 @@ #define COMMON_TURNED_FPO_ON 1 #endif -#define USE_COM_CONTEXT_DEF - #if defined(_DEBUG) #define DEBUG_REGDISPLAY #endif -#ifdef _MSC_VER - - // These don't seem useful, so turning them off is no big deal -#pragma warning(disable:4201) // nameless struct/union -#pragma warning(disable:4512) // can't generate assignment constructor -#pragma warning(disable:4211) // nonstandard extension used (char name[0] in structs) -#pragma warning(disable:4268) // 'const' static/global data initialized with compiler generated default constructor fills the object with zeros -#pragma warning(disable:4238) // nonstandard extension used : class rvalue used as lvalue -#pragma warning(disable:4291) // no matching operator delete found -#pragma warning(disable:4345) // behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized - - // Depending on the code base, you may want to not disable these -#pragma warning(disable:4245) // assigning signed / unsigned -#pragma warning(disable:4127) // conditional expression is constant -#pragma warning(disable:4100) // unreferenced formal parameter - -#pragma warning(1:4189) // local variable initialized but not used - -#ifndef DEBUG -#pragma warning(disable:4505) // unreferenced local function has been removed -#pragma warning(disable:4313) // 'format specifier' in format string conflicts with argument %d of type 'type' -#endif // !DEBUG - - // CONSIDER put these back in -#pragma warning(disable:4063) // bad switch value for enum (only in Disasm.cpp) -#pragma warning(disable:4710) // function not inlined -#pragma warning(disable:4527) // user-defined destructor required -#pragma warning(disable:4513) // destructor could not be generated -#endif // _MSC_VER - -#define _CRT_DEPENDENCY_ //this code depends on the crt file functions - - #include #include #include diff --git a/src/coreclr/vm/gchelpers.cpp b/src/coreclr/vm/gchelpers.cpp index 7f9ab029d4c6f8..c961814b4966ac 100644 --- a/src/coreclr/vm/gchelpers.cpp +++ b/src/coreclr/vm/gchelpers.cpp @@ -1252,7 +1252,8 @@ OBJECTREF AllocateObject(MethodTable *pMT if (pMT == g_pBaseCOMObject) COMPlusThrow(kInvalidComObjectException, IDS_EE_NO_BACKING_CLASS_FACTORY); - oref = OBJECTREF_TO_UNCHECKED_OBJECTREF(AllocateComObject_ForManaged(pMT)); + OBJECTREF obj = AllocateComObject_ForManaged(pMT); + oref = OBJECTREF_TO_UNCHECKED_OBJECTREF(obj); } #endif // FEATURE_COMINTEROP_UNMANAGED_ACTIVATION #else // FEATURE_COMINTEROP diff --git a/src/coreclr/vm/olevariant.cpp b/src/coreclr/vm/olevariant.cpp index 90e847f3135c7b..c80e05d81bb6a7 100644 --- a/src/coreclr/vm/olevariant.cpp +++ b/src/coreclr/vm/olevariant.cpp @@ -2513,9 +2513,13 @@ BASEARRAYREF OleVariant::ExtractWrappedObjectsFromArray(BASEARRAYREF *pArray) for (; pSrc < pSrcEnd; pSrc++, pDest++) { if (*pSrc != NULL) - memcpyNoGCRefs(pDest, &(*pSrc)->GetWrappedObject(), sizeof(DECIMAL)); + { + *pDest = (*pSrc)->GetWrappedObject(); + } else - memset(pDest, 0, sizeof(DECIMAL)); + { + *pDest = DECIMAL{}; + } } } else if (hndWrapperType == TypeHandle(CoreLibBinder::GetClass(CLASS__BSTR_WRAPPER)))