зеркало из https://github.com/github/ruby.git
`rb_source_loc` -> `rb_source_location_cstr`
* vm.c (rb_source_loc): rename to rb_source_location_cstr() to make behavior clear compare with rb_source_location(). * error.c (warning_string): use rb_source_location_cstr() directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
15abb96177
Коммит
360b78e4dc
10
error.c
10
error.c
|
@ -229,11 +229,9 @@ static VALUE
|
|||
warning_string(rb_encoding *enc, const char *fmt, va_list args)
|
||||
{
|
||||
int line;
|
||||
VALUE file = rb_source_location(&line);
|
||||
|
||||
const char *file = rb_source_location_cstr(&line);
|
||||
return warn_vsprintf(enc,
|
||||
NIL_P(file) ? NULL : RSTRING_PTR(file), line,
|
||||
fmt, args);
|
||||
RSTRING_PTR(file), line, fmt, args);
|
||||
}
|
||||
|
||||
#define with_warning_string(mesg, enc, fmt) \
|
||||
|
@ -533,7 +531,7 @@ rb_bug(const char *fmt, ...)
|
|||
int line = 0;
|
||||
|
||||
if (GET_EC()) {
|
||||
file = rb_source_loc(&line);
|
||||
file = rb_source_location_cstr(&line);
|
||||
}
|
||||
|
||||
report_bug(file, line, fmt, NULL);
|
||||
|
@ -548,7 +546,7 @@ rb_bug_context(const void *ctx, const char *fmt, ...)
|
|||
int line = 0;
|
||||
|
||||
if (GET_EC()) {
|
||||
file = rb_source_loc(&line);
|
||||
file = rb_source_location_cstr(&line);
|
||||
}
|
||||
|
||||
report_bug(file, line, fmt, ctx);
|
||||
|
|
2
eval.c
2
eval.c
|
@ -504,7 +504,7 @@ setup_exception(rb_execution_context_t *ec, int tag, volatile VALUE mesg, VALUE
|
|||
const char *file = 0;
|
||||
int line;
|
||||
|
||||
file = rb_source_loc(&line);
|
||||
file = rb_source_location_cstr(&line);
|
||||
if ((file && !NIL_P(mesg)) || (cause != Qundef)) {
|
||||
volatile int state = 0;
|
||||
|
||||
|
|
2
gc.c
2
gc.c
|
@ -1874,7 +1874,7 @@ newobj_init(VALUE klass, VALUE flags, VALUE v1, VALUE v2, VALUE v3, int wb_prote
|
|||
#endif
|
||||
|
||||
#if GC_DEBUG
|
||||
RANY(obj)->file = rb_source_loc(&RANY(obj)->line);
|
||||
RANY(obj)->file = rb_source_location_cstr(&RANY(obj)->line);
|
||||
GC_ASSERT(!SPECIAL_CONST_P(obj)); /* check alignment */
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1767,7 +1767,7 @@ void rb_vm_change_state(void);
|
|||
void rb_vm_inc_const_missing_count(void);
|
||||
const void **rb_vm_get_insns_address_table(void);
|
||||
VALUE rb_source_location(int *pline);
|
||||
const char *rb_source_loc(int *pline);
|
||||
const char *rb_source_location_cstr(int *pline);
|
||||
void rb_vm_pop_cfunc_frame(void);
|
||||
int rb_vm_add_root_module(ID id, VALUE module);
|
||||
void rb_vm_check_redefinition_by_prepend(VALUE klass);
|
||||
|
@ -1944,7 +1944,7 @@ RUBY_SYMBOL_EXPORT_END
|
|||
do { \
|
||||
if (UNLIKELY(RUBY_DTRACE_##name##_ENABLED())) { \
|
||||
int dtrace_line; \
|
||||
const char *dtrace_file = rb_source_loc(&dtrace_line); \
|
||||
const char *dtrace_file = rb_source_location_cstr(&dtrace_line); \
|
||||
if (!dtrace_file) dtrace_file = ""; \
|
||||
RUBY_DTRACE_##name(arg, dtrace_file, dtrace_line); \
|
||||
} \
|
||||
|
|
4
vm.c
4
vm.c
|
@ -356,7 +356,7 @@ rb_dtrace_setup(rb_execution_context_t *ec, VALUE klass, ID id,
|
|||
VALUE name = rb_class_path_no_cache(klass);
|
||||
const char *classname, *filename;
|
||||
const char *methodname = rb_id2name(id);
|
||||
if (methodname && (filename = rb_source_loc(&args->line_no)) != 0) {
|
||||
if (methodname && (filename = rb_source_location_cstr(&args->line_no)) != 0) {
|
||||
if (NIL_P(name) || !(classname = StringValuePtr(name)))
|
||||
classname = "<unknown>";
|
||||
args->classname = classname;
|
||||
|
@ -1298,7 +1298,7 @@ rb_source_location(int *pline)
|
|||
}
|
||||
|
||||
const char *
|
||||
rb_source_loc(int *pline)
|
||||
rb_source_location_cstr(int *pline)
|
||||
{
|
||||
VALUE path = rb_source_location(pline);
|
||||
if (NIL_P(path)) return NULL;
|
||||
|
|
Загрузка…
Ссылка в новой задаче