aboutsummaryrefslogtreecommitdiffstats
path: root/ext
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
parentc8803b10d18fa4d28c7eba47c232004149779b26 (diff)
downloadruby-52912db4a81f9b9b69ab9e9fcd95e22d086d4289.tar.gz
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')
-rw-r--r--ext/date/date_core.c29
-rw-r--r--ext/dbm/dbm.c4
-rw-r--r--ext/fiddle/function.c2
-rw-r--r--ext/gdbm/gdbm.c3
-rw-r--r--ext/openssl/ossl_ocsp.c4
-rw-r--r--ext/openssl/ossl_ssl.c3
-rw-r--r--ext/openssl/ossl_x509cert.c2
-rw-r--r--ext/openssl/ossl_x509crl.c4
-rw-r--r--ext/openssl/ossl_x509req.c2
-rw-r--r--ext/openssl/ossl_x509revoked.c2
-rw-r--r--ext/psych/psych_emitter.c2
-rw-r--r--ext/sdbm/init.c3
12 files changed, 32 insertions, 28 deletions
diff --git a/ext/date/date_core.c b/ext/date/date_core.c
index 8010348201..1b87b09c55 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)))
diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c
index ff3859df30..d2904f5bbe 100644
--- a/ext/dbm/dbm.c
+++ b/ext/dbm/dbm.c
@@ -508,8 +508,8 @@ fdbm_delete_if(VALUE obj)
DBM *dbm;
VALUE keystr, valstr;
VALUE ret, ary = rb_ary_tmp_new(0);
- int i, status = 0;
- long n;
+ int status = 0;
+ long i, n;
fdbm_modify(obj);
GetDBM2(obj, dbmp, dbm);
diff --git a/ext/fiddle/function.c b/ext/fiddle/function.c
index 50a2d24232..4c19821bfa 100644
--- a/ext/fiddle/function.c
+++ b/ext/fiddle/function.c
@@ -90,7 +90,7 @@ initialize(int argc, VALUE argv[], VALUE self)
ffi_type **arg_types;
ffi_status result;
VALUE ptr, args, ret_type, abi, kwds;
- int i;
+ long i;
rb_scan_args(argc, argv, "31:", &ptr, &args, &ret_type, &abi, &kwds);
if(NIL_P(abi)) abi = INT2NUM(FFI_DEFAULT_ABI);
diff --git a/ext/gdbm/gdbm.c b/ext/gdbm/gdbm.c
index eb802a7563..143b4e8ebb 100644
--- a/ext/gdbm/gdbm.c
+++ b/ext/gdbm/gdbm.c
@@ -614,7 +614,8 @@ fgdbm_delete_if(VALUE obj)
GDBM_FILE dbm;
VALUE keystr, valstr;
VALUE ret, ary = rb_ary_tmp_new(0);
- int i, status = 0, n;
+ long i;
+ int status = 0, n;
rb_gdbm_modify(obj);
GetDBM2(obj, dbmp, dbm);
diff --git a/ext/openssl/ossl_ocsp.c b/ext/openssl/ossl_ocsp.c
index af32d99e01..00078e62df 100644
--- a/ext/openssl/ossl_ocsp.c
+++ b/ext/openssl/ossl_ocsp.c
@@ -671,9 +671,9 @@ ossl_ocspbres_add_status(VALUE self, VALUE cid, VALUE status,
OCSP_BASICRESP *bs;
OCSP_SINGLERESP *single;
OCSP_CERTID *id;
- int st, rsn;
ASN1_TIME *ths, *nxt, *rev;
- int error, i, rstatus = 0;
+ int st, rsn, error, rstatus = 0;
+ long i;
VALUE tmp;
st = NUM2INT(status);
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index f1d5e61b1e..a57cc06c46 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -701,7 +701,8 @@ ossl_sslctx_setup(VALUE self)
X509_STORE *store;
EVP_PKEY *key = NULL;
char *ca_path = NULL, *ca_file = NULL;
- int i, verify_mode;
+ int verify_mode;
+ long i;
VALUE val;
if(OBJ_FROZEN(self)) return Qnil;
diff --git a/ext/openssl/ossl_x509cert.c b/ext/openssl/ossl_x509cert.c
index b1d57bf380..80a8f9527a 100644
--- a/ext/openssl/ossl_x509cert.c
+++ b/ext/openssl/ossl_x509cert.c
@@ -663,7 +663,7 @@ ossl_x509_set_extensions(VALUE self, VALUE ary)
{
X509 *x509;
X509_EXTENSION *ext;
- int i;
+ long i;
Check_Type(ary, T_ARRAY);
/* All ary's members should be X509Extension */
diff --git a/ext/openssl/ossl_x509crl.c b/ext/openssl/ossl_x509crl.c
index 7293fce5a6..63c63aca24 100644
--- a/ext/openssl/ossl_x509crl.c
+++ b/ext/openssl/ossl_x509crl.c
@@ -302,7 +302,7 @@ ossl_x509crl_set_revoked(VALUE self, VALUE ary)
{
X509_CRL *crl;
X509_REVOKED *rev;
- int i;
+ long i;
Check_Type(ary, T_ARRAY);
/* All ary members should be X509 Revoked */
@@ -476,7 +476,7 @@ ossl_x509crl_set_extensions(VALUE self, VALUE ary)
{
X509_CRL *crl;
X509_EXTENSION *ext;
- int i;
+ long i;
Check_Type(ary, T_ARRAY);
/* All ary members should be X509 Extensions */
diff --git a/ext/openssl/ossl_x509req.c b/ext/openssl/ossl_x509req.c
index 05d7ef9971..159c98efb0 100644
--- a/ext/openssl/ossl_x509req.c
+++ b/ext/openssl/ossl_x509req.c
@@ -418,7 +418,7 @@ ossl_x509req_set_attributes(VALUE self, VALUE ary)
{
X509_REQ *req;
X509_ATTRIBUTE *attr;
- int i;
+ long i;
VALUE item;
Check_Type(ary, T_ARRAY);
diff --git a/ext/openssl/ossl_x509revoked.c b/ext/openssl/ossl_x509revoked.c
index 0a949e7688..54c002ca06 100644
--- a/ext/openssl/ossl_x509revoked.c
+++ b/ext/openssl/ossl_x509revoked.c
@@ -188,7 +188,7 @@ ossl_x509revoked_set_extensions(VALUE self, VALUE ary)
{
X509_REVOKED *rev;
X509_EXTENSION *ext;
- int i;
+ long i;
VALUE item;
Check_Type(ary, T_ARRAY);
diff --git a/ext/psych/psych_emitter.c b/ext/psych/psych_emitter.c
index f77d8d7d86..ce6f63d16b 100644
--- a/ext/psych/psych_emitter.c
+++ b/ext/psych/psych_emitter.c
@@ -159,7 +159,7 @@ static VALUE start_document(VALUE self, VALUE version, VALUE tags, VALUE imp)
}
if(RTEST(tags)) {
- int i = 0;
+ long i = 0;
#ifdef HAVE_RUBY_ENCODING_H
rb_encoding * encoding = rb_utf8_encoding();
#endif
diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c
index 901824c2a7..b0bb8880a8 100644
--- a/ext/sdbm/init.c
+++ b/ext/sdbm/init.c
@@ -512,7 +512,8 @@ fsdbm_delete_if(VALUE obj)
DBM *dbm;
VALUE keystr, valstr;
VALUE ret, ary = rb_ary_new();
- int i, status = 0, n;
+ long i;
+ int status = 0, n;
fdbm_modify(obj);
GetDBM2(obj, dbmp, dbm);