Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Parenthesize macros (#23982)
Browse files Browse the repository at this point in the history
* Add parenthesis to parameters.

* Revert changes to IS_UNWINDING.
  • Loading branch information
bdebaere authored and jkotas committed Oct 1, 2019
1 parent 8f719f2 commit ce29457
Show file tree
Hide file tree
Showing 49 changed files with 112 additions and 112 deletions.
4 changes: 2 additions & 2 deletions src/binder/bindinglog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
#include "strsafe.h"

#define SIZE_OF_TOKEN_INFORMATION \
sizeof( TOKEN_USER ) \
(sizeof( TOKEN_USER ) \
+ sizeof( SID ) \
+ sizeof( ULONG ) * SID_MAX_SUB_AUTHORITIES
+ sizeof( ULONG ) * SID_MAX_SUB_AUTHORITIES)

#include "../dlls/mscorrc/fusres.h"

Expand Down
2 changes: 1 addition & 1 deletion src/debug/di/rspriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct MachineInfo;
#include "eventchannel.h"

#undef ASSERT
#define CRASH(x) _ASSERTE(!x)
#define CRASH(x) _ASSERTE(!(x))
#define ASSERT(x) _ASSERTE(x)

// We want to keep the 'worst' HRESULT - if one has failed (..._E_...) & the
Expand Down
2 changes: 1 addition & 1 deletion src/debug/di/rstype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ HRESULT CordbType::GetStaticFieldValue(mdFieldDef fieldDef,
}

// Combine E_T_s and rank together to get an id for the m_sharedtypes table
#define CORDBTYPE_ID(elementType,rank) ((unsigned int) elementType * (rank + 1) + 1)
#define CORDBTYPE_ID(elementType,rank) (((unsigned int) (elementType)) * ((rank) + 1) + 1)


//-----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/debug/ee/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

const char *GetTType( TraceType tt);

#define IsSingleStep(exception) (exception == EXCEPTION_SINGLE_STEP)
#define IsSingleStep(exception) ((exception) == EXCEPTION_SINGLE_STEP)



Expand Down
2 changes: 1 addition & 1 deletion src/debug/ee/debugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#include "canary.h"

#undef ASSERT
#define CRASH(x) _ASSERTE(!x)
#define CRASH(x) _ASSERTE(!(x))
#define ASSERT(x) _ASSERTE(x)


Expand Down
6 changes: 3 additions & 3 deletions src/dlls/mscorrc/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
#define MSG_FOR_URT_HR(hr) (0x6000 + (HRESULT_CODE(hr)))
#define MAX_URT_HRESULT_CODE 0x3000

#define HR_FOR_URT_MSG(code) ((code >=0x6000 && code <= 0x6000+MAX_URT_HRESULT_CODE) ? \
MAKE_HRESULT(SEVERITY_ERROR, FACILITY_URT, code - 0x6000) : \
code)
#define HR_FOR_URT_MSG(code) (((code) >=0x6000 && (code) <= 0x6000+MAX_URT_HRESULT_CODE) ? \
MAKE_HRESULT(SEVERITY_ERROR, FACILITY_URT, (code) - 0x6000) : \
(code))

#ifndef HRESULT_CODE
#define HRESULT_CODE(hr) ((hr) & 0xFFFF)
Expand Down
2 changes: 1 addition & 1 deletion src/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3941,7 +3941,7 @@ size_t gcard_of ( uint8_t*);

//GC Flags
#define GC_MARKED (size_t)0x1
#define slot(i, j) ((uint8_t**)(i))[j+1]
#define slot(i, j) ((uint8_t**)(i))[(j)+1]

#define free_object_base_size (plug_skew + sizeof(ArrayBase))

Expand Down
4 changes: 2 additions & 2 deletions src/gc/handletablepriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@

// little-endian write barrier mask manipulation
#define GEN_CLUMP_0_MASK (0x000000FF)
#define NEXT_CLUMP_IN_MASK(dw) (dw >> BITS_PER_BYTE)
#define NEXT_CLUMP_IN_MASK(dw) ((dw) >> BITS_PER_BYTE)

#else

// big-endian write barrier mask manipulation
#define GEN_CLUMP_0_MASK (0xFF000000)
#define NEXT_CLUMP_IN_MASK(dw) (dw << BITS_PER_BYTE)
#define NEXT_CLUMP_IN_MASK(dw) ((dw) << BITS_PER_BYTE)

