Skip to content

Commit

Permalink
Fixes for compatibility with Clang
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Feb 21, 2022
1 parent 9ffa0fb commit 304f1a4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
12 changes: 6 additions & 6 deletions SPOUTSDK/SpoutGL/SpoutCopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions SPOUTSDK/SpoutGL/SpoutCopy.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <intrin.h> // for cpuid to test for SSE2
#include <emmintrin.h> // for SSE2
#include <tmmintrin.h> // for SSSE3
#include <cmath> // for std::floor


class SPOUT_DLLEXP spoutCopy {
Expand Down
4 changes: 2 additions & 2 deletions SPOUTSDK/SpoutGL/SpoutFrameCount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 304f1a4

Please sign in to comment.