}
}
- void DoChecks(UINT testmask, __in_z const char *szFunction, __in_z char *szFile, int lineNum);
+ void DoChecks(UINT testmask, __in_z const char *szFunction, __in_z const char *szFile, int lineNum);
void Disable()
{
}
Contract::Returner<_returntype> ___returner(RETVAL); \
Contract::RanPostconditions ___ran(__FUNCTION__); \
Contract::Operation ___op = Contract::Setup; \
+ BOOL ___contract_enabled = FALSE; \
DEBUG_ASSURE_NO_RETURN_BEGIN(CONTRACT) \
- BOOL ___contract_enabled = Contract::EnforceContract(); \
+ ___contract_enabled = Contract::EnforceContract(); \
enum {___disabled = 0}; \
if (!___contract_enabled) \
___contract.Disable(); \
DEBUG_NOINLINE ~AutoCleanupContractViolationHolder()
{
SCAN_SCOPE_END;
- LeaveInternal();
+ this->LeaveInternal();
};
};
#endif
-inline void BaseContract::DoChecks(UINT testmask, __in_z const char *szFunction, __in_z char *szFile, int lineNum)
+inline void BaseContract::DoChecks(UINT testmask, __in_z const char *szFunction, __in_z const char *szFile, int lineNum)
{
STATIC_CONTRACT_DEBUG_ONLY;
STATIC_CONTRACT_NOTHROW;
GC_NOTRIGGER;
INSTANCE_CHECK;
PRECONDITION(requestedSize >=
- (count_t) (GetCount() * s_density_factor_denominator / s_density_factor_numerator));
+ (count_t) (GetCount() * TRAITS::s_density_factor_denominator / TRAITS::s_density_factor_numerator));
}
CONTRACT_END;
GC_NOTRIGGER;
INSTANCE_CHECK;
PRECONDITION(newTableSize >=
- (count_t) (GetCount() * s_density_factor_denominator / s_density_factor_numerator));
+ (count_t) (GetCount() * TRAITS::s_density_factor_denominator / TRAITS::s_density_factor_numerator));
}
CONTRACT_END;
return uwiComp->dspOffset(o);
}
- static char* dspBool(bool b)
+ static const char* dspBool(bool b)
{
return (b) ? "true" : "false";
}
-SET (CMAKE_C_FLAGS_INIT "/Wall /FC")
+SET (CMAKE_C_FLAGS_INIT "/Wall /FC /Zc:strictStrings")
SET (CMAKE_C_FLAGS_DEBUG_INIT "/Od /Zi")
SET (CLR_C_FLAGS_CHECKED_INIT "/O1 /Zi")
SET (CMAKE_C_FLAGS_RELEASE_INIT "/Ox /Zi")
SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/O2 /Zi")
-SET (CMAKE_CXX_FLAGS_INIT "/Wall /FC")
+SET (CMAKE_CXX_FLAGS_INIT "/Wall /FC /Zc:strictStrings")
SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/Od /Zi")
SET (CLR_CXX_FLAGS_CHECKED_INIT "/O1 /Zi")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "/Ox /Zi")
SET (CLR_DEFINES_DEBUG_INIT DEBUG _DEBUG _DBG URTBLDENV_FRIENDLY=Checked BUILDENV_CHECKED=1)
SET (CLR_DEFINES_CHECKED_INIT DEBUG _DEBUG _DBG URTBLDENV_FRIENDLY=Checked BUILDENV_CHECKED=1)
SET (CLR_DEFINES_RELEASE_INIT NDEBUG URTBLDENV_FRIENDLY=Retail)
-SET (CLR_DEFINES_RELWITHDEBINFO_INIT NDEBUG URTBLDENV_FRIENDLY=Retail)
\ No newline at end of file
+SET (CLR_DEFINES_RELWITHDEBINFO_INIT NDEBUG URTBLDENV_FRIENDLY=Retail)
STARTUPINFO StartupInfo;
memset(&StartupInfo, 0, sizeof(StartupInfo));
StartupInfo.cb = sizeof(StartupInfo);
- StartupInfo.lpDesktop = W("Winsta0\\Default");
+ StartupInfo.lpDesktop = const_cast<LPWSTR>(W("Winsta0\\Default"));
PROCESS_INFORMATION ProcessInformation;
if (WszCreateProcess(NULL, cmdLine, NULL, NULL, TRUE, 0, NULL, NULL, &StartupInfo, &ProcessInformation))
class WinWrapperContract
{
public:
- WinWrapperContract(char *szFunction, char *szFile, int lineNum)
+ WinWrapperContract(const char *szFunction, const char *szFile, int lineNum)
{
CANNOT_HAVE_CONTRACT;
LPCWSTR AppDomain::GetFriendlyNameForLogging()
{
- CONTRACT(LPWSTR)
+ CONTRACT(LPCWSTR)
{
NOTHROW;
GC_NOTRIGGER;
{
STANDARD_VM_CONTRACT;
- char* pUnmanagedSig = NULL;
+ const char* pUnmanagedSig = NULL;
FCSigCheck* pSigCheck = FCSigCheck::g_pFCSigCheck;
while (pSigCheck != NULL)
MetaSig msig(pMD);
int argIndex = -2; // start with return value
int enregisteredArguments = 0;
- char* pUnmanagedArg = pUnmanagedSig;
+ const char* pUnmanagedArg = pUnmanagedSig;
for (;;)
{
CorElementType argType = ELEMENT_TYPE_END;
("Unexpected end of managed fcall signature\n"
"Method: %s:%s\n", pMD->m_pszDebugClassName, pMD->m_pszDebugMethodName));
- char* pUnmanagedArgEnd = strchr(pUnmanagedArg, ',');
+ const char* pUnmanagedArgEnd = strchr(pUnmanagedArg, ',');
- char* pUnmanagedTypeEnd = (pUnmanagedArgEnd != NULL) ?
+ const char* pUnmanagedTypeEnd = (pUnmanagedArgEnd != NULL) ?
pUnmanagedArgEnd : (pUnmanagedArg + strlen(pUnmanagedArg));
if (argIndex != -2)
BaseContract::Disable();
}
-void EEContract::DoChecks(UINT testmask, __in_z const char *szFunction, __in_z char *szFile, int lineNum)
+void EEContract::DoChecks(UINT testmask, __in_z const char *szFunction, __in_z const char *szFile, int lineNum)
{
SCAN_IGNORE_THROW; // Tell the static contract analyzer to ignore contract violations
SCAN_IGNORE_FAULT; // due to the contract checking logic itself.
}
void Disable();
- void DoChecks(UINT testmask, __in_z const char *szFunction, __in_z char *szFile, int lineNum);
+ void DoChecks(UINT testmask, __in_z const char *szFunction, __in_z const char *szFile, int lineNum);
};
#define CANNOTTHROWCOMPLUSEXCEPTION() ANNOTATION_NOTHROW; \
COMPlusCannotThrowExceptionHelper _dummyvariable(TRUE, __FUNCTION__, __FILE__, __LINE__);
-extern char *g_ExceptionFile;
+extern const char *g_ExceptionFile;
extern DWORD g_ExceptionLine;
#define THROWLOG() ( g_ExceptionFile = __FILE__, g_ExceptionLine = __LINE__, TRUE )
#ifdef CHECK_FCALL_SIGNATURE
struct FCSigCheck {
public:
- FCSigCheck(void* fnc, char* sig)
+ FCSigCheck(void* fnc, const char* sig)
{
LIMITED_METHOD_CONTRACT;
func = fnc;
FCSigCheck* next;
void* func;
- char* signature;
+ const char* signature;
static FCSigCheck* g_pFCSigCheck;
};
g_TraceCount = g_pConfig->GetTraceWrapper();
}
-VOID LogInterop(__in_z LPSTR szMsg)
+VOID LogInterop(__in_z LPCSTR szMsg)
{
LIMITED_METHOD_CONTRACT;
LOG( (LF_INTEROP, LL_INFO10, "%s\n",szMsg) );
}
-VOID LogInterop(__in_z LPWSTR wszMsg)
+VOID LogInterop(__in_z LPCWSTR wszMsg)
{
LIMITED_METHOD_CONTRACT;
LOG( (LF_INTEROP, LL_INFO10, "%S\n", wszMsg) );
#ifdef _DEBUG
-VOID LogInterop(__in_z LPSTR szMsg);
-VOID LogInterop(__in_z LPWSTR szMsg);
+VOID LogInterop(__in_z LPCSTR szMsg);
+VOID LogInterop(__in_z LPCWSTR szMsg);
VOID LogInteropLeak(IUnkEntry * pEntry);
VOID LogInteropLeak(IUnknown* pItf);
static void __stdcall RedirectedHandledJITCaseForGCThreadControl();
static void __stdcall RedirectedHandledJITCaseForUserSuspend();
#if defined(HAVE_GCCOVER) && defined(USE_REDIRECT_FOR_GCSTRESS) // GCCOVER
- static void __stdcall Thread::RedirectedHandledJITCaseForGCStress();
+ static void __stdcall RedirectedHandledJITCaseForGCStress();
#endif // defined(HAVE_GCCOVER) && USE_REDIRECT_FOR_GCSTRESS
friend void CPFH_AdjustContextForThreadSuspensionRace(T_CONTEXT *pContext, Thread *pThread);
Volatile<LONG> g_trtChgStamp = 0;
Volatile<LONG> g_trtChgInFlight = 0;
-char * g_ExceptionFile; // Source of the last thrown exception (COMPLUSThrow())
+const char * g_ExceptionFile; // Source of the last thrown exception (COMPLUSThrow())
DWORD g_ExceptionLine; // ... ditto ...
void * g_ExceptionEIP; // Managed EIP of the last guy to call JITThrow.
#endif // _DEBUG
// that does not allow g_TrapReturningThreads to creep up unchecked.
EXTERN Volatile<LONG> g_trtChgStamp;
EXTERN Volatile<LONG> g_trtChgInFlight;
-EXTERN char * g_ExceptionFile;
+EXTERN const char * g_ExceptionFile;
EXTERN DWORD g_ExceptionLine;
EXTERN void * g_ExceptionEIP;
#endif