Skip to content

Commit

Permalink
delete $ sign from C identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
shyouhei committed Aug 27, 2019
1 parent 19b6678 commit 1663d34
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions load.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions process.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions re.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 1663d34

Please sign in to comment.