mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* atomic.h(ATOMIC_SET): add cast to void to prevent misuse.
[ruby-dev:44596] [Bug #5439] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
09d18bec58
commit
123645aab6
2 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
Thu Oct 13 18:13:04 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* atomic.h(ATOMIC_SET): add cast to void to prevent misuse.
|
||||
[ruby-dev:44596] [Bug #5439]
|
||||
|
||||
Thu Oct 13 18:04:27 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* gc.c (rb_gc_finalize_deferred, rb_objspace_call_finalizer):
|
||||
|
|
4
atomic.h
4
atomic.h
|
@ -36,7 +36,7 @@ rb_w32_atomic_or(volatile rb_atomic_t *var, rb_atomic_t val)
|
|||
* http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html */
|
||||
|
||||
typedef unsigned int rb_atomic_t; /* Anything OK */
|
||||
# define ATOMIC_SET(var, val) __sync_lock_test_and_set(&(var), (val))
|
||||
# define ATOMIC_SET(var, val) (void)__sync_lock_test_and_set(&(var), (val))
|
||||
# define ATOMIC_INC(var) __sync_fetch_and_add(&(var), 1)
|
||||
# define ATOMIC_DEC(var) __sync_fetch_and_sub(&(var), 1)
|
||||
# define ATOMIC_OR(var, val) __sync_or_and_fetch(&(var), (val))
|
||||
|
@ -46,7 +46,7 @@ typedef unsigned int rb_atomic_t; /* Anything OK */
|
|||
typedef int rb_atomic_t;
|
||||
extern rb_atomic_t ruby_atomic_exchange(rb_atomic_t *ptr, rb_atomic_t val);
|
||||
|
||||
# define ATOMIC_SET(var, val) ((var) = (val))
|
||||
# define ATOMIC_SET(var, val) (void)((var) = (val))
|
||||
# define ATOMIC_INC(var) (++(var))
|
||||
# define ATOMIC_DEC(var) (--(var))
|
||||
# define ATOMIC_OR(var, val) ((var) |= (val))
|
||||
|
|
Loading…
Reference in a new issue