From bc8787ded69ec01da8831cce4e30b3b0eac3c6d0 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 15 Sep 2020 22:26:33 -0400 Subject: [PATCH] Improves macro safety. --- .../Mac/Clock Signal/ScanTarget/CSScanTarget.mm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm b/OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm index 9f1093173..7076afa80 100644 --- a/OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm +++ b/OSBindings/Mac/Clock Signal/ScanTarget/CSScanTarget.mm @@ -138,13 +138,13 @@ constexpr MTLResourceOptions SharedResourceOptionsTexture = MTLResourceCPUCacheM #define uniforms() reinterpret_cast(_uniformsBuffer.contents) #define RangePerform(start, end, size, func) \ - if(start != end) { \ - if(start < end) { \ - func(start, end-start); \ + if((start) != (end)) { \ + if((start) < (end)) { \ + func((start), (end) - (start)); \ } else { \ - func(start, size-start); \ + func((start), (size) - (start)); \ if(end) { \ - func(0, end); \ + func(0, (end)); \ } \ } \ } @@ -854,7 +854,7 @@ using BufferingScanTarget = Outputs::Display::BufferingScanTarget; #endif #define OutputStrips(start, size) [encoder drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4 instanceCount:size baseInstance:start] - RangePerform(start, end, (_pipeline != Pipeline::DirectToDisplay ? NumBufferedLines : NumBufferedScans), OutputStrips); + RangePerform(start, end, _pipeline != Pipeline::DirectToDisplay ? NumBufferedLines : NumBufferedScans, OutputStrips); #undef OutputStrips // Complete encoding.