summaryrefslogtreecommitdiff
path: root/ext/dbm
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-21 21:23:42 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-21 21:23:42 +0000
commit78df33a0c14bc330f983f4a27c334c2cfbec9c2e (patch)
tree3d8c5afb19e6def1f1ea5e52b4a668ad53cd8c37 /ext/dbm
parent80b64d145a30613a7d357f9f942e5846c064ea0e (diff)
* enc/utf_16le.c: surpress warning: shorten-64-to-32.
* ext/dbm/dbm.c: ditto. * ext/gdbm/gdbm.c: ditto. * parse.y (Init_ripper): surpress warning: unused value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dbm')
-rw-r--r--ext/dbm/dbm.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c
index 43f52cc..6d53960 100644
--- a/ext/dbm/dbm.c
+++ b/ext/dbm/dbm.c
@@ -200,7 +200,7 @@ fdbm_fetch(VALUE obj, VALUE keystr, VALUE ifnone)
ExportStringValue(keystr);
key.dptr = RSTRING_PTR(keystr);
- key.dsize = RSTRING_LEN(keystr);
+ key.dsize = (int)RSTRING_LEN(keystr);
GetDBM2(obj, dbmp, dbm);
value = dbm_fetch(dbm, key);
@@ -261,12 +261,12 @@ fdbm_key(VALUE obj, VALUE valstr)
ExportStringValue(valstr);
val.dptr = RSTRING_PTR(valstr);
- val.dsize = RSTRING_LEN(valstr);
+ val.dsize = (int)RSTRING_LEN(valstr);
GetDBM2(obj, dbmp, dbm);
for (key = dbm_firstkey(dbm); key.dptr; key = dbm_nextkey(dbm)) {
val = dbm_fetch(dbm, key);
- if ((long)val.dsize == RSTRING_LEN(valstr) &&
+ if ((long)val.dsize == (int)RSTRING_LEN(valstr) &&
memcmp(val.dptr, RSTRING_PTR(valstr), val.dsize) == 0) {
return rb_tainted_str_new(key.dptr, key.dsize);
}
@@ -356,7 +356,7 @@ fdbm_delete(VALUE obj, VALUE keystr)
fdbm_modify(obj);
ExportStringValue(keystr);
key.dptr = RSTRING_PTR(keystr);
- key.dsize = RSTRING_LEN(keystr);
+ key.dsize = (int)RSTRING_LEN(keystr);
GetDBM2(obj, dbmp, dbm);
@@ -447,7 +447,7 @@ fdbm_delete_if(VALUE obj)
keystr = RARRAY_PTR(ary)[i];
ExportStringValue(keystr);
key.dptr = RSTRING_PTR(keystr);
- key.dsize = RSTRING_LEN(keystr);
+ key.dsize = (int)RSTRING_LEN(keystr);
if (dbm_delete(dbm, key)) {
rb_raise(rb_eDBMError, "dbm_delete failed");
}
@@ -574,10 +574,10 @@ fdbm_store(VALUE obj, VALUE keystr, VALUE valstr)
valstr = rb_obj_as_string(valstr);
key.dptr = RSTRING_PTR(keystr);
- key.dsize = RSTRING_LEN(keystr);
+ key.dsize = (int)RSTRING_LEN(keystr);
val.dptr = RSTRING_PTR(valstr);
- val.dsize = RSTRING_LEN(valstr);
+ val.dsize = (int)RSTRING_LEN(valstr);
GetDBM2(obj, dbmp, dbm);
dbmp->di_size = -1;
@@ -640,7 +640,7 @@ fdbm_empty_p(VALUE obj)
}
}
else {
- i = dbmp->di_size;
+ i = (int)dbmp->di_size;
}
if (i == 0) return Qtrue;
return Qfalse;
@@ -786,7 +786,7 @@ fdbm_has_key(VALUE obj, VALUE keystr)
ExportStringValue(keystr);
key.dptr = RSTRING_PTR(keystr);
- key.dsize = RSTRING_LEN(keystr);
+ key.dsize = (int)RSTRING_LEN(keystr);
GetDBM2(obj, dbmp, dbm);
val = dbm_fetch(dbm, key);
@@ -810,12 +810,12 @@ fdbm_has_value(VALUE obj, VALUE valstr)
ExportStringValue(valstr);
val.dptr = RSTRING_PTR(valstr);
- val.dsize = RSTRING_LEN(valstr);
+ val.dsize = (int)RSTRING_LEN(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 (val.dsize == (int)RSTRING_LEN(valstr) &&
memcmp(val.dptr, RSTRING_PTR(valstr), val.dsize) == 0)
return Qtrue;
}