C++ conformance. (building with /permissive-) (dotnet/coreclr#7855)
authorPhil Christensen <philc@microsoft.com>
Fri, 28 Oct 2016 09:09:35 +0000 (02:09 -0700)
committerJan Vorlicek <janvorli@microsoft.com>
Fri, 28 Oct 2016 09:09:35 +0000 (11:09 +0200)
These issues were found when building with the /permissive- flag in the
latest version of MSVC. No tests were added/modified because this does not
change any behavior.
There are a few types of language conformance issues fixed in this:

1) Strict string conversion (this is also covered by the /Zc:strictStrings
flag)

The 'const' is not implicitly dropped by string literals, which means the
following is not allowed:
char str = "const string literal"; //error: cannot convert a 'const char'
to a 'char*'
This fix to to make str 'const char*'. (This can have a domino effect
depending on where str is used)

2) Fully qualified inline declarations members inside class

struct A {
void A::f() { } // Error: illegal qualified name in member declaration,
remove redundant 'A::' to fix
};

3) MSVC by default will allows name lookup in a dependent base. This is
disabled by /permissive-

template <class T> struct B {
  void f();
};

template <class T> struct D
 : public B<T> //B is a dependent base because its type depends on the type of T in D<T>.
{
    //One possible fix is to uncomment the following line.  If this
    //were a type we should have 'using typename'...
    //using B<T>::f;

    void g() {
       f(); //Error: identifier not found, one possible fix is change it to 'this->f();'
    }
};

void h()
{
   D<int> d;
   d.g();
}

4) Warning 4800 has been removed in version 19.1 (1910) of the compiler.

For backwards compatability, surround the usage of 4800.
This is not related to C++ conformance.
 #if _MSC_VER <= 1900
 // 'BOOL' forcing value to bool 'true' or 'false'
 #pragma warning(disable: 4800)
 #endif

Commit migrated from https://github.com/dotnet/coreclr/commit/8877516062414f770f6c97272c4fad43296202f6

23 files changed:
src/coreclr/src/ToolBox/SOS/Strike/ExpressionNode.cpp
src/coreclr/src/ToolBox/SOS/Strike/ExpressionNode.h
src/coreclr/src/ToolBox/SOS/Strike/strike.cpp
src/coreclr/src/ToolBox/SOS/Strike/vm.cpp
src/coreclr/src/ToolBox/superpmi/superpmi-shared/compileresult.h
src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h
src/coreclr/src/classlibnative/nls/nlsinfo.cpp
src/coreclr/src/coreclr/hosts/coreconsole/coreconsole.cpp
src/coreclr/src/coreclr/hosts/corerun/corerun.cpp
src/coreclr/src/dlls/mscorpe/ceefilegenwriter.cpp
src/coreclr/src/inc/shash.inl
src/coreclr/src/ipcman/ipcshared.h
src/coreclr/src/jit/gentree.h
src/coreclr/src/md/winmd/inc/adapter.h
src/coreclr/src/utilcode/longfilepathwrappers.cpp
src/coreclr/src/utilcode/opinfo.cpp
src/coreclr/src/utilcode/stacktrace.cpp
src/coreclr/src/vm/codeman.cpp
src/coreclr/src/vm/gcenv.os.cpp
src/coreclr/src/vm/marshalnative.h
src/coreclr/src/vm/winrtredirector.h
src/coreclr/tests/src/Interop/PrimitiveMarshalling/Bool/BoolNative.cpp
src/coreclr/tests/src/Interop/StringMarshalling/UTF8/UTF8TestNative.cpp

