mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
ext: use rb_sprintf() and rb_vsprintf() with PRIsVALUE
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5f11c41042
commit
74947c9d1e
3 changed files with 16 additions and 43 deletions
|
@ -523,18 +523,11 @@ ossl_engine_get_cmds(VALUE self)
|
|||
static VALUE
|
||||
ossl_engine_inspect(VALUE self)
|
||||
{
|
||||
VALUE str;
|
||||
const char *cname = rb_class2name(rb_obj_class(self));
|
||||
ENGINE *e;
|
||||
|
||||
str = rb_str_new2("#<");
|
||||
rb_str_cat2(str, cname);
|
||||
rb_str_cat2(str, " id=\"");
|
||||
rb_str_append(str, ossl_engine_get_id(self));
|
||||
rb_str_cat2(str, "\" name=\"");
|
||||
rb_str_append(str, ossl_engine_get_name(self));
|
||||
rb_str_cat2(str, "\">");
|
||||
|
||||
return str;
|
||||
GetEngine(self, e);
|
||||
return rb_sprintf("#<%"PRIsVALUE" id=\"%s\" name=\"%s\">",
|
||||
rb_obj_class(self), ENGINE_get_id(e), ENGINE_get_name(e));
|
||||
}
|
||||
|
||||
#define DefEngineConst(x) rb_define_const(cEngine, #x, INT2NUM(ENGINE_##x))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue