From 048d2e6d32315e13962a01e8df6459487c57b98c Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 16 Jul 2010 07:40:37 +0000 Subject: * ext/dbm/dbm.c (struct dbmdata, fdbm_key, fdbm_delete_if): fixed type warnings. * time.c (calc_tm_yday): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/dbm/dbm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ext/dbm') diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c index 893146d582..765154c78f 100644 --- a/ext/dbm/dbm.c +++ b/ext/dbm/dbm.c @@ -26,7 +26,7 @@ static VALUE rb_cDBM, rb_eDBMError; #define RUBY_DBM_RW_BIT 0x20000000 struct dbmdata { - int di_size; + long di_size; DBM *di_dbm; }; @@ -212,7 +212,7 @@ fdbm_key(VALUE obj, VALUE valstr) GetDBM2(obj, dbmp, dbm); for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) { val = dbm_fetch(dbm, key); - if (val.dsize == RSTRING_LEN(valstr) && + if ((long)val.dsize == RSTRING_LEN(valstr) && memcmp(val.dptr, RSTRING_PTR(valstr), val.dsize) == 0) { return rb_tainted_str_new(key.dptr, key.dsize); } @@ -335,7 +335,8 @@ fdbm_delete_if(VALUE obj) DBM *dbm; VALUE keystr, valstr; VALUE ret, ary = rb_ary_new(); - int i, status = 0, n; + int i, status = 0; + long n; fdbm_modify(obj); GetDBM2(obj, dbmp, dbm); -- cgit v1.2.1