index 6516823..920afba 100644 (file)
@@ -129,7 +129,7 @@ VOID ExpressionNode::DFSVisit(ExpressionNodeVisitorCallback pFunc, VOID* pUserDa
 
 
 // Creates a new expression with a given debuggee value and frame
-ExpressionNode::ExpressionNode(__in_z WCHAR* pExpression, ICorDebugValue* pValue, ICorDebugILFrame* pFrame)
+ExpressionNode::ExpressionNode(__in_z const WCHAR* pExpression, ICorDebugValue* pValue, ICorDebugILFrame* pFrame)
 {
     Init(pValue, NULL, pFrame);
     _snwprintf_s(pAbsoluteExpression, MAX_EXPRESSION, _TRUNCATE, L"%s", pExpression);
@@ -137,7 +137,7 @@ ExpressionNode::ExpressionNode(__in_z WCHAR* pExpression, ICorDebugValue* pValue
 }
 
 // Creates a new expression that has an error and no value
-ExpressionNode::ExpressionNode(__in_z WCHAR* pExpression, __in_z WCHAR* pErrorMessage)
+ExpressionNode::ExpressionNode(__in_z const WCHAR* pExpression, __in_z const WCHAR* pErrorMessage)
 {
     Init(NULL, NULL, NULL);
     _snwprintf_s(pAbsoluteExpression, MAX_EXPRESSION, _TRUNCATE, L"%s", pExpression);
@@ -146,7 +146,7 @@ ExpressionNode::ExpressionNode(__in_z WCHAR* pExpression, __in_z WCHAR* pErrorMe
 }
 
 // Creates a new child expression
-ExpressionNode::ExpressionNode(__in_z WCHAR* pParentExpression, ChildKind ck, __in_z WCHAR* pRelativeExpression, ICorDebugValue* pValue, ICorDebugType* pType, ICorDebugILFrame* pFrame, UVCP_CONSTANT pDefaultValue, ULONG cchDefaultValue)
+ExpressionNode::ExpressionNode(__in_z const WCHAR* pParentExpression, ChildKind ck, __in_z const WCHAR* pRelativeExpression, ICorDebugValue* pValue, ICorDebugType* pType, ICorDebugILFrame* pFrame, UVCP_CONSTANT pDefaultValue, ULONG cchDefaultValue)
 {
     Init(pValue, pType, pFrame);
     if(ck == ChildKind_BaseClass)
@@ -1979,7 +1979,7 @@ HRESULT ExpressionNode::GetCanonicalElementTypeForTypeName(__in_z WCHAR* pTypeNa
 
 // Searches the debuggee for any ICorDebugType that matches the given fully qualified name
 // This will search across all AppDomains and Assemblies
-HRESULT ExpressionNode::FindTypeByName(__in_z  WCHAR* pTypeName, ICorDebugType** ppType)
+HRESULT ExpressionNode::FindTypeByName(__in_z const WCHAR* pTypeName, ICorDebugType** ppType)
 {
     HRESULT Status = S_OK;
     ToRelease<ICorDebugAppDomainEnum> pAppDomainEnum;
@@ -2001,7 +2001,7 @@ HRESULT ExpressionNode::FindTypeByName(__in_z  WCHAR* pTypeName, ICorDebugType**
 
 // Searches the debuggee for any ICorDebugType that matches the given fully qualified name
 // This will search across all Assemblies in the given AppDomain
-HRESULT ExpressionNode::FindTypeByName(ICorDebugAppDomain* pAppDomain, __in_z WCHAR* pTypeName, ICorDebugType** ppType)
+HRESULT ExpressionNode::FindTypeByName(ICorDebugAppDomain* pAppDomain, __in_z const WCHAR* pTypeName, ICorDebugType** ppType)
 {
     HRESULT Status = S_OK;
     ToRelease<ICorDebugAssemblyEnum> pAssemblyEnum;
@@ -2022,7 +2022,7 @@ HRESULT ExpressionNode::FindTypeByName(ICorDebugAppDomain* pAppDomain, __in_z WC
 }
 
 // Searches the assembly for any ICorDebugType that matches the given fully qualified name
-HRESULT ExpressionNode::FindTypeByName(ICorDebugAssembly* pAssembly, __in_z WCHAR* pTypeName, ICorDebugType** ppType)
+HRESULT ExpressionNode::FindTypeByName(ICorDebugAssembly* pAssembly, __in_z const WCHAR* pTypeName, ICorDebugType** ppType)
 {
     HRESULT Status = S_OK;
     ToRelease<ICorDebugModuleEnum> pModuleEnum;
@@ -2043,7 +2043,7 @@ HRESULT ExpressionNode::FindTypeByName(ICorDebugAssembly* pAssembly, __in_z WCHA
 }
 
 // Searches a given module for any ICorDebugType that matches the given fully qualified type name
-HRESULT ExpressionNode::FindTypeByName(ICorDebugModule* pModule, __in_z WCHAR* pTypeName, ICorDebugType** ppType)
+HRESULT ExpressionNode::FindTypeByName(ICorDebugModule* pModule, __in_z const WCHAR* pTypeName, ICorDebugType** ppType)
 {
     HRESULT Status = S_OK;
     ToRelease<IUnknown> pMDUnknown;
@@ -2054,7 +2054,7 @@ HRESULT ExpressionNode::FindTypeByName(ICorDebugModule* pModule, __in_z WCHAR* p
     // If the name contains a generic argument list, extract the type name from
     // before the list
     WCHAR rootName[mdNameLen];
-    WCHAR* pRootName = NULL;
+    const WCHAR* pRootName = NULL;
     int typeNameLen = (int) _wcslen(pTypeName);
     int genericParamListStart = (int) _wcscspn(pTypeName, L"<");
     if(genericParamListStart != typeNameLen)
@@ -2107,11 +2107,11 @@ HRESULT ExpressionNode::FindTypeByName(ICorDebugModule* pModule, __in_z WCHAR* p
         }
         typeParams = new ToRelease<ICorDebugType>[countTypeParams];
 
-        WCHAR* pCurName = pTypeName + genericParamListStart+1;
+        const WCHAR* pCurName = pTypeName + genericParamListStart+1;
         for(int i = 0; i < countTypeParams; i++)
         {
             WCHAR typeParamName[mdNameLen];
-            WCHAR* pNextComma = _wcschr(pCurName, L',');
+            const WCHAR* pNextComma = _wcschr(pCurName, L',');
             int len = (pNextComma != NULL) ? (int)(pNextComma - pCurName) : (int)_wcslen(pCurName)-1;
             if(len > mdNameLen)
                 return E_FAIL;
index 507a8a5..48cc036 100644 (file)
@@ -134,13 +134,13 @@ private:
     };
 
     // Creates a new expression with a given debuggee value and frame
-    ExpressionNode(__in_z WCHAR* pExpression, ICorDebugValue* pValue, ICorDebugILFrame* pFrame);
+    ExpressionNode(__in_z const WCHAR* pExpression, ICorDebugValue* pValue, ICorDebugILFrame* pFrame);
 
     // Creates a new expression that has an error and no value
-    ExpressionNode(__in_z WCHAR* pExpression, __in_z WCHAR* pErrorMessage);
+    ExpressionNode(__in_z const WCHAR* pExpression, __in_z const WCHAR* pErrorMessage);
 
     // Creates a new child expression
-    ExpressionNode(__in_z WCHAR* pParentExpression, ChildKind ck, __in_z WCHAR* pRelativeExpression, ICorDebugValue* pValue, ICorDebugType* pType, ICorDebugILFrame* pFrame, UVCP_CONSTANT pDefaultValue = NULL, ULONG cchDefaultValue = 0);
+    ExpressionNode(__in_z const WCHAR* pParentExpression, ChildKind ck, __in_z const WCHAR* pRelativeExpression, ICorDebugValue* pValue, ICorDebugType* pType, ICorDebugILFrame* pFrame, UVCP_CONSTANT pDefaultValue = NULL, ULONG cchDefaultValue = 0);
 
     // Common member initialization for the constructors
     VOID Init(ICorDebugValue* pValue, ICorDebugType* pTypeCast, ICorDebugILFrame* pFrame);
@@ -288,17 +288,17 @@ private:
 
     // Searches the debuggee for any ICorDebugType that matches the given fully qualified name
     // This will search across all AppDomains and Assemblies
-    static HRESULT FindTypeByName(__in_z WCHAR* pTypeName, ICorDebugType** ppType);
+    static HRESULT FindTypeByName(__in_z const WCHAR* pTypeName, ICorDebugType** ppType);
 
     // Searches the debuggee for any ICorDebugType that matches the given fully qualified name
     // This will search across all Assemblies in the given AppDomain
-    static HRESULT FindTypeByName(ICorDebugAppDomain* pAppDomain, __in_z WCHAR* pTypeName, ICorDebugType** ppType);
+    static HRESULT FindTypeByName(ICorDebugAppDomain* pAppDomain, __in_z const WCHAR* pTypeName, ICorDebugType** ppType);
 
     // Searches the assembly for any ICorDebugType that matches the given fully qualified name
-    static HRESULT FindTypeByName(ICorDebugAssembly* pAssembly, __in_z WCHAR* pTypeName, ICorDebugType** ppType);
+    static HRESULT FindTypeByName(ICorDebugAssembly* pAssembly, __in_z const WCHAR* pTypeName, ICorDebugType** ppType);
 
     // Searches a given module for any ICorDebugType that matches the given fully qualified type name
-    static HRESULT FindTypeByName(ICorDebugModule* pModule, __in_z WCHAR* pTypeName, ICorDebugType** ppType);
+    static HRESULT FindTypeByName(ICorDebugModule* pModule, __in_z const WCHAR* pTypeName, ICorDebugType** ppType);
 
     // Checks whether the given token is or refers to type System.ValueType or System.Enum
     static HRESULT IsTokenValueTypeOrEnum(mdToken token, IMetaDataImport* pMetadata, BOOL* pResult);
index 731e2f5..e03e518 100644 (file)
@@ -9119,7 +9119,7 @@ DECLARE_API (ProcInfo)
         if (pFntGetProcessTimes && pFntGetProcessTimes (hProcess,&CreationTime,&ExitTime,&KernelTime,&UserTime)) {
             ExtOut("---------------------------------------\n");
             ExtOut("Process Times\n");
-            static char *Month[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep",
+            static const char *Month[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep",
                         "Oct", "Nov", "Dec"};
             SYSTEMTIME SystemTime;
             FILETIME LocalFileTime;
index e7e5701..70e9210 100644 (file)
@@ -82,7 +82,7 @@ typedef struct _VM_STATS
 typedef struct PROTECT_MASK
 {
     DWORD Bit;
-    PSTR Name;
+    PCSTR Name;
 
 } PROTECT_MASK, *PPROTECT_MASK;
 
@@ -324,7 +324,7 @@ PrintVmStatsHeader(
 
 VOID
 PrintIndividualStat(
-    ___in __in_z IN PSTR Name,
+    ___in __in_z IN PCSTR Name,
     IN PINDIVIDUAL_STAT Stat
     )
 {
@@ -379,7 +379,7 @@ PrintIndividualStat(
 
 VOID
 PrintVmStats(
-    ___in __in_z IN PSTR Name,
+    ___in __in_z IN PCSTR Name,
     IN PVM_STATS Stats
     )
 {
@@ -443,7 +443,7 @@ VmStateToString(
     size_t capacity_Buffer
     )
 {
-    PSTR result;
+    PCSTR result;
     CHAR invalidStr[sizeof("12345678")];
 
     switch( State )
@@ -478,7 +478,7 @@ VmTypeToString(
     size_t capacity_Buffer
     )
 {
-    PSTR result;
+    PCSTR result;
     CHAR invalidStr[sizeof("12345678")];
 
     switch( Type )
index 8fc3f7a..87853f4 100644 (file)
@@ -203,7 +203,7 @@ public:
 
     void recReportInliningDecision(CORINFO_METHOD_HANDLE inlinerHnd, CORINFO_METHOD_HANDLE inlineeHnd, CorInfoInline inlineResult, const char * reason);
     void dmpReportInliningDecision(DWORD key, const Agnostic_ReportInliningDecision& value);
-    CorInfoInline CompileResult::repReportInliningDecision(CORINFO_METHOD_HANDLE inlinerHnd, CORINFO_METHOD_HANDLE inlineeHnd);
+    CorInfoInline repReportInliningDecision(CORINFO_METHOD_HANDLE inlinerHnd, CORINFO_METHOD_HANDLE inlineeHnd);
 
     void recSetEHcount(unsigned cEH);
     void dmpSetEHcount(DWORD key, DWORD value);
index 5869c85..5885e2b 100644 (file)
@@ -513,9 +513,9 @@ public:
     void dmpGetMethodName(DLD key, DD value);
     const char *repGetMethodName(CORINFO_METHOD_HANDLE ftn, const char **moduleName);
 
-    void MethodContext::recGetJitFlags(CORJIT_FLAGS *jitFlags, DWORD sizeInBytes, DWORD result);
-    void MethodContext::dmpGetJitFlags(DWORD key, DD value);
-    DWORD MethodContext::repGetJitFlags(CORJIT_FLAGS *jitFlags, DWORD sizeInBytes);
+    void recGetJitFlags(CORJIT_FLAGS *jitFlags, DWORD sizeInBytes, DWORD result);
+    void dmpGetJitFlags(DWORD key, DD value);
+    DWORD repGetJitFlags(CORJIT_FLAGS *jitFlags, DWORD sizeInBytes);
 
     void recGetJitTimeLogFilename(LPCWSTR tempFileName);
     void dmpGetJitTimeLogFilename(DWORD key, DWORD value);
index 864f998..cd54833 100644 (file)
@@ -1057,7 +1057,7 @@ FCIMPLEND
 #define CULTURETYPES_FRAMEWORKCULTURES            0x0040
 
 
-const LPWSTR WHIDBEY_FRAMEWORK_CULTURE_LIST [] =
+const LPCWSTR WHIDBEY_FRAMEWORK_CULTURE_LIST [] =
 {
     W(""),
     W("af"),
index 2af9115..7abc02a 100644 (file)
@@ -185,7 +185,7 @@ public:
         }
     }
 
-    bool TPAListContainsFile(_In_z_ wchar_t* fileNameWithoutExtension, _In_reads_(countExtensions) wchar_t** rgTPAExtensions, int countExtensions)
+    bool TPAListContainsFile(_In_z_ wchar_t* fileNameWithoutExtension, _In_reads_(countExtensions) const wchar_t** rgTPAExtensions, int countExtensions)
     {
         if (!m_tpaList.CStr()) return false;
 
@@ -225,7 +225,7 @@ public:
         }
     }
 
-    void AddFilesFromDirectoryToTPAList(_In_z_ wchar_t* targetPath, _In_reads_(countExtensions) wchar_t** rgTPAExtensions, int countExtensions)
+    void AddFilesFromDirectoryToTPAList(_In_z_ wchar_t* targetPath, _In_reads_(countExtensions) const wchar_t** rgTPAExtensions, int countExtensions)
     {
         *m_log << W("Adding assemblies from ") << targetPath << W(" to the TPA list") << Logger::endl;
         wchar_t assemblyPath[MAX_LONGPATH];
@@ -288,7 +288,7 @@ public:
     // On first call, scans the coreclr directory for dlls and adds them all to the list.
     const wchar_t * GetTpaList() {
         if (!m_tpaList.CStr()) {
-            wchar_t *rgTPAExtensions[] = {
+            const wchar_t *rgTPAExtensions[] = {
                         W("*.ni.dll"),         // Probe for .ni.dll first so that it's preferred if ni and il coexist in the same dir
                         W("*.dll"),
                         W("*.ni.exe"),
index 0df2806..dfbb79c 100644 (file)
@@ -161,7 +161,7 @@ public:
         }
     }
 
-    bool TPAListContainsFile(_In_z_ wchar_t* fileNameWithoutExtension, _In_reads_(countExtensions) wchar_t** rgTPAExtensions, int countExtensions)
+    bool TPAListContainsFile(_In_z_ wchar_t* fileNameWithoutExtension, _In_reads_(countExtensions) const wchar_t** rgTPAExtensions, int countExtensions)
     {
         if (m_tpaList.IsEmpty()) return false;
 
@@ -201,7 +201,7 @@ public:
         }
     }
 
-    void AddFilesFromDirectoryToTPAList(_In_z_ const wchar_t* targetPath, _In_reads_(countExtensions) wchar_t** rgTPAExtensions, int countExtensions)
+    void AddFilesFromDirectoryToTPAList(_In_z_ const wchar_t* targetPath, _In_reads_(countExtensions) const wchar_t** rgTPAExtensions, int countExtensions)
     {
         *m_log << W("Adding assemblies from ") << targetPath << W(" to the TPA list") << Logger::endl;
         StackSString assemblyPath;
@@ -259,7 +259,7 @@ public:
     // On first call, scans the coreclr directory for dlls and adds them all to the list.
     const wchar_t * GetTpaList() {
         if (m_tpaList.IsEmpty()) {
-            wchar_t *rgTPAExtensions[] = {
+            const wchar_t *rgTPAExtensions[] = {
                         W("*.ni.dll"),         // Probe for .ni.dll first so that it's preferred if ni and il coexist in the same dir
                         W("*.dll"),
                         W("*.ni.exe"),
index cfd1ebb..da853c3 100644 (file)
@@ -973,7 +973,7 @@ BOOL RunProcess(LPCWSTR tempResObj, LPCWSTR pszFilename, DWORD* pdwExitCode, PEW
     if (FAILED(GetClrSystemDirectory(wszSystemDir)))
         return FALSE;
 
-    WCHAR* wzMachine;
+    const WCHAR* wzMachine;
     if(pewriter.isIA64())
         wzMachine = L"IA64";
     else if(pewriter.isAMD64())
index 72affb4..f48899a 100644 (file)
@@ -22,8 +22,8 @@ SHash<TRAITS>::SHash()
     LIMITED_METHOD_CONTRACT;
 
 #ifndef __GNUC__ // these crash GCC
-    static_assert_no_msg(s_growth_factor_numerator > s_growth_factor_denominator);
-    static_assert_no_msg(s_density_factor_numerator < s_density_factor_denominator);
+    static_assert_no_msg(SHash<TRAITS>::s_growth_factor_numerator > SHash<TRAITS>::s_growth_factor_denominator);
+    static_assert_no_msg(SHash<TRAITS>::s_density_factor_numerator < SHash<TRAITS>::s_density_factor_denominator);
 #endif
 }
 
index d40b0ba..865509d 100644 (file)
@@ -75,8 +75,8 @@ public:
                                           HANDLE & pPrivateNamespace, 
                                           PSID* pSID, 
                                           BOOL bCreate);
-    static HRESULT IPCShared::FreeHandles(HANDLE & hDescriptor, PSID & pSID);
-    static HRESULT IPCShared::FreeHandles(HANDLE & hBoundaryDescriptor, PSID & pSID, HANDLE & hPrivateNamespace);
+    static HRESULT FreeHandles(HANDLE & hDescriptor, PSID & pSID);
+    static HRESULT FreeHandles(HANDLE & hBoundaryDescriptor, PSID & pSID, HANDLE & hPrivateNamespace);
     static HRESULT CreateWinNTDescriptor(DWORD pid, BOOL bRestrictiveACL, SECURITY_ATTRIBUTES **ppSA, KernelObject whatObject);
     static HRESULT CreateWinNTDescriptor(DWORD pid, BOOL bRestrictiveACL, SECURITY_ATTRIBUTES **ppSA, KernelObject whatObject, EDescriptorType descType);
     static void DestroySecurityAttributes(SECURITY_ATTRIBUTES *pSA);
index db065c3..64a6d00 100644 (file)
@@ -1902,10 +1902,10 @@ public:
     // Returns an iterator that will produce the use edge to each operand of this node. Differs
     // from the sequence of nodes produced by a loop over `GetChild` in its handling of call, phi,
     // and block op nodes.
-    GenTreeUseEdgeIterator GenTree::UseEdgesBegin();
-    GenTreeUseEdgeIterator GenTree::UseEdgesEnd();
+    GenTreeUseEdgeIterator UseEdgesBegin();
+    GenTreeUseEdgeIterator UseEdgesEnd();
 
-    IteratorPair<GenTreeUseEdgeIterator> GenTree::UseEdges();
+    IteratorPair<GenTreeUseEdgeIterator> UseEdges();
 
     // Returns an iterator that will produce each operand of this node. Differs from the sequence
     // of nodes produced by a loop over `GetChild` in its handling of call, phi, and block op
@@ -2207,7 +2207,7 @@ struct GenTreeIntConCommon : public GenTree
     }
 
     bool ImmedValNeedsReloc(Compiler* comp);
-    bool GenTreeIntConCommon::ImmedValCanBeFolded(Compiler* comp, genTreeOps op);
+    bool ImmedValCanBeFolded(Compiler* comp, genTreeOps op);
 
 #ifdef _TARGET_XARCH_
     bool FitsInAddrBase(Compiler* comp);
index e69b620..e42992f 100644 (file)
@@ -136,7 +136,7 @@ public:
     static BOOL ConvertWellKnownTypeNameFromClrToWinRT(LPCSTR *pszFullName);
 
     // Map a well-known CLR typename to WinRT typename
-    static BOOL WinMDAdapter::ConvertWellKnownTypeNameFromClrToWinRT(LPCSTR *pszNamespace, LPCSTR *pszName);
+    static BOOL ConvertWellKnownTypeNameFromClrToWinRT(LPCSTR *pszNamespace, LPCSTR *pszName);
         
     // Returns names of redirected type 'index'.
     static void GetRedirectedTypeInfo(
index 9ffbf27..5272d35 100644 (file)
@@ -19,8 +19,8 @@ private:
         static const WCHAR VolumeSeparatorChar;
                #define UNCPATHPREFIX W("\\\\")
 #endif //FEATURE_PAL
-        static const WCHAR LongFile::DirectorySeparatorChar;
-        static const WCHAR LongFile::AltDirectorySeparatorChar;
+        static const WCHAR DirectorySeparatorChar;
+        static const WCHAR AltDirectorySeparatorChar;
 public:
         static BOOL IsExtended(SString & path);
         static BOOL IsUNCExtended(SString & path);
index 9d5ff20..60da660 100644 (file)
 
 OpInfo::OpInfoData OpInfo::table[] = {
 
-#ifdef _MSC_VER
-#define OPDEF(c,s,pop,push,args,type,l,s1,s2,ctrl) \
-    { s, args + type, FLOW_ ## ctrl, pop, push, c },
-#else
 #define OPDEF(c,s,pop,push,args,type,l,s1,s2,ctrl) \
     { s, (OPCODE_FORMAT) (args + type), FLOW_ ## ctrl, pop, push, c },
-#endif
 
     // Kind of a workaround, get the prefixes (IInternal) to return InlineOpcode instead of InlineNone
 #define IInternal   (InlineOpcode - InlineNone)
index 7bfdb45..858fac7 100644 (file)
@@ -208,7 +208,7 @@ typedef DWORD (_stdcall *pfnImgHlp_SymGetOptions)(
 
 struct IMGHLPFN_LOAD
 {
-    LPSTR   pszFnName;
+    LPCSTR   pszFnName;
     LPVOID * ppvfn;
 };
 
@@ -520,7 +520,7 @@ DWORD_PTR dwAddr
     }
 
     CHAR rgchUndec[256];
-    CHAR * pszSymbol = NULL;
+    const CHAR * pszSymbol = NULL;
 
     // Name field of IMAGEHLP_SYMBOL is dynamically sized.
     // Pad with space for 255 characters.
index 9d7d8d0..585de67 100644 (file)
@@ -1720,7 +1720,7 @@ BOOL EEJitManager::LoadJIT()
         {
             // Now, load the compat jit and initialize it.
 
-            LPWSTR pwzJitName = MAKEDLLNAME_W(L"compatjit");
+            LPCWSTR pwzJitName = MAKEDLLNAME_W(L"compatjit");
 
             // Note: if the compatjit fails to load, we ignore it, and continue to use the main JIT for
             // everything. You can imagine a policy where if the user requests the compatjit, and we fail
index 73b21a7..30b72cb 100644 (file)
@@ -367,7 +367,7 @@ typedef BOOL (WINAPI *PQUERY_INFORMATION_JOB_OBJECT)(HANDLE jobHandle, JOBOBJECT
 #ifdef FEATURE_CORECLR
 // For coresys we need to look for an API in some apiset dll on win8 if we can't find it  
 // in the traditional dll.
-HINSTANCE LoadDllForAPI(WCHAR* dllTraditional, WCHAR* dllApiSet)
+HINSTANCE LoadDllForAPI(const WCHAR* dllTraditional, const WCHAR* dllApiSet)
 {
     HINSTANCE hinst = WszLoadLibrary(dllTraditional);
 
index 4f6ac85..cff3f7e 100644 (file)
@@ -229,7 +229,7 @@ public:
     static FCDECL2(void, ChangeWrapperHandleStrength, Object* orefUNSAFE, CLR_BOOL fIsWeak);
     static FCDECL2(void, InitializeWrapperForWinRT, Object *unsafe_pThis, IUnknown **ppUnk);
     static FCDECL2(void, InitializeManagedWinRTFactoryObject, Object *unsafe_pThis, ReflectClassBaseObject *unsafe_pType);
-    static FCDECL1(Object *, MarshalNative::GetNativeActivationFactory, ReflectClassBaseObject *unsafe_pType);
+    static FCDECL1(Object *, GetNativeActivationFactory, ReflectClassBaseObject *unsafe_pType);
     static void QCALLTYPE GetInspectableIIDs(QCall::ObjectHandleOnStack hobj, QCall::ObjectHandleOnStack retArrayGuids);
     static void QCALLTYPE GetCachedWinRTTypes(QCall::ObjectHandleOnStack hadObj, int * epoch, QCall::ObjectHandleOnStack retArrayMT);
     static void QCALLTYPE GetCachedWinRTTypeByIID(QCall::ObjectHandleOnStack hadObj, GUID iid, void * * ppMT);
index 2561252..f725ca8 100644 (file)
@@ -137,7 +137,7 @@ class WinRTDelegateRedirector
 public:
     static MethodTable *GetWinRTTypeForRedirectedDelegateIndex(WinMDAdapter::RedirectedTypeIndex index);
 
-    static bool WinRTDelegateRedirector::ResolveRedirectedDelegate(MethodTable *pMT, WinMDAdapter::RedirectedTypeIndex *pIndex);
+    static bool ResolveRedirectedDelegate(MethodTable *pMT, WinMDAdapter::RedirectedTypeIndex *pIndex);
 };
 
 #endif // WINRT_DELEGATE_REDIRECTOR_H
index ba8c10b..79ab5c9 100644 (file)
@@ -116,8 +116,10 @@ extern "C" DLL_EXPORT BOOL __stdcall MarshalPointer_Out(/*[out]*/ BOOL *pboolVal
 }
 
 #pragma warning(push)
+#if _MSC_VER <= 1900
 // 'BOOL' forcing value to bool 'true' or 'false'
 #pragma warning(disable: 4800)
+#endif
 
 extern "C" DLL_EXPORT bool __stdcall Marshal_As_In(/*[in]*/bool boolValue)
 {
index f4e0f2f..7007651 100644 (file)
@@ -6,7 +6,7 @@
 
 const int NSTRINGS = 6;
 #ifdef _WIN32
-wchar_t  *utf8strings[] = { L"Managed",
+const wchar_t  *utf8strings[] = { L"Managed",
 L"S\x00EEne kl\x00E2wen durh die wolken sint geslagen" ,
 L"\x0915\x093E\x091A\x0902 \x0936\x0915\x094D\x0928\x094B\x092E\x094D\x092F\x0924\x094D\x0924\x0941\x092E\x094D \x0964 \x0928\x094B\x092A\x0939\x093F\x0928\x0938\x094D\x0924\x093F \x092E\x093E\x092E\x094D",
 L"\x6211\x80FD\x541E\x4E0B\x73BB\x7483\x800C\x4E0D\x4F24\x8EAB\x4F53",
@@ -17,7 +17,7 @@ L"\0"
 
 
 
-char* utf16_to_utf8(wchar_t *srcstring)
+char* utf16_to_utf8(const wchar_t *srcstring)
 {
     if ((srcstring == NULL) || (*srcstring == L'\0')) {
         return 0;