Skip to content

Commit 7aaf0d9

Browse files
author
masa
committed
change in internal structure of Ruby 1.9 Range object.
git-svn-id: svn+ssh://ion/home/svn/ruby/narray05/trunk@74 09a2cad2-7366-4d26-ab3d-61f00787735e
1 parent c952bc9 commit 7aaf0d9

4 files changed

Lines changed: 19 additions & 8 deletions

File tree

ChangeLog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1+
2008-01-28 Masahiro TANAKA <masa16.tanaka at gmail.com>
2+
3+
* na_array.c (na_range_to_sequence, na_do_mdai):
4+
* na_index.c (na_index_range):
5+
change in internal structure of Ruby 1.9 Range object.
6+
Thanks to Hargobind Khalsa.
7+
8+
* ver 0.5.9p4
9+
110
2007-12-27 Masahiro TANAKA <masa16.tanaka at gmail.com>
211

312
* narray_local.h, narray.c, na_array.c:
413
use RSTRING_PTR, RSTRING_LEN for Ruby 1.9.0.
514

15+
* ver 0.5.9p3
16+
617
2007-12-11 Masahiro TANAKA <masah16.tanaka at gmail.com>
718

819
* mkop.rb:

na_array.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ static void
122122
{
123123
int end,len;
124124

125-
*beg = NUM2INT(rb_ivar_get(obj, na_id_beg));
126-
end = NUM2INT(rb_ivar_get(obj, na_id_end));
125+
*beg = NUM2INT(rb_funcall(obj, na_id_beg, 0));
126+
end = NUM2INT(rb_funcall(obj, na_id_end, 0));
127127
len = end - *beg;
128128

129129
/* direction */
@@ -179,8 +179,8 @@ static int
179179
if ( rb_obj_is_kind_of(v, rb_cRange) ) {
180180
na_range_to_sequence(v,&length,&start,&dir);
181181
len += length-1;
182-
mdai->type[ na_object_type(rb_ivar_get(v, na_id_beg)) ] = 1;
183-
mdai->type[ na_object_type(rb_ivar_get(v, na_id_end)) ] = 1;
182+
mdai->type[ na_object_type(rb_funcall(v, na_id_beg, 0)) ] = 1;
183+
mdai->type[ na_object_type(rb_funcall(v, na_id_end, 0)) ] = 1;
184184
}
185185
else {
186186

na_index.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ static int
2323
sl->idx = NULL;
2424

2525
/* Beginning */
26-
vbeg = rb_ivar_get(obj, na_id_beg);
26+
vbeg = rb_funcall(obj, na_id_beg, 0);
2727
if (vbeg==Qnil) /* First is nil */
2828
beg = 0;
2929
else
3030
beg = NUM2INT(vbeg);
3131
if (beg<0) beg += size;
3232

3333
/* End */
34-
vend = rb_ivar_get(obj, na_id_end);
34+
vend = rb_funcall(obj, na_id_end, 0);
3535
if (vend==Qnil) { /* Last is nil */
3636
sl->beg = beg;
3737
sl->step = 1;

narray.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
# include <sys/types.h>
2020
#endif
2121

22-
#define NARRAY_VERSION "0.5.9p3"
23-
#define NARRAY_VERSION_CODE 593
22+
#define NARRAY_VERSION "0.5.9p4"
23+
#define NARRAY_VERSION_CODE 594
2424

2525
/*
2626
Data types used in NArray :

0 commit comments

Comments
 (0)