[前][次][番号順一覧][スレッド一覧]

ruby-changes:31527

From: nobu <ko1@a...>
Date: Sat, 9 Nov 2013 15:16:52 +0900 (JST)
Subject: [ruby-changes:31527] nobu:r43606 (trunk): objspace_dump.c: suppress warnings

nobu	2013-11-09 15:16:48 +0900 (Sat, 09 Nov 2013)

  New Revision: 43606

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43606

  Log:
    objspace_dump.c: suppress warnings
    
    * ext/objspace/objspace_dump.c (dump_object): remove unused variables,
      and cast size_t to long.

  Modified files:
    trunk/ext/objspace/objspace_dump.c
Index: ext/objspace/objspace_dump.c
===================================================================
--- ext/objspace/objspace_dump.c	(revision 43605)
+++ ext/objspace/objspace_dump.c	(revision 43606)
@@ -156,8 +156,6 @@ reachable_object_i(VALUE ref, void *data https://github.com/ruby/ruby/blob/trunk/ext/objspace/objspace_dump.c#L156
 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_confi https://github.com/ruby/ruby/blob/trunk/ext/objspace/objspace_dump.c#L190
 	    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)) {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]