1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

ruby_atomic.h: suppress a warning

* ruby_atomic.h (ATOMIC_SIZE_SUB): add cast to suppress a warning by VC++.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-10-18 14:23:50 +00:00
parent 0712483fdd
commit 9f9b476710

View file

@ -60,14 +60,14 @@ rb_w32_atomic_cas(volatile rb_atomic_t *var, rb_atomic_t oldval, rb_atomic_t new
# define ATOMIC_CAS(var, oldval, newval) rb_w32_atomic_cas(&(var), (oldval), (newval))
# endif
# ifdef _M_AMD64
# define ATOMIC_SIZE_ADD(var, val) InterlockedExchangeAdd64(&(var), (val))
# define ATOMIC_SIZE_SUB(var, val) InterlockedExchangeAdd64(&(var), -(val))
# define ATOMIC_SIZE_ADD(var, val) InterlockedExchangeAdd64((LONG_LONG *)&(var), (val))
# define ATOMIC_SIZE_SUB(var, val) InterlockedExchangeAdd64((LONG_LONG *)&(var), -(LONG)(val))
# define ATOMIC_SIZE_INC(var) InterlockedIncrement64(&(var))
# define ATOMIC_SIZE_DEC(var) InterlockedDecrement64(&(var))
# define ATOMIC_SIZE_EXCHANGE(var, val) InterlockedExchange64(&(var), (val))
# else
# define ATOMIC_SIZE_ADD(var, val) InterlockedExchangeAdd((LONG *)&(var), (val))
# define ATOMIC_SIZE_SUB(var, val) InterlockedExchangeAdd((LONG *)&(var), -(val))
# define ATOMIC_SIZE_SUB(var, val) InterlockedExchangeAdd((LONG *)&(var), -(LONG)(val))
# define ATOMIC_SIZE_INC(var) InterlockedIncrement((LONG *)&(var))
# define ATOMIC_SIZE_DEC(var) InterlockedDecrement((LONG *)&(var))
# define ATOMIC_SIZE_EXCHANGE(var, val) InterlockedExchange((LONG *)&(var), (val))