diff --git a/renderdoc/common/common.h b/renderdoc/common/common.h index ce8f926c6..3c5773baa 100644 --- a/renderdoc/common/common.h +++ b/renderdoc/common/common.h @@ -417,8 +417,8 @@ void rdcassert(const char *msg, const char *file, unsigned int line, const char #endif #define RDCASSERT(...) RDCASSERTMSG("", __VA_ARGS__) -#define RDCASSERTEQUAL(a, b) RDCASSERTMSG("", a == b, a, b) -#define RDCASSERTNOTEQUAL(a, b) RDCASSERTMSG("", a != b, a, b) +#define RDCASSERTEQUAL(a, b) RDCASSERTMSG("", (a) == (b), a, b) +#define RDCASSERTNOTEQUAL(a, b) RDCASSERTMSG("", (a) != (b), a, b) // // Compile asserts diff --git a/renderdoc/maths/formatpacking.cpp b/renderdoc/maths/formatpacking.cpp index 48895a4a8..5b9f79d9f 100644 --- a/renderdoc/maths/formatpacking.cpp +++ b/renderdoc/maths/formatpacking.cpp @@ -494,8 +494,8 @@ TEST_CASE("Check format conversion", "[format]") SECTION("Spot test ConvertFromR11G11B10") { #define R11G11B10(re, rm, ge, gm, be, bm) \ - ((uint32_t(re & 0x1f) << 6) | (uint32_t(ge & 0x1f) << 17) | (uint32_t(be & 0x1f) << 27) | \ - uint32_t(rm & 0x3f) << 0 | uint32_t(gm & 0x3f) << 11 | uint32_t(bm & 0x1f) << 22) + ((uint32_t((re)&0x1f) << 6) | (uint32_t((ge)&0x1f) << 17) | (uint32_t((be)&0x1f) << 27) | \ + uint32_t((rm)&0x3f) << 0 | uint32_t((gm)&0x3f) << 11 | uint32_t((bm)&0x1f) << 22) #define TEST11(e, m, f) \ { \ diff --git a/renderdoc/replay/replay_driver.cpp b/renderdoc/replay/replay_driver.cpp index 49c508a54..cbd48fe3a 100644 --- a/renderdoc/replay/replay_driver.cpp +++ b/renderdoc/replay/replay_driver.cpp @@ -169,9 +169,9 @@ void PatchLineStripIndexBuffer(const DrawcallDescription *draw, uint8_t *idx8, u { const uint32_t restart = 0xffffffff; -#define IDX_VALUE(offs) \ - (idx16 ? idx16[index + offs] \ - : (idx32 ? idx32[index + offs] : (idx8 ? idx8[index + offs] : index + offs))) +#define IDX_VALUE(offs) \ + (idx16 ? idx16[index + (offs)] \ + : (idx32 ? idx32[index + (offs)] : (idx8 ? idx8[index + (offs)] : index + (offs)))) switch(draw->topology) {