summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-16 05:52:19 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-16 05:52:19 +0000
commit360b78e4dccf19971d7dc46a31fc55a2759e8762 (patch)
treeb8e8211e3bf129703e54a384ccd4b40e0fd5e06d /error.c
parent15abb96177f389efb5edbae1bf5fc7e39787610c (diff)
`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
Diffstat (limited to 'error.c')
-rw-r--r--error.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/error.c b/error.c
index 420539e4a4..eff64848cb 100644
--- a/error.c
+++ b/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);