From 304f1a402e8c03c5967bfd2b4dfa245bd1d92d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Sun, 20 Feb 2022 15:17:09 +0100 Subject: [PATCH] Fixes for compatibility with Clang --- SPOUTSDK/SpoutGL/SpoutCopy.cpp | 12 ++++++------ SPOUTSDK/SpoutGL/SpoutCopy.h | 1 + SPOUTSDK/SpoutGL/SpoutFrameCount.cpp | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/SPOUTSDK/SpoutGL/SpoutCopy.cpp b/SPOUTSDK/SpoutGL/SpoutCopy.cpp index 4a13c4d8..62203c28 100644 --- a/SPOUTSDK/SpoutGL/SpoutCopy.cpp +++ b/SPOUTSDK/SpoutGL/SpoutCopy.cpp @@ -1026,8 +1026,8 @@ void spoutCopy::rgba2rgbaResample(const void* source, void* dest, unsigned int pixel, nearestMatch; for (i = 0; i < destHeight; i++) { for (j = 0; j < destWidth; j++) { - px = floor((float)j*x_ratio); - py = floor((float)i*y_ratio); + px = std::floor((float)j*x_ratio); + py = std::floor((float)i*y_ratio); if (bInvert) pixel = (destHeight - i - 1)*destWidth * 4 + j * 4; // flip vertically else @@ -1063,8 +1063,8 @@ void spoutCopy::rgba2rgbResample(const void* source, void* dest, unsigned int pixel, nearestMatch; for (i = 0; i < destHeight; i++) { for (j = 0; j < destWidth; j++) { - px = floor((float)j*x_ratio); - py = floor((float)i*y_ratio); + px = std::floor((float)j*x_ratio); + py = std::floor((float)i*y_ratio); if (bMirror) { if (bInvert) @@ -1102,8 +1102,8 @@ void spoutCopy::rgba2bgrResample(const void* source, void* dest, unsigned int pixel, nearestMatch; for (i = 0; i < destHeight; i++) { for (j = 0; j < destWidth; j++) { - px = floor((float)j*x_ratio); - py = floor((float)i*y_ratio); + px = std::floor((float)j*x_ratio); + py = std::floor((float)i*y_ratio); if (bInvert) pixel = (destHeight - i - 1)*destWidth * 3 + j * 3; // flip vertically else diff --git a/SPOUTSDK/SpoutGL/SpoutCopy.h b/SPOUTSDK/SpoutGL/SpoutCopy.h index 3a9b7ae1..2b604d1f 100644 --- a/SPOUTSDK/SpoutGL/SpoutCopy.h +++ b/SPOUTSDK/SpoutGL/SpoutCopy.h @@ -40,6 +40,7 @@ #include // for cpuid to test for SSE2 #include // for SSE2 #include // for SSSE3 +#include // for std::floor class SPOUT_DLLEXP spoutCopy { diff --git a/SPOUTSDK/SpoutGL/SpoutFrameCount.cpp b/SPOUTSDK/SpoutGL/SpoutFrameCount.cpp index aa3efe2b..e14cb842 100644 --- a/SPOUTSDK/SpoutGL/SpoutFrameCount.cpp +++ b/SPOUTSDK/SpoutGL/SpoutFrameCount.cpp @@ -798,7 +798,7 @@ bool spoutFrameCount::CheckKeyedAccess(ID3D11Texture2D* pTexture) IDXGIKeyedMutex* pDXGIKeyedMutex = nullptr; // Check the keyed mutex - pTexture->QueryInterface(_uuidof(IDXGIKeyedMutex), (void**)&pDXGIKeyedMutex); + pTexture->QueryInterface(__uuidof(IDXGIKeyedMutex), (void**)&pDXGIKeyedMutex); if (pDXGIKeyedMutex) { HRESULT hr = pDXGIKeyedMutex->AcquireSync(0, 67); // TODO - link with SPOUT_WAIT_TIMEOUT switch (hr) { @@ -828,7 +828,7 @@ void spoutFrameCount::AllowKeyedAccess(ID3D11Texture2D* pTexture) // 22-24 microseconds if (pTexture) { IDXGIKeyedMutex* pDXGIKeyedMutex; - pTexture->QueryInterface(_uuidof(IDXGIKeyedMutex), (void**)&pDXGIKeyedMutex); + pTexture->QueryInterface(__uuidof(IDXGIKeyedMutex), (void**)&pDXGIKeyedMutex); if (pDXGIKeyedMutex) { pDXGIKeyedMutex->ReleaseSync(0); pDXGIKeyedMutex->Release();