summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-24 03:13:52 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-24 03:13:52 +0000
commitdef62c3267e64128cc4f5aab187dad75bd7b2c39 (patch)
treeab329cb3d63f047119505f92fcc8bb97c9c58988 /include
parenta137f4ed3a23c5e96ca09d7c8cf5108573a81233 (diff)
* include/ruby/ruby.h (RARRAY_ASET): try to avoid compiler warning.
[Bug #9287] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/ruby.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index cad402a..6c6cee2 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -900,8 +900,10 @@ struct RArray {
#define RARRAY_AREF(a, i) (RARRAY_CONST_PTR(a)[i])
#define RARRAY_ASET(a, i, v) do { \
- const VALUE _ary_ = (a); \
- RB_OBJ_WRITE(_ary_, &RARRAY_CONST_PTR(_ary_)[i], (v)); \
+ const VALUE _ary = (a); \
+ VALUE *ptr = (VALUE *)RARRAY_PTR_USE_START(_ary); \
+ RB_OBJ_WRITE(_ary, &ptr[i], (v)); \
+ RARRAY_PTR_USE_END(_ary); \
} while (0)
#define RARRAY_PTR(a) ((VALUE *)RARRAY_CONST_PTR(RGENGC_WB_PROTECTED_ARRAY ? OBJ_WB_UNPROTECT((VALUE)a) : ((VALUE)a)))