#endif

Expand Down
6 changes: 3 additions & 3 deletions src/gc/handletablescan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,10 @@ If you change any of those algorithm, please verify it by this program:

#define GEN_FULLGC PREFOLD_FILL_INTO_AGEMASK(GEN_AGE_LIMIT)

#define MAKE_CLUMP_MASK_ADDENDS(bytes) (bytes >> GEN_INC_SHIFT)
#define APPLY_CLUMP_ADDENDS(gen, addend) (gen + addend)
#define MAKE_CLUMP_MASK_ADDENDS(bytes) ((bytes) >> GEN_INC_SHIFT)
#define APPLY_CLUMP_ADDENDS(gen, addend) ((gen) + (addend))

#define COMPUTE_CLUMP_MASK(gen, msk) (((gen & GEN_CLAMP) - msk) & GEN_MASK)
#define COMPUTE_CLUMP_MASK(gen, msk) ((((gen) & GEN_CLAMP) - (msk)) & GEN_MASK)
#define COMPUTE_CLUMP_ADDENDS(gen, msk) MAKE_CLUMP_MASK_ADDENDS(COMPUTE_CLUMP_MASK(gen, msk))
#define COMPUTE_AGED_CLUMPS(gen, msk) APPLY_CLUMP_ADDENDS(gen, COMPUTE_CLUMP_ADDENDS(gen, msk))

Expand Down
8 changes: 4 additions & 4 deletions src/gc/objecthandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ struct HandleTableBucket
#define VHT_STRONG (0x00000400) // avoid using low byte so we don't overlap normal types
#define VHT_PINNED (0x00000800) // avoid using low byte so we don't overlap normal types

#define IS_VALID_VHT_VALUE(flag) ((flag == VHT_WEAK_SHORT) || \
(flag == VHT_WEAK_LONG) || \
(flag == VHT_STRONG) || \
(flag == VHT_PINNED))
#define IS_VALID_VHT_VALUE(flag) (((flag) == VHT_WEAK_SHORT) || \
((flag) == VHT_WEAK_LONG) || \
((flag) == VHT_STRONG) || \
((flag) == VHT_PINNED))

GC_DAC_VISIBLE
OBJECTREF GetDependentHandleSecondary(OBJECTHANDLE handle);
Expand Down
4 changes: 2 additions & 2 deletions src/ilasm/grammar_before.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ int nTemp=0;

unsigned int uMethodBeginLine,uMethodBeginColumn;

#define ELEMENT_TYPE_VARFIXUP ELEMENT_TYPE_MAX+2
#define ELEMENT_TYPE_MVARFIXUP ELEMENT_TYPE_MAX+3
#define ELEMENT_TYPE_VARFIXUP (ELEMENT_TYPE_MAX+2)
#define ELEMENT_TYPE_MVARFIXUP (ELEMENT_TYPE_MAX+3)

FIFO<char> TyParFixupList;
void FixupTyPars(PCOR_SIGNATURE pSig, ULONG cSig);
Expand Down
2 changes: 1 addition & 1 deletion src/ilasm/writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,7 @@ HRESULT Assembler::CreatePEFile(__in __nullterminated WCHAR *pwzOutputFilename)
EmitUnresolvedCustomAttributes();
// Emit typedefs as special TypeSpecs
{
#define ELEMENT_TYPE_TYPEDEF ELEMENT_TYPE_MAX+1
#define ELEMENT_TYPE_TYPEDEF (ELEMENT_TYPE_MAX+1)
TypeDefDescr* pTDD;
unsigned __int8* pb;
unsigned namesize;
Expand Down
2 changes: 1 addition & 1 deletion src/ildasm/dasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ void DumpTypelist(void* GUICookie)
}

}
#define ELEMENT_TYPE_TYPEDEF ELEMENT_TYPE_MAX+1
#define ELEMENT_TYPE_TYPEDEF (ELEMENT_TYPE_MAX+1)
BOOL EnumTypedefs()
{
HENUMInternal hEnum;
Expand Down
4 changes: 2 additions & 2 deletions src/inc/clrprivbinderutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class AssemblySpec;
fail_op; \
} while (false)

