delete `$` sign from C identifiers

They lack portability. See also
https://travis-ci.org/shyouhei/ruby/jobs/577164015
This commit is contained in:
卜部昌平 2019-08-27 14:21:18 +09:00
Родитель 19b6678132
Коммит 1663d347c9
4 изменённых файлов: 12 добавлений и 12 удалений

6
io.c
Просмотреть файл

@ -12987,13 +12987,13 @@ rb_readwrite_syserr_fail(enum rb_io_wait_readwrite writable, int n, const char *
}
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)
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);

6
load.c
Просмотреть файл

@ -156,7 +156,7 @@ get_loaded_features(void)
}
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)
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();

Просмотреть файл

@ -8039,13 +8039,13 @@ rb_clock_getres(int argc, VALUE *argv)
}
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)
{
#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);

4
re.c
Просмотреть файл

@ -3955,7 +3955,7 @@ match_getter(void)
}
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)
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);