summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Christensen <philc@microsoft.com>2016-10-28 02:09:35 -0700
committerJan Vorlicek <janvorli@microsoft.com>2016-10-28 11:09:35 +0200
commit8877516062414f770f6c97272c4fad43296202f6 (patch)
tree4347c3c8b6d8fd191dc71b8826f18798d4cbaee2
parentc4d899414fc9af1a22b9b38748d53b3e6e5eeb2b (diff)
downloadcoreclr-8877516062414f770f6c97272c4fad43296202f6.tar.gz
coreclr-8877516062414f770f6c97272c4fad43296202f6.tar.bz2
coreclr-8877516062414f770f6c97272c4fad43296202f6.zip
C++ conformance. (building with /permissive-) (#7855)
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
-rw-r--r--src/ToolBox/SOS/Strike/ExpressionNode.cpp20
-rw-r--r--src/ToolBox/SOS/Strike/ExpressionNode.h14
-rw-r--r--src/ToolBox/SOS/Strike/strike.cpp2
-rw-r--r--src/ToolBox/SOS/Strike/vm.cpp10
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/compileresult.h2
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/methodcontext.h6
-rw-r--r--src/classlibnative/nls/nlsinfo.cpp2
-rw-r--r--src/coreclr/hosts/coreconsole/coreconsole.cpp6
-rw-r--r--src/coreclr/hosts/corerun/corerun.cpp6
-rw-r--r--src/dlls/mscorpe/ceefilegenwriter.cpp2
-rw-r--r--src/inc/shash.inl4
-rw-r--r--src/ipcman/ipcshared.h4
-rw-r--r--src/jit/gentree.h8
-rw-r--r--src/md/winmd/inc/adapter.h2
-rw-r--r--src/utilcode/longfilepathwrappers.cpp4
-rw-r--r--src/utilcode/opinfo.cpp5
-rw-r--r--src/utilcode/stacktrace.cpp4
-rw-r--r--src/vm/codeman.cpp2
-rw-r--r--src/vm/gcenv.os.cpp2
-rw-r--r--src/vm/marshalnative.h2
-rw-r--r--src/vm/winrtredirector.h2
-rw-r--r--tests/src/Interop/PrimitiveMarshalling/Bool/BoolNative.cpp2
-rw-r--r--tests/src/Interop/StringMarshalling/UTF8/UTF8TestNative.cpp4
23 files changed, 56 insertions, 59 deletions
diff --git a/src/ToolBox/SOS/Strike/ExpressionNode.cpp b/src/ToolBox/SOS/Strike/ExpressionNode.cpp
index 6516823aaa..920afbaedc 100644
--- a/src/ToolBox/SOS/Strike/ExpressionNode.cpp
+++ b/src/ToolBox/SOS/Strike/ExpressionNode.cpp
@@ -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;
diff --git a/src/ToolBox/SOS/Strike/ExpressionNode.h b/src/ToolBox/SOS/Strike/ExpressionNode.h
index 507a8a53d3..48cc036729 100644
--- a/src/ToolBox/SOS/Strike/ExpressionNode.h
+++ b/src/ToolBox/SOS/Strike/ExpressionNode.h
@@ -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);
diff --git a/src/ToolBox/SOS/Strike/strike.cpp b/src/ToolBox/SOS/Strike/strike.cpp
index 731e2f505d..e03e5187a0 100644
--- a/src/ToolBox/SOS/Strike/strike.cpp
+++ b/src/ToolBox/SOS/Strike/strike.cpp
@@ -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;
diff --git a/src/ToolBox/SOS/Strike/vm.cpp b/src/ToolBox/SOS/Strike/vm.cpp
index e7e5701fc6..70e9210dbd 100644
--- a/src/ToolBox/SOS/Strike/vm.cpp
+++ b/src/ToolBox/SOS/Strike/vm.cpp
@@ -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 )
diff --git a/src/ToolBox/superpmi/superpmi-shared/compileresult.h b/src/ToolBox/superpmi/superpmi-shared/compileresult.h
index 8fc3f7a352..87853f4cd3 100644
--- a/src/ToolBox/superpmi/superpmi-shared/compileresult.h
+++ b/src/ToolBox/superpmi/superpmi-shared/compileresult.h
@@ -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);
diff --git a/src/ToolBox/superpmi/superpmi-shared/methodcontext.h b/src/ToolBox/superpmi/superpmi-shared/methodcontext.h
index 5869c85b45..5885e2b7ca 100644
--- a/src/ToolBox/superpmi/superpmi-shared/methodcontext.h
+++ b/src/ToolBox/superpmi/superpmi-shared/methodcontext.h
@@ -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);
diff --git a/src/classlibnative/nls/nlsinfo.cpp b/src/classlibnative/nls/nlsinfo.cpp
index 864f998d1f..cd5483387d 100644
--- a/src/classlibnative/nls/nlsinfo.cpp
+++ b/src/classlibnative/nls/nlsinfo.cpp
@@ -1057,7 +1057,7 @@ FCIMPLEND
#define CULTURETYPES_FRAMEWORKCULTURES 0x0040
-const LPWSTR WHIDBEY_FRAMEWORK_CULTURE_LIST [] =
+const LPCWSTR WHIDBEY_FRAMEWORK_CULTURE_LIST [] =
{
W(""),
W("af"),
diff --git a/src/coreclr/hosts/coreconsole/coreconsole.cpp b/src/coreclr/hosts/coreconsole/coreconsole.cpp
index 2af911519a..7abc02ab7e 100644
--- a/src/coreclr/hosts/coreconsole/coreconsole.cpp
+++ b/src/coreclr/hosts/coreconsole/coreconsole.cpp
@@ -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"),
diff --git a/src/coreclr/hosts/corerun/corerun.cpp b/src/coreclr/hosts/corerun/corerun.cpp
index 0df2806f7c..dfbb79c0d2 100644
--- a/src/coreclr/hosts/corerun/corerun.cpp
+++ b/src/coreclr/hosts/corerun/corerun.cpp
@@ -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"),
diff --git a/src/dlls/mscorpe/ceefilegenwriter.cpp b/src/dlls/mscorpe/ceefilegenwriter.cpp
index cfd1ebb644..da853c3b45 100644
--- a/src/dlls/mscorpe/ceefilegenwriter.cpp
+++ b/src/dlls/mscorpe/ceefilegenwriter.cpp
@@ -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())
diff --git a/src/inc/shash.inl b/src/inc/shash.inl
index 72affb45ba..f48899a588 100644
--- a/src/inc/shash.inl
+++ b/src/inc/shash.inl
@@ -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
}
diff --git a/src/ipcman/ipcshared.h b/src/ipcman/ipcshared.h
index d40b0ba53e..865509dfc3 100644
--- a/src/ipcman/ipcshared.h
+++ b/src/ipcman/ipcshared.h
@@ -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);
diff --git a/src/jit/gentree.h b/src/jit/gentree.h
index db065c3de2..64a6d00656 100644
--- a/src/jit/gentree.h
+++ b/src/jit/gentree.h
@@ -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);
diff --git a/src/md/winmd/inc/adapter.h b/src/md/winmd/inc/adapter.h
index e69b620938..e42992f81f 100644
--- a/src/md/winmd/inc/adapter.h
+++ b/src/md/winmd/inc/adapter.h
@@ -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(
diff --git a/src/utilcode/longfilepathwrappers.cpp b/src/utilcode/longfilepathwrappers.cpp
index 9ffbf27cc8..5272d35807 100644
--- a/src/utilcode/longfilepathwrappers.cpp
+++ b/src/utilcode/longfilepathwrappers.cpp
@@ -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);
diff --git a/src/utilcode/opinfo.cpp b/src/utilcode/opinfo.cpp
index 9d5ff202ff..60da66047a 100644
--- a/src/utilcode/opinfo.cpp
+++ b/src/utilcode/opinfo.cpp
@@ -14,13 +14,8 @@
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)
diff --git a/src/utilcode/stacktrace.cpp b/src/utilcode/stacktrace.cpp
index 7bfdb4514a..858fac723e 100644
--- a/src/utilcode/stacktrace.cpp
+++ b/src/utilcode/stacktrace.cpp
@@ -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.
diff --git a/src/vm/codeman.cpp b/src/vm/codeman.cpp
index 9d7d8d0e1b..585de67f44 100644
--- a/src/vm/codeman.cpp
+++ b/src/vm/codeman.cpp
@@ -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
diff --git a/src/vm/gcenv.os.cpp b/src/vm/gcenv.os.cpp
index 73b21a7a0b..30b72cbba1 100644
--- a/src/vm/gcenv.os.cpp
+++ b/src/vm/gcenv.os.cpp
@@ -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);
diff --git a/src/vm/marshalnative.h b/src/vm/marshalnative.h
index 4f6ac854ff..cff3f7eb63 100644
--- a/src/vm/marshalnative.h
+++ b/src/vm/marshalnative.h
@@ -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);
diff --git a/src/vm/winrtredirector.h b/src/vm/winrtredirector.h
index 2561252ba9..f725ca8eb3 100644
--- a/src/vm/winrtredirector.h
+++ b/src/vm/winrtredirector.h
@@ -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
diff --git a/tests/src/Interop/PrimitiveMarshalling/Bool/BoolNative.cpp b/tests/src/Interop/PrimitiveMarshalling/Bool/BoolNative.cpp
index ba8c10bd77..79ab5c9a8f 100644
--- a/tests/src/Interop/PrimitiveMarshalling/Bool/BoolNative.cpp
+++ b/tests/src/Interop/PrimitiveMarshalling/Bool/BoolNative.cpp
@@ -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)
{
diff --git a/tests/src/Interop/StringMarshalling/UTF8/UTF8TestNative.cpp b/tests/src/Interop/StringMarshalling/UTF8/UTF8TestNative.cpp
index f4e0f2f950..700765143c 100644
--- a/tests/src/Interop/StringMarshalling/UTF8/UTF8TestNative.cpp
+++ b/tests/src/Interop/StringMarshalling/UTF8/UTF8TestNative.cpp
@@ -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;