#define VALIDATE_PTR_RET(val) VALIDATE_CONDITION(val != nullptr, return E_POINTER)
#define VALIDATE_PTR_THROW(val) VALIDATE_CONDITION(val != nullptr, ThrowHR(E_POINTER))
#define VALIDATE_PTR_RET(val) VALIDATE_CONDITION((val) != nullptr, return E_POINTER)
#define VALIDATE_PTR_THROW(val) VALIDATE_CONDITION((val) != nullptr, ThrowHR(E_POINTER))
#define VALIDATE_ARG_RET(condition) VALIDATE_CONDITION(condition, return E_INVALIDARG)
#define VALIDATE_ARG_THROW(condition) VALIDATE_CONDITION(condition, ThrowHR(E_INVALIDARG))

Expand Down
8 changes: 4 additions & 4 deletions src/inc/corhdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -1894,10 +1894,10 @@ typedef enum CorSaveSize
} CorSaveSize;
#endif

#define COR_IS_METHOD_MANAGED_IL(flags) ((flags & 0xf) == (miIL | miManaged))
#define COR_IS_METHOD_MANAGED_OPTIL(flags) ((flags & 0xf) == (miOPTIL | miManaged))
#define COR_IS_METHOD_MANAGED_NATIVE(flags) ((flags & 0xf) == (miNative | miManaged))
#define COR_IS_METHOD_UNMANAGED_NATIVE(flags) ((flags & 0xf) == (miNative | miUnmanaged))
#define COR_IS_METHOD_MANAGED_IL(flags) (((flags) & 0xf) == (miIL | miManaged))
#define COR_IS_METHOD_MANAGED_OPTIL(flags) (((flags) & 0xf) == (miOPTIL | miManaged))
#define COR_IS_METHOD_MANAGED_NATIVE(flags) (((flags) & 0xf) == (miNative | miManaged))
#define COR_IS_METHOD_UNMANAGED_NATIVE(flags) (((flags) & 0xf) == (miNative | miUnmanaged))

//
// Enum used with NATIVE_TYPE_ARRAY.
Expand Down
2 changes: 1 addition & 1 deletion src/inc/debugmacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ unsigned DbgGetEXETimeStamp();
// will not be coorelated with each other (9973 is prime). Returns false on a retail build
#define DbgRandomOnHashAndExe(hash, fractionOn) \
(((DbgGetEXETimeStamp() * __LINE__ * ((hash) ? (hash) : 1)) % 9973) < \
unsigned(fractionOn * 9973))
unsigned((fractionOn) * 9973))
#define DbgRandomOnExe(fractionOn) DbgRandomOnHashAndExe(0, fractionOn)
#define DbgRandomOnStringAndExe(string, fractionOn) DbgRandomOnHashAndExe(HashStringA(string), fractionOn)

Expand Down
4 changes: 2 additions & 2 deletions src/inc/eventtracebase.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ enum EtwThreadFlags
//

#define ETW_TRACING_INITIALIZED(RegHandle) \
((g_pEtwTracer && RegHandle) || EVENT_PIPE_ENABLED())
((g_pEtwTracer && (RegHandle)) || EVENT_PIPE_ENABLED())

//
// Use this macro to check if an event is enabled
Expand Down Expand Up @@ -558,7 +558,7 @@ extern "C" {
// User defined callback
//
#define MCGEN_PRIVATE_ENABLE_CALLBACK(RequestCode, Context, InOutBufferSize, Buffer) \
EtwCallback(NULL /* SourceId */, (RequestCode==WMI_ENABLE_EVENTS) ? EVENT_CONTROL_CODE_ENABLE_PROVIDER : EVENT_CONTROL_CODE_DISABLE_PROVIDER, 0 /* Level */, 0 /* MatchAnyKeyword */, 0 /* MatchAllKeyword */, NULL /* FilterData */, Context)
EtwCallback(NULL /* SourceId */, ((RequestCode)==WMI_ENABLE_EVENTS) ? EVENT_CONTROL_CODE_ENABLE_PROVIDER : EVENT_CONTROL_CODE_DISABLE_PROVIDER, 0 /* Level */, 0 /* MatchAnyKeyword */, 0 /* MatchAllKeyword */, NULL /* FilterData */, Context)

//
// User defined callback2
Expand Down
2 changes: 1 addition & 1 deletion src/inc/ex.h
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ class CAutoTryCleanup
//
// We also check the global override flag incase it has been set to force pre-V4 beahviour. "0" implies it has not
// been overriden.
#define SET_CE_RETHROW_FLAG_FOR_EX_CATCH(expr) (((expr == TRUE) && \
#define SET_CE_RETHROW_FLAG_FOR_EX_CATCH(expr) ((((expr) == TRUE) && \
(CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_legacyCorruptedStateExceptionsPolicy) == 0) && \
IsProcessCorruptedStateException(GetCurrentExceptionCode(), FALSE)))

