[前][次][番号順一覧][スレッド一覧]

ruby-changes:31277

From: nobu <ko1@a...>
Date: Fri, 18 Oct 2013 23:23:53 +0900 (JST)
Subject: [ruby-changes:31277] nobu:r43356 (trunk): ruby_atomic.h: suppress a warning

nobu	2013-10-18 23:23:50 +0900 (Fri, 18 Oct 2013)

  New Revision: 43356

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43356

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

  Modified files:
    trunk/ruby_atomic.h
Index: ruby_atomic.h
===================================================================
--- ruby_atomic.h	(revision 43355)
+++ ruby_atomic.h	(revision 43356)
@@ -60,14 +60,14 @@ rb_w32_atomic_cas(volatile rb_atomic_t * https://github.com/ruby/ruby/blob/trunk/ruby_atomic.h#L60
 #   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))

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]