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

ruby-changes:59213

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Thu, 12 Dec 2019 14:23:36 +0900 (JST)
Subject: [ruby-changes:59213] 35eb12c063 (master): add casts

https://git.ruby-lang.org/ruby.git/commit/?id=35eb12c063

From 35eb12c06397e770392a41343cbffc4b204e15c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
 <shyouhei@r...>
Date: Thu, 12 Dec 2019 12:39:24 +0900
Subject: add casts

%p is for void *.  Becuase fprintf is a function with variadic arguments
automatic cast from any pointer to void * does not work.  We have to be
explicit.

diff --git a/compile.c b/compile.c
index e46035a..d8fff33 100644
--- a/compile.c
+++ b/compile.c
@@ -11268,7 +11268,7 @@ ibf_load_object(const struct ibf_load *load, VALUE object_index) https://github.com/ruby/ruby/blob/trunk/compile.c#L11268
 
 #if IBF_ISEQ_DEBUG
             fprintf(stderr, "ibf_load_object: list=%#x offsets=%p offset=%#x\n",
-                    load->current_buffer->obj_list_offset, offsets, offset);
+                    load->current_buffer->obj_list_offset, (void *)offsets, offset);
             fprintf(stderr, "ibf_load_object: type=%#x special=%d frozen=%d internal=%d\n",
                     header.type, header.special_const, header.frozen, header.internal);
 #endif
@@ -11458,7 +11458,7 @@ ibf_load_iseq(const struct ibf_load *load, const rb_iseq_t *index_iseq) https://github.com/ruby/ruby/blob/trunk/compile.c#L11458
 
 #if IBF_ISEQ_DEBUG
     fprintf(stderr, "ibf_load_iseq: index_iseq=%p iseq_list=%p\n",
-	    index_iseq, (void *)load->iseq_list);
+	    (void *)index_iseq, (void *)load->iseq_list);
 #endif
     if (iseq_index == -1) {
 	return NULL;
@@ -11475,27 +11475,27 @@ ibf_load_iseq(const struct ibf_load *load, const rb_iseq_t *index_iseq) https://github.com/ruby/ruby/blob/trunk/compile.c#L11475
 	else {
 	    rb_iseq_t *iseq = iseq_imemo_alloc();
 #if IBF_ISEQ_DEBUG
-	    fprintf(stderr, "ibf_load_iseq: new iseq=%p\n", iseq);
+	    fprintf(stderr, "ibf_load_iseq: new iseq=%p\n", (void *)iseq);
 #endif
 	    FL_SET(iseq, ISEQ_NOT_LOADED_YET);
 	    iseq->aux.loader.obj = load->loader_obj;
 	    iseq->aux.loader.index = iseq_index;
 #if IBF_ISEQ_DEBUG
 	    fprintf(stderr, "ibf_load_iseq: iseq=%p loader_obj=%p index=%d\n",
-		    iseq, (void *)load->loader_obj, iseq_index);
+		    (void *)iseq, (void *)load->loader_obj, iseq_index);
 #endif
 	    rb_ary_store(load->iseq_list, iseq_index, (VALUE)iseq);
 
 #if !USE_LAZY_LOAD
 #if IBF_ISEQ_DEBUG
-	    fprintf(stderr, "ibf_load_iseq: loading iseq=%p\n", iseq);
+	    fprintf(stderr, "ibf_load_iseq: loading iseq=%p\n", (void *)iseq);
 #endif
 	    rb_ibf_load_iseq_complete(iseq);
 #endif /* !USE_LAZY_LOAD */
 
 #if IBF_ISEQ_DEBUG
 	    fprintf(stderr, "ibf_load_iseq: iseq=%p loaded %p\n",
-		    iseq, load->iseq);
+		    (void *)iseq, (void *)load->iseq);
 #endif
 	    return iseq;
 	}
-- 
cgit v0.10.2


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

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