Expand Down
4 changes: 2 additions & 2 deletions src/inc/palclr.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
#else
// Ports in progress - run-time asserts only
#define PORTABILITY_WARNING(message)
#define PORTABILITY_ASSERT(message) _ASSERTE(false && message)
#define PORTABILITY_ASSERT(message) _ASSERTE(false && (message))
#endif

#define DIRECTORY_SEPARATOR_CHAR_A '\\'
Expand Down Expand Up @@ -473,7 +473,7 @@

// Executes the handler if the specified exception code matches
// the one in the exception. Otherwise, returns EXCEPTION_CONTINUE_SEARCH.
#define PAL_EXCEPT_IF_EXCEPTION_CODE(dwExceptionCode) PAL_EXCEPT((GetExceptionCode() == dwExceptionCode)?EXCEPTION_EXECUTE_HANDLER:EXCEPTION_CONTINUE_SEARCH)
#define PAL_EXCEPT_IF_EXCEPTION_CODE(dwExceptionCode) PAL_EXCEPT((GetExceptionCode() == (dwExceptionCode))?EXCEPTION_EXECUTE_HANDLER:EXCEPTION_CONTINUE_SEARCH)

#define PAL_CPP_TRY try
#define PAL_CPP_ENDTRY
Expand Down
2 changes: 1 addition & 1 deletion src/inc/sbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
// ================================================================================

#define ALIGNMENT(size) \
(( (size^(size-1)) >> 1) +1)
(( ((size)^((size)-1)) >> 1) +1)

#define ALIGN(size, align) \
(((size)+((align)-1)) & ~((align)-1))
Expand Down
16 changes: 8 additions & 8 deletions src/inc/utilcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,14 @@ typedef LPSTR LPUTF8;
#endif


#define IS_DIGIT(ch) ((ch >= W('0')) && (ch <= W('9')))
#define DIGIT_TO_INT(ch) (ch - W('0'))
#define INT_TO_DIGIT(i) ((WCHAR)(W('0') + i))
#define IS_DIGIT(ch) (((ch) >= W('0')) && ((ch) <= W('9')))
#define DIGIT_TO_INT(ch) ((ch) - W('0'))
#define INT_TO_DIGIT(i) ((WCHAR)(W('0') + (i)))

#define IS_HEXDIGIT(ch) (((ch >= W('a')) && (ch <= W('f'))) || \
((ch >= W('A')) && (ch <= W('F'))))
#define IS_HEXDIGIT(ch) ((((ch) >= W('a')) && ((ch) <= W('f'))) || \
(((ch) >= W('A')) && ((ch) <= W('F'))))
#define HEXDIGIT_TO_INT(ch) ((towlower(ch) - W('a')) + 10)
#define INT_TO_HEXDIGIT(i) ((WCHAR)(W('a') + (i - 10)))
#define INT_TO_HEXDIGIT(i) ((WCHAR)(W('a') + ((i) - 10)))


// Helper will 4 byte align a value, rounding up.
Expand Down Expand Up @@ -965,10 +965,10 @@ inline HRESULT BadError(HRESULT hr)
}

#define TESTANDRETURNPOINTER(pointer) \
TESTANDRETURN(pointer!=NULL, E_POINTER)
TESTANDRETURN((pointer)!=NULL, E_POINTER)

#define TESTANDRETURNMEMORY(pointer) \
TESTANDRETURN(pointer!=NULL, E_OUTOFMEMORY)
TESTANDRETURN((pointer)!=NULL, E_OUTOFMEMORY)

