summaryrefslogtreecommitdiff
path: root/ruby_atomic.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-18 14:23:50 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-18 14:23:50 (GMT)
commit9f9b47671052072a305275b99d7e132cf17fbc79 (patch)
treeee1b3394e622156690cc70f0ac0c66bb1f69d03c /ruby_atomic.h
parent0712483fdd73746c69118c7d069040d3df880b29 (diff)
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
Diffstat (limited to 'ruby_atomic.h')
-rw-r--r--ruby_atomic.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/ruby_atomic.h b/ruby_atomic.h
index 9bf5e03..1079fb1 100644
--- a/ruby_atomic.h
+++ b/ruby_atomic.h
@@ -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))