summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 80103482010..1b87b09c558 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 ff3859df302..d2904f5bbeb 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 50a2d24232b..4c19821bfac 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 eb802a75634..143b4e8ebbb 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 af32d99e018..00078e62dfb 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 f1d5e61b1e6..a57cc06c467 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 b1d57bf3801..80a8f9527ae 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 7293fce5a65..63c63aca242 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 05d7ef99714..159c98efb0f 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 0a949e76882..54c002ca066 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 f77d8d7d861..ce6f63d16b7 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 901824c2a7e..b0bb8880a80 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);