#define TESTANDRETURNHR(hr) \
TESTANDRETURN(SUCCEEDED(hr), hr)
Expand Down
2 changes: 1 addition & 1 deletion src/jit/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ extern void notYetImplemented(const char* msg, const char* file, unsigned line);

#else // NYI not available; make it an assert.

#define NYI(msg) assert(!msg)
#define NYI(msg) assert(!(msg))
#define NYI_AMD64(msg) do { } while (0)
#define NYI_ARM(msg) do { } while (0)
#define NYI_ARM64(msg) do { } while (0)
Expand Down
10 changes: 5 additions & 5 deletions src/jit/gentree.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,11 @@ struct GenTree

#define NO_CSE (0)

#define IS_CSE_INDEX(x) (x != 0)
#define IS_CSE_USE(x) (x > 0)
#define IS_CSE_DEF(x) (x < 0)
#define GET_CSE_INDEX(x) ((x > 0) ? x : -x)
#define TO_CSE_DEF(x) (-x)
#define IS_CSE_INDEX(x) ((x) != 0)
#define IS_CSE_USE(x) ((x) > 0)
#define IS_CSE_DEF(x) ((x) < 0)
#define GET_CSE_INDEX(x) (((x) > 0) ? x : -(x))
#define TO_CSE_DEF(x) (-(x))

