From de8b85b643ac08d69696ad078846424b69ae651f Mon Sep 17 00:00:00 2001 From: Jan Vorlicek Date: Fri, 27 Mar 2015 23:30:10 +0100 Subject: Fix next round of warning types This change fixes the following warnings: 1) Assignment in a condition should be wrapped in () 2) Priority of && / || should be indicated by parentheses. 3) Unknown #pragma optimize ifdefed out for non MSVC 4) Unused functions deleted or put under #ifdef 5) Extra tokens warning disabling moved to the CMakeLists.txt in the src/inc 6) Self assignment of a member or local variable 7) Assigning ~0 to a bitfield member that was just 8 bit wide It also fixes a bug in the STRESS_LOGxx macro invocation in exceptionhandling.cpp and stackwalk.cpp related to recent adding the DBG_ADDR macro usage. This macro expanded a single parameter into two expressions to extract high / low 32 bits separately. But the STRESS_LOGxx parameters are passed to the StressLog::LogMsg method as follows: (void*)(size_t)(data1) That means that the expanded pair x, y would be inserted as data 1 and that leads to ignoring the x due to the comma operator. --- src/vm/siginfo.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/vm/siginfo.cpp') diff --git a/src/vm/siginfo.cpp b/src/vm/siginfo.cpp index 3cc9cf1a23..dd57e63840 100644 --- a/src/vm/siginfo.cpp +++ b/src/vm/siginfo.cpp @@ -1121,7 +1121,7 @@ TypeHandle SigPointer::GetTypeHandleThrowing( ClassLoader::NotFoundAction notFoundAction; CorInternalStates tdTypes; - switch(typ) { + switch((DWORD)typ) { case ELEMENT_TYPE_TYPEDBYREF: { thRet = TypeHandle(g_TypedReferenceMT); @@ -1517,7 +1517,7 @@ TypeHandle SigPointer::GetTypeHandleThrowing( // Check that the type that we loaded matches the signature // with regards to ET_CLASS and ET_VALUETYPE // - if ((fLoadTypes == ClassLoader::LoadTypes)) + if (fLoadTypes == ClassLoader::LoadTypes) { // Skip this check when using zap sigs; it should have been correctly computed at NGen time // and a change from one to the other would have invalidated the image. @@ -1811,7 +1811,7 @@ TypeHandle SigPointer::GetGenericInstType(Module * pModule, } #ifndef DACCESS_COMPILE - if ((fLoadTypes == ClassLoader::LoadTypes)) + if (fLoadTypes == ClassLoader::LoadTypes) { // Skip this check when using zap sigs; it should have been correctly computed at NGen time // and a change from one to the other would have invalidated the image. Leave in the code for debug so we can assert below. @@ -4816,9 +4816,9 @@ BOOL MetaSig::CompareVariableConstraints(const Substitution *pSubst1, // b) may be implicit (ie. absent) in the overriden variable's declaration if (!(CompareTypeDefOrRefOrSpec(pModule1, tkConstraintType1, NULL, MscorlibBinder::GetModule(), g_pObjectClass->GetCl(), NULL, NULL) || - ((specialConstraints1 & gpNotNullableValueTypeConstraint) != 0) && + (((specialConstraints1 & gpNotNullableValueTypeConstraint) != 0) && (CompareTypeDefOrRefOrSpec(pModule1, tkConstraintType1, NULL, - MscorlibBinder::GetModule(), g_pValueTypeClass->GetCl(), NULL, NULL)))) + MscorlibBinder::GetModule(), g_pValueTypeClass->GetCl(), NULL, NULL))))) { HENUMInternalHolder hEnum2(pInternalImport2); mdGenericParamConstraint tkConstraint2; -- cgit v1.2.3