summaryrefslogtreecommitdiff
path: root/ext/objspace/objspace_dump.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-09 06:16:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-09 06:16:48 +0000
commita50bbcfecb852fea2f90b5c97ce80653ab5c0010 (patch)
tree07a994859ce9ff2f260ea4bbb3d6513e270756a8 /ext/objspace/objspace_dump.c
parentb60079fe953cd1347cb15ae1f781f6f0b6aec54a (diff)
objspace_dump.c: suppress warnings
* ext/objspace/objspace_dump.c (dump_object): remove unused variables, and cast size_t to long. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/objspace/objspace_dump.c')
-rw-r--r--ext/objspace/objspace_dump.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/ext/objspace/objspace_dump.c b/ext/objspace/objspace_dump.c
index 60a76db884..e3124b0af5 100644
--- a/ext/objspace/objspace_dump.c
+++ b/ext/objspace/objspace_dump.c
@@ -156,8 +156,6 @@ reachable_object_i(VALUE ref, void *data)
static void
dump_object(VALUE obj, struct dump_config *dc)
{
- int enc;
- long length;
size_t memsize;
struct allocation_info *ainfo;
rb_io_t *fptr;
@@ -192,7 +190,7 @@ dump_object(VALUE obj, struct dump_config *dc)
dump_append(dc, ", \"shared\":true");
else {
dump_append(dc, ", \"bytesize\":%ld", RSTRING_LEN(obj));
- if (!STR_EMBED_P(obj) && !STR_NOCAPA_P(obj) && rb_str_capacity(obj) != RSTRING_LEN(obj))
+ if (!STR_EMBED_P(obj) && !STR_NOCAPA_P(obj) && (long)rb_str_capacity(obj) != RSTRING_LEN(obj))
dump_append(dc, ", \"capacity\":%ld", rb_str_capacity(obj));
if (is_ascii_string(obj)) {