signed char gtCSEnum; // 0 or the CSE index (negated if def)
// valid only for CSE expressions
Expand Down
4 changes: 2 additions & 2 deletions src/jit/instr.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ enum emitAttr : unsigned
#define EA_ATTR(x) ((emitAttr)(x))
#define EA_SIZE(x) ((emitAttr)(((unsigned)(x)) & EA_SIZE_MASK))
#define EA_SIZE_IN_BYTES(x) ((UNATIVE_OFFSET)(EA_SIZE(x)))
#define EA_SET_SIZE(x, sz) ((emitAttr)((((unsigned)(x)) & ~EA_SIZE_MASK) | sz))
#define EA_SET_FLG(x, flg) ((emitAttr)(((unsigned)(x)) | flg))
#define EA_SET_SIZE(x, sz) ((emitAttr)((((unsigned)(x)) & ~EA_SIZE_MASK) | (sz)))
#define EA_SET_FLG(x, flg) ((emitAttr)(((unsigned)(x)) | (flg)))
#define EA_4BYTE_DSP_RELOC (EA_SET_FLG(EA_4BYTE, EA_DSP_RELOC_FLG))
#define EA_PTR_DSP_RELOC (EA_SET_FLG(EA_PTRSIZE, EA_DSP_RELOC_FLG))
#define EA_HANDLE_CNS_RELOC (EA_SET_FLG(EA_PTRSIZE, EA_CNS_RELOC_FLG))
Expand Down
6 changes: 3 additions & 3 deletions src/jit/instrsxarch.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,15 @@ INSTMUL(imul_15, "imul", IUM_RD, BAD_CODE, 0x4400003868,
// So a 4-byte opcode would be something like this:
// 0x22114433

#define PACK3(byte1,byte2,byte3) ((byte1 << 16) | (byte2 << 24) | byte3)
#define PACK2(byte1,byte2) ((byte1 << 16) | byte2)
#define PACK3(byte1,byte2,byte3) (((byte1) << 16) | ((byte2) << 24) | (byte3))
#define PACK2(byte1,byte2) (((byte1) << 16) | (byte2))
#define SSEFLT(c) PACK3(0xf3, 0x0f, c)
#define SSEDBL(c) PACK3(0xf2, 0x0f, c)
#define PCKDBL(c) PACK3(0x66, 0x0f, c)
#define PCKFLT(c) PACK2(0x0f,c)

// These macros encode extra byte that is implicit in the macro.
#define PACK4(byte1,byte2,byte3,byte4) ((byte1 << 16) | (byte2 << 24) | byte3 | (byte4 << 8))
#define PACK4(byte1,byte2,byte3,byte4) (((byte1) << 16) | ((byte2) << 24) | (byte3) | ((byte4) << 8))
#define SSE38(c) PACK4(0x66, 0x0f, 0x38, c)
#define SSE3A(c) PACK4(0x66, 0x0f, 0x3A, c)

Expand Down
4 changes: 2 additions & 2 deletions src/jit/register.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ REGALIAS(EDI, RDI)

#ifdef _TARGET_AMD64_
#define XMMBASE 16
#define XMMMASK(x) (__int64(1) << (x+XMMBASE))
#define XMMMASK(x) (__int64(1) << ((x)+XMMBASE))
#else // !_TARGET_AMD64_
#define XMMBASE 8
#define XMMMASK(x) (__int32(1) << (x+XMMBASE))
#define XMMMASK(x) (__int32(1) << ((x)+XMMBASE))
#endif // !_TARGET_AMD64_

REGDEF(XMM0, 0+XMMBASE, XMMMASK(0), "mm0" )
Expand Down
6 changes: 3 additions & 3 deletions src/jit/simdcodegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// - bits 6 and 7 of the immediate indicate which source item to select (0..3)
// - bits 4 and 5 of the immediate indicate which target item to insert into (0..3)
// - bits 0 to 3 of the immediate indicate which target item to zero
#define INSERTPS_SOURCE_SELECT(i) (i << 6)
#define INSERTPS_TARGET_SELECT(i) (i << 4)
#define INSERTPS_ZERO(i) (1 << i)
#define INSERTPS_SOURCE_SELECT(i) ((i) << 6)
#define INSERTPS_TARGET_SELECT(i) ((i) << 4)
#define INSERTPS_ZERO(i) (1 << (i))

// getOpForSIMDIntrinsic: return the opcode for the given SIMD Intrinsic
//
Expand Down
2 changes: 1 addition & 1 deletion src/md/compiler/filtermanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "stdafx.h"
#include "filtermanager.h"

#define IsGlobalTypeDef(td) (td == TokenFromRid(mdtTypeDef, 1))
#define IsGlobalTypeDef(td) ((td) == TokenFromRid(mdtTypeDef, 1))

//*****************************************************************************
// Walk up to the containing tree and
Expand Down
2 changes: 1 addition & 1 deletion src/md/debug_metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
#define INDEBUG_MD_COMMA(expr)

#define Debug_ReportError(strMessage)
#define Debug_ReportInternalError(strMessage) _ASSERTE(!strMessage)
#define Debug_ReportInternalError(strMessage) _ASSERTE(!(strMessage))
#endif //!_DEBUG_METADATA

// --------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/md/runtime/metamodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ CMiniMdBase::encodeToken(
//*****************************************************************************
inline BYTE cbRID(ULONG ixMax) { return ixMax > USHRT_MAX ? (BYTE) sizeof(ULONG) : (BYTE) sizeof(USHORT); }

#define _CBTKN(cRecs,tkns) cbRID(cRecs << m_cb[lengthof(tkns)])
#define _CBTKN(cRecs,tkns) cbRID((cRecs) << m_cb[lengthof(tkns)])

//*****************************************************************************
// Constructor.
Expand Down
4 changes: 2 additions & 2 deletions src/utilcode/loadrc-impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void SkipChars(MyString &str, MyStringIterator &i, WCHAR c1, WCHAR c2) { while (
#include <algorithm>
typedef std::wstring MyString;
typedef std::wstring::const_iterator MyStringIterator;
#define EndsWithChar(OBJ, CHAR) (*(OBJ.rbegin()) == CHAR)
#define EndsWithChar(OBJ, CHAR) (*(OBJ.rbegin()) == (CHAR))
#define AppendChar(OBJ, CHAR) (OBJ.push_back(CHAR))
#define AppendStr(OBJ, STR) (OBJ += STR)
#define TrimLastChar(OBJ) (OBJ.resize(OBJ.size() - 1))
Expand All @@ -50,7 +50,7 @@ typedef std::wstring::const_iterator MyStringIterator;
#define StrEndIter(OBJ) (OBJ.end())
#define FindNext(OBJ, ITER, CHAR) (ITER = std::find<std::wstring::const_iterator>(ITER, OBJ.end(), CHAR))
#define MakeString(DST, OBJ, BEG, END) (DST = MyString(BEG, END))
#define StrEquals(STR1, STR2) (STR1 == STR2)
#define StrEquals(STR1, STR2) ((STR1) == (STR2))
#define ClrGetEnvironmentVariable(var, res) GetEnvVar(L##var, res)
bool FindLast(const MyString &str, MyStringIterator &iter, WCHAR c)
{
Expand Down
Loading

0 comments on commit ce29457

Please sign in to comment.