summaryrefslogtreecommitdiff
path: root/ext/tk/tcltklib.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-05 01:09:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-05 01:09:17 +0000
commit57e2877e7b8257665f07f63aa37ed09f8fe78310 (patch)
tree1f9d2f407d43672c5a2fa4aaeaa8cfd1255b2f32 /ext/tk/tcltklib.c
parenta015a01354d7f185eb794e3280c4168c2cb38100 (diff)
ext: use RARRAY_AREF
* ext/**/*.c: prefer RARRAY_AREF to indexing RARRAY_CONST_PTR. pointed out by hanmac. https://github.com/ruby/ruby/commit/3553a86#commitcomment-14187670 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/tcltklib.c')
-rw-r--r--ext/tk/tcltklib.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c
index fed21d3709..c99bcb5e3d 100644
--- a/ext/tk/tcltklib.c
+++ b/ext/tk/tcltklib.c
@@ -1892,15 +1892,15 @@ set_max_block_time(self, time)
case T_BIGNUM:
/* time is micro-second value */
divmod = rb_funcall(time, rb_intern("divmod"), 1, LONG2NUM(1000000));
- tcl_time.sec = NUM2LONG(RARRAY_CONST_PTR(divmod)[0]);
- tcl_time.usec = NUM2LONG(RARRAY_CONST_PTR(divmod)[1]);
+ tcl_time.sec = NUM2LONG(RARRAY_AREF(divmod, 0));
+ tcl_time.usec = NUM2LONG(RARRAY_AREF(divmod, 1));
break;
case T_FLOAT:
/* time is second value */
divmod = rb_funcall(time, rb_intern("divmod"), 1, INT2FIX(1));
- tcl_time.sec = NUM2LONG(RARRAY_CONST_PTR(divmod)[0]);
- tcl_time.usec = (long)(NUM2DBL(RARRAY_CONST_PTR(divmod)[1]) * 1000000);
+ tcl_time.sec = NUM2LONG(RARRAY_AREF(divmod, 0));
+ tcl_time.usec = (long)(NUM2DBL(RARRAY_AREF(divmod, 1)) * 1000000);
default:
{
@@ -7213,7 +7213,7 @@ tk_funcall(func, argc, argv, obj)
DUMP2("back from handler (current thread:%"PRIxVALUE")", current);
/* get result & free allocated memory */
- ret = RARRAY_CONST_PTR(result)[0];
+ ret = RARRAY_AREF(result, 0);
#if 0 /* use Tcl_EventuallyFree */
Tcl_EventuallyFree((ClientData)alloc_done, TCL_DYNAMIC); /* XXXXXXXX */
#else
@@ -7697,7 +7697,7 @@ ip_eval(self, str)
DUMP2("back from handler (current thread:%"PRIxVALUE")", current);
/* get result & free allocated memory */
- ret = RARRAY_CONST_PTR(result)[0];
+ ret = RARRAY_AREF(result, 0);
#if 0 /* use Tcl_EventuallyFree */
Tcl_EventuallyFree((ClientData)alloc_done, TCL_DYNAMIC); /* XXXXXXXX */
@@ -9196,7 +9196,7 @@ ip_invoke_with_position(argc, argv, obj, position)
DUMP2("back from handler (current thread:%"PRIxVALUE")", current);
/* get result & free allocated memory */
- ret = RARRAY_CONST_PTR(result)[0];
+ ret = RARRAY_AREF(result, 0);
#if 0 /* use Tcl_EventuallyFree */
Tcl_EventuallyFree((ClientData)alloc_done, TCL_DYNAMIC); /* XXXXXXXX */
#else