Skip to content

Commit 0a6af50

Browse files
committed
Fix compilation errors for std=c++2a
1 parent 4e0975a commit 0a6af50

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

public/mathlib/mathlib.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ void inline SinCos( float radians, float *sine, float *cosine )
329329
fstp DWORD PTR [eax]
330330
}
331331
#elif defined( GNUC )
332-
register double __cosr, __sinr;
332+
double __cosr, __sinr;
333333
__asm __volatile__ ("fsincos" : "=t" (__cosr), "=u" (__sinr) : "0" (radians));
334334

335335
*sine = __sinr;
@@ -629,11 +629,6 @@ template <class T> FORCEINLINE T AVG(T a, T b)
629629
// XYZ macro, for printf type functions - ex printf("%f %f %f",XYZ(myvector));
630630
#define XYZ(v) (v).x,(v).y,(v).z
631631

632-
//
633-
// Returns a clamped value in the range [min, max].
634-
//
635-
#define clamp(val, min, max) (((val) > (max)) ? (max) : (((val) < (min)) ? (min) : (val)))
636-
637632
inline float Sign( float x )
638633
{
639634
return fsel( x, 1.0f, -1.0f ); // x >= 0 ? 1.0f : -1.0f

public/tier0/threadtools.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ class CThreadFastMutex
683683
return false;
684684

685685
ThreadMemoryBarrier();
686-
++m_depth;
686+
m_depth = m_depth + 1;
687687
return true;
688688
}
689689

@@ -744,7 +744,7 @@ class CThreadFastMutex
744744
DebuggerBreak();
745745
#endif
746746

747-
--m_depth;
747+
m_depth = m_depth - 1;
748748
if ( !m_depth )
749749
{
750750
ThreadMemoryBarrier();

0 commit comments

Comments
 (0)