summaryrefslogtreecommitdiff
path: root/ext/dbm
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-16 07:40:37 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-16 07:40:37 +0000
commit048d2e6d32315e13962a01e8df6459487c57b98c (patch)
tree4daf00295376b02a5547e17c82274390d29d9936 /ext/dbm
parent96863dc358cc86435099627a7afc1ec58a1fd79c (diff)
* 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
Diffstat (limited to 'ext/dbm')
-rw-r--r--ext/dbm/dbm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c
index 893146d..765154c 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);