diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-10-04 09:40:08 -0700 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2023-10-04 10:25:46 -0700 |
commit | 7db6f448ed9ba6a5c27a750416cb6877711a7c05 (patch) | |
tree | 7bb908aa76768ef892324d572b18ac20eefb1f63 | |
parent | 577ff858bce3c9620c763d6481b082253f7e2bfd (diff) | |
download | ruby-7db6f448ed9ba6a5c27a750416cb6877711a7c05.tar.gz |
Use a better variable name for w
-rw-r--r-- | ruby.c | 4 | ||||
-rw-r--r-- | yjit.h | 2 | ||||
-rw-r--r-- | yjit/src/options.rs | 9 |
3 files changed, 8 insertions, 7 deletions
@@ -296,12 +296,12 @@ show_usage_line(const struct ruby_opt_message *m, void ruby_show_usage_line(const char *name, const char *secondary, const char *description, - int help, int highlight, unsigned int w, int columns) + int help, int highlight, unsigned int width, int columns) { unsigned int namelen = (unsigned int)strlen(name); unsigned int secondlen = (secondary ? (unsigned int)strlen(secondary) : 0); show_usage_part(name, namelen, secondary, secondlen, - description, help, highlight, w, columns); + description, help, highlight, width, columns); } static void @@ -43,7 +43,7 @@ void rb_yjit_iseq_free(void *payload); void rb_yjit_before_ractor_spawn(void); void rb_yjit_constant_ic_update(const rb_iseq_t *const iseq, IC ic, unsigned insn_idx); void rb_yjit_tracing_invalidate_all(void); -void rb_yjit_show_usage(int help, int highlight, unsigned int w, int columns); +void rb_yjit_show_usage(int help, int highlight, unsigned int width, int columns); #else // !USE_YJIT diff --git a/yjit/src/options.rs b/yjit/src/options.rs index f25e7f3618..e8d08aae50 100644 --- a/yjit/src/options.rs +++ b/yjit/src/options.rs @@ -244,16 +244,17 @@ pub fn parse_option(str_ptr: *const std::os::raw::c_char) -> Option<()> { return Some(()); } -/// Print YJIT options for `ruby --help`. +/// Print YJIT options for `ruby --help`. `width` is width of option parts, and +/// `columns` is indent width of descriptions. #[no_mangle] -pub extern "C" fn rb_yjit_show_usage(help: c_int, highlight: c_int, w: c_uint, columns: c_int) { +pub extern "C" fn rb_yjit_show_usage(help: c_int, highlight: c_int, width: c_uint, columns: c_int) { for &(name, description) in YJIT_OPTIONS.iter() { extern "C" { fn ruby_show_usage_line(name: *const c_char, secondary: *const c_char, description: *const c_char, - help: c_int, highlight: c_int, w: c_uint, columns: c_int); + help: c_int, highlight: c_int, width: c_uint, columns: c_int); } let name = CString::new(name).unwrap(); let description = CString::new(description).unwrap(); - unsafe { ruby_show_usage_line(name.as_ptr(), null(), description.as_ptr(), help, highlight, w, columns) } + unsafe { ruby_show_usage_line(name.as_ptr(), null(), description.as_ptr(), help, highlight, width, columns) } } } |