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

ruby-changes:57317

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Tue, 27 Aug 2019 16:48:39 +0900 (JST)
Subject: [ruby-changes:57317] 卜部昌平: 1663d347c9 (master): delete `$` sign from C identifiers

https://git.ruby-lang.org/ruby.git/commit/?id=1663d347c9

From 1663d347c993debf7ed83e11e291e7a21e14ed03 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: Tue, 27 Aug 2019 14:21:18 +0900
Subject: delete `$` sign from C identifiers

They lack portability. See also
https://travis-ci.org/shyouhei/ruby/jobs/577164015

diff --git a/io.c b/io.c
index 2f9df89..e0b81fc 100644
--- a/io.c
+++ b/io.c
@@ -12987,13 +12987,13 @@ rb_readwrite_syserr_fail(enum rb_io_wait_readwrite writable, int n, const char * https://github.com/ruby/ruby/blob/trunk/io.c#L12987
 }
 
 static VALUE
-get_$LAST_READ_LINE(ID _x, VALUE *_y)
+get_LAST_READ_LINE(ID _x, VALUE *_y)
 {
     return rb_lastline_get();
 }
 
 static void
-set_$LAST_READ_LINE(VALUE val, ID _x, VALUE *_y)
+set_LAST_READ_LINE(VALUE val, ID _x, VALUE *_y)
 {
     rb_lastline_set(val);
 }
@@ -13271,7 +13271,7 @@ Init_IO(void) https://github.com/ruby/ruby/blob/trunk/io.c#L13271
     rb_define_hooked_variable("$-0", &rb_rs, 0, rb_str_setter);
     rb_define_hooked_variable("$\\", &rb_output_rs, 0, rb_str_setter);
 
-    rb_define_virtual_variable("$_", get_$LAST_READ_LINE, set_$LAST_READ_LINE);
+    rb_define_virtual_variable("$_", get_LAST_READ_LINE, set_LAST_READ_LINE);
 
     rb_define_method(rb_cIO, "initialize_copy", rb_io_init_copy, 1);
     rb_define_method(rb_cIO, "reopen", rb_io_reopen, -1);
diff --git a/load.c b/load.c
index 3a21f5c..571995d 100644
--- a/load.c
+++ b/load.c
@@ -156,7 +156,7 @@ get_loaded_features(void) https://github.com/ruby/ruby/blob/trunk/load.c#L156
 }
 
 static VALUE
-get_$LOADED_FEATURES(ID _x, VALUE *_y)
+get_LOADED_FEATURES(ID _x, VALUE *_y)
 {
     return get_loaded_features();
 }
@@ -1265,8 +1265,8 @@ Init_load(void) https://github.com/ruby/ruby/blob/trunk/load.c#L1265
     vm->load_path_check_cache = 0;
     rb_define_singleton_method(vm->load_path, "resolve_feature_path", rb_resolve_feature_path, 1);
 
-    rb_define_virtual_variable("$\"", get_$LOADED_FEATURES, 0);
-    rb_define_virtual_variable("$LOADED_FEATURES", get_$LOADED_FEATURES, 0);
+    rb_define_virtual_variable("$\"", get_LOADED_FEATURES, 0);
+    rb_define_virtual_variable("$LOADED_FEATURES", get_LOADED_FEATURES, 0);
     vm->loaded_features = rb_ary_new();
     vm->loaded_features_snapshot = rb_ary_tmp_new(0);
     vm->loaded_features_index = st_init_numtable();
diff --git a/process.c b/process.c
index dad0907..a21b171 100644
--- a/process.c
+++ b/process.c
@@ -8039,13 +8039,13 @@ rb_clock_getres(int argc, VALUE *argv) https://github.com/ruby/ruby/blob/trunk/process.c#L8039
 }
 
 static VALUE
-get_$CHILD_STATUS(ID _x, VALUE *_y)
+get_CHILD_STATUS(ID _x, VALUE *_y)
 {
     return rb_last_status_get();
 }
 
 static VALUE
-get_$PROCESS_ID(ID _x, VALUE *_y)
+get_PROCESS_ID(ID _x, VALUE *_y)
 {
     return get_pid();
 }
@@ -8066,8 +8066,8 @@ InitVM_process(void) https://github.com/ruby/ruby/blob/trunk/process.c#L8066
 {
 #undef rb_intern
 #define rb_intern(str) rb_intern_const(str)
-    rb_define_virtual_variable("$?", get_$CHILD_STATUS, 0);
-    rb_define_virtual_variable("$$", get_$PROCESS_ID, 0);
+    rb_define_virtual_variable("$?", get_CHILD_STATUS, 0);
+    rb_define_virtual_variable("$$", get_PROCESS_ID, 0);
     rb_define_global_function("exec", rb_f_exec, -1);
     rb_define_global_function("fork", rb_f_fork, 0);
     rb_define_global_function("exit!", rb_f_exit_bang, -1);
diff --git a/re.c b/re.c
index f4aad1e..d5f9a87 100644
--- a/re.c
+++ b/re.c
@@ -3955,7 +3955,7 @@ match_getter(void) https://github.com/ruby/ruby/blob/trunk/re.c#L3955
 }
 
 static VALUE
-get_$LAST_MATCH_INFO(ID _x, VALUE *_y)
+get_LAST_MATCH_INFO(ID _x, VALUE *_y)
 {
     return match_getter();
 }
@@ -4048,7 +4048,7 @@ Init_Regexp(void) https://github.com/ruby/ruby/blob/trunk/re.c#L4048
     onig_set_warn_func(re_warn);
     onig_set_verb_warn_func(re_warn);
 
-    rb_define_virtual_variable("$~", get_$LAST_MATCH_INFO, match_setter);
+    rb_define_virtual_variable("$~", get_LAST_MATCH_INFO, match_setter);
     rb_define_virtual_variable("$&", last_match_getter, 0);
     rb_define_virtual_variable("$`", prematch_getter, 0);
     rb_define_virtual_variable("$'", postmatch_getter, 0);
-- 
cgit v0.10.2


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

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