mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 13:20:54 +00:00
Reverse CmpExch parameters to the sensible way around
This commit is contained in:
@@ -204,7 +204,7 @@ int32_t Dec32(volatile int32_t *i);
|
||||
int64_t Inc64(volatile int64_t *i);
|
||||
int64_t Dec64(volatile int64_t *i);
|
||||
int64_t ExchAdd64(volatile int64_t *i, int64_t a);
|
||||
int32_t CmpExch32(volatile int32_t *dest, int32_t exch, int32_t comp);
|
||||
int32_t CmpExch32(volatile int32_t *dest, int32_t oldVal, int32_t newVal);
|
||||
};
|
||||
|
||||
namespace Callstack
|
||||
|
||||
@@ -60,9 +60,9 @@ int64_t ExchAdd64(volatile int64_t *i, int64_t a)
|
||||
return __sync_add_and_fetch(i, int64_t(a));
|
||||
}
|
||||
|
||||
int32_t CmpExch32(volatile int32_t *dest, int32_t exch, int32_t comp)
|
||||
int32_t CmpExch32(volatile int32_t *dest, int32_t oldVal, int32_t newVal)
|
||||
{
|
||||
return __sync_val_compare_and_swap(dest, comp, exch);
|
||||
return __sync_val_compare_and_swap(dest, oldVal, newVal);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -73,9 +73,9 @@ int64_t ExchAdd64(volatile int64_t *i, int64_t a)
|
||||
return (int64_t)InterlockedExchangeAdd64((volatile LONG64 *)i, a);
|
||||
}
|
||||
|
||||
int32_t CmpExch32(volatile int32_t *dest, int32_t exch, int32_t comp)
|
||||
int32_t CmpExch32(volatile int32_t *dest, int32_t oldVal, int32_t newVal)
|
||||
{
|
||||
return (int32_t)InterlockedCompareExchange((volatile LONG *)dest, exch, comp);
|
||||
return (int32_t)InterlockedCompareExchange((volatile LONG *)dest, newVal, oldVal);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user