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

ruby-changes:31260

From: nobu <ko1@a...>
Date: Thu, 17 Oct 2013 21:49:21 +0900 (JST)
Subject: [ruby-changes:31260] nobu:r43339 (trunk): bug_reporter.c: suppress warnings

nobu	2013-10-17 21:49:16 +0900 (Thu, 17 Oct 2013)

  New Revision: 43339

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

  Log:
    bug_reporter.c: suppress warnings
    
    * ext/-test-/bug_reporter/bug_reporter.c (sample_bug_reporter): cast
      via uintptr_t to suppress warning cast between pointer and different
      size integer by gcc 4.8.
    
    * ext/-test-/bug_reporter/bug_reporter.c (register_sample_bug_reporter):
      ditto.

  Modified files:
    trunk/ext/-test-/bug_reporter/bug_reporter.c
Index: ext/-test-/bug_reporter/bug_reporter.c
===================================================================
--- ext/-test-/bug_reporter/bug_reporter.c	(revision 43338)
+++ ext/-test-/bug_reporter/bug_reporter.c	(revision 43339)
@@ -6,14 +6,14 @@ int rb_bug_reporter_add(void (*func)(FIL https://github.com/ruby/ruby/blob/trunk/ext/-test-/bug_reporter/bug_reporter.c#L6
 static void
 sample_bug_reporter(FILE *out, void *ptr)
 {
-    int n = (int)ptr;
+    int n = (int)(uintptr_t)ptr;
     fprintf(out, "Sample bug reporter: %d\n", n);
 }
 
 static VALUE
 register_sample_bug_reporter(VALUE self, VALUE obj)
 {
-    rb_bug_reporter_add(sample_bug_reporter, (void *)NUM2INT(obj));
+    rb_bug_reporter_add(sample_bug_reporter, (void *)(uintptr_t)NUM2INT(obj));
     return Qnil;
 }
 

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

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