mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/syslog/syslog.c (mSyslog_open): Use of Check_SafeStr() is
deprecated. (mSyslogConstants_LOG_MASK, mSyslogConstants_LOG_UPTO): Use NUM2INT() instead of FIX2INT() when the type of an given object is not determined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6885f3b708
commit
d04cc54add
2 changed files with 10 additions and 6 deletions
|
@ -67,11 +67,7 @@ static VALUE mSyslog_open(int argc, VALUE *argv, VALUE self)
|
|||
if (NIL_P(ident)) {
|
||||
ident = rb_gv_get("$0");
|
||||
}
|
||||
#ifdef SafeStringValue
|
||||
SafeStringValue(ident);
|
||||
#else
|
||||
Check_SafeStr(ident);
|
||||
#endif
|
||||
syslog_ident = strdup(RSTRING_PTR(ident));
|
||||
|
||||
if (NIL_P(opt)) {
|
||||
|
@ -224,12 +220,12 @@ define_syslog_shortcut_method(LOG_DEBUG, debug)
|
|||
|
||||
static VALUE mSyslogConstants_LOG_MASK(VALUE klass, VALUE pri)
|
||||
{
|
||||
return INT2FIX(LOG_MASK(FIX2INT(pri)));
|
||||
return INT2FIX(LOG_MASK(NUM2INT(pri)));
|
||||
}
|
||||
|
||||
static VALUE mSyslogConstants_LOG_UPTO(VALUE klass, VALUE pri)
|
||||
{
|
||||
return INT2FIX(LOG_UPTO(FIX2INT(pri)));
|
||||
return INT2FIX(LOG_UPTO(NUM2INT(pri)));
|
||||
}
|
||||
|
||||
/* Init for package syslog */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue