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

ruby-changes:56495

From: Takashi <ko1@a...>
Date: Sun, 14 Jul 2019 22:13:21 +0900 (JST)
Subject: [ruby-changes:56495] Takashi Kokubun: 7ac7685fa7 (master): Simplify link_o_to_so arguments

https://git.ruby-lang.org/ruby.git/commit/?id=7ac7685fa7

From 7ac7685fa7a266e74102ac8ed067035ebfebe6e6 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Sun, 14 Jul 2019 22:12:33 +0900
Subject: Simplify link_o_to_so arguments

by C99 compound literal for array and non-constant array initializer

diff --git a/mjit_worker.c b/mjit_worker.c
index 44123e2..c5df0b7 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -1079,9 +1079,7 @@ convert_unit_to_func(struct rb_mjit_unit *unit) https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L1079
 #else
     // splitting .c -> .o step and .o -> .so step, to cache .o files in the future
     if ((success = compile_c_to_o(c_file, o_file)) != false) {
-        const char *o_files[2] = { NULL, NULL };
-        o_files[0] = o_file;
-        success = link_o_to_so(o_files, so_file);
+        success = link_o_to_so((const char *[]){ o_file, NULL }, so_file);
 
         // Always set o_file for compaction. The value is also used for lazy deletion.
         unit->o_file = strdup(o_file);
-- 
cgit v0.10.2


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

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