summaryrefslogtreecommitdiff
path: root/ext/date
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-04 07:18:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-04 07:18:01 +0000
commit52912db4a81f9b9b69ab9e9fcd95e22d086d4289 (patch)
tree664a5b8fb85a73fa2083e49bf8c4982e93586969 /ext/date
parentc8803b10d18fa4d28c7eba47c232004149779b26 (diff)
ext: adjust index type
* ext: use long for index instead of int and RARRAY_LENINT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/date')
-rw-r--r--ext/date/date_core.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/ext/date/date_core.c b/ext/date/date_core.c
index 8010348..1b87b09 100644
--- a/ext/date/date_core.c
+++ b/ext/date/date_core.c
@@ -3723,7 +3723,8 @@ static VALUE
rt_complete_frags(VALUE klass, VALUE hash)
{
static VALUE tab = Qnil;
- int g, e;
+ int g;
+ long e;
VALUE k, a, d;
if (NIL_P(tab)) {
@@ -3820,18 +3821,18 @@ rt_complete_frags(VALUE klass, VALUE hash)
}
{
- int i, eno = 0, idx = 0;
+ long i, eno = 0, idx = 0;
- for (i = 0; i < RARRAY_LENINT(tab); i++) {
+ for (i = 0; i < RARRAY_LEN(tab); i++) {
VALUE x, a;
x = RARRAY_PTR(tab)[i];
a = RARRAY_PTR(x)[1];
{
- int j, n = 0;
+ long j, n = 0;
- for (j = 0; j < RARRAY_LENINT(a); j++)
+ for (j = 0; j < RARRAY_LEN(a); j++)
if (!NIL_P(ref_hash0(RARRAY_PTR(a)[j])))
n++;
if (n > eno) {
@@ -3852,7 +3853,7 @@ rt_complete_frags(VALUE klass, VALUE hash)
d = Qnil;
- if (g && !NIL_P(k) && (RARRAY_LENINT(a) - e)) {
+ if (g && !NIL_P(k) && (RARRAY_LEN(a) - e)) {
if (k == sym("ordinal")) {
if (NIL_P(ref_hash("year"))) {
if (NIL_P(d))
@@ -3863,9 +3864,9 @@ rt_complete_frags(VALUE klass, VALUE hash)
set_hash("yday", INT2FIX(1));
}
else if (k == sym("civil")) {
- int i;
+ long i;
- for (i = 0; i < RARRAY_LENINT(a); i++) {
+ for (i = 0; i < RARRAY_LEN(a); i++) {
VALUE e = RARRAY_PTR(a)[i];
if (!NIL_P(ref_hash0(e)))
@@ -3880,9 +3881,9 @@ rt_complete_frags(VALUE klass, VALUE hash)
set_hash("mday", INT2FIX(1));
}
else if (k == sym("commercial")) {
- int i;
+ long i;
- for (i = 0; i < RARRAY_LENINT(a); i++) {
+ for (i = 0; i < RARRAY_LEN(a); i++) {
VALUE e = RARRAY_PTR(a)[i];
if (!NIL_P(ref_hash0(e)))
@@ -3904,9 +3905,9 @@ rt_complete_frags(VALUE klass, VALUE hash)
ref_hash("wday"))));
}
else if (k == sym("wnum0")) {
- int i;
+ long i;
- for (i = 0; i < RARRAY_LENINT(a); i++) {
+ for (i = 0; i < RARRAY_LEN(a); i++) {
VALUE e = RARRAY_PTR(a)[i];
if (!NIL_P(ref_hash0(e)))
@@ -3921,9 +3922,9 @@ rt_complete_frags(VALUE klass, VALUE hash)
set_hash("wday", INT2FIX(0));
}
else if (k == sym("wnum1")) {
- int i;
+ long i;
- for (i = 0; i < RARRAY_LENINT(a); i++) {
+ for (i = 0; i < RARRAY_LEN(a); i++) {
VALUE e = RARRAY_PTR(a)[i];
if (!NIL_P(ref_hash0(e)))