mirror of
https://github.com/open62541/open62541.git
synced 2025-06-03 04:00:21 +00:00
fix(core): Avoid VS compiler warnings
This commit is contained in:
parent
2e9959fed8
commit
af3a2c3740
@ -480,7 +480,7 @@ static UA_INLINE size_t
|
||||
UA_atomic_addSize(volatile size_t *addr, size_t increase) {
|
||||
#if UA_MULTITHREADING >= 100
|
||||
#ifdef _MSC_VER /* Visual Studio */
|
||||
return InterlockedExchangeAdd(addr, increase) + increase;
|
||||
return InterlockedExchangeAdd((volatile LONG *)addr, (LONG)increase) + increase;
|
||||
#else /* GCC/Clang */
|
||||
return __sync_add_and_fetch(addr, increase);
|
||||
#endif
|
||||
@ -512,7 +512,7 @@ static UA_INLINE size_t
|
||||
UA_atomic_subSize(volatile size_t *addr, size_t decrease) {
|
||||
#if UA_MULTITHREADING >= 100
|
||||
#ifdef _MSC_VER /* Visual Studio */
|
||||
return InterlockedExchangeAdd(addr, - (LONG) decrease) - decrease;
|
||||
return InterlockedExchangeAdd((volatile LONG *)addr, -(LONG)decrease) - decrease;
|
||||
#else /* GCC/Clang */
|
||||
return __sync_sub_and_fetch(addr, decrease);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user