1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/dl/cfunc.c (rb_dlcfunc_inspect): suppress warnings by

rb_sprintf.

* ext/dl/cptr.c (rb_dlptr_s_malloc): suppress warnings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-06-03 10:33:57 +00:00
parent 7336f32c3b
commit 8984ef4705
3 changed files with 9 additions and 12 deletions

View file

@ -1,3 +1,10 @@
Thu Jun 3 19:33:51 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/dl/cfunc.c (rb_dlcfunc_inspect): suppress warnings by
rb_sprintf.
* ext/dl/cptr.c (rb_dlptr_s_malloc): suppress warnings.
Thu Jun 3 18:58:28 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* load.c (ruby_init_ext): statically linked extensions have no

View file

@ -284,25 +284,15 @@ rb_dlcfunc_set_ptr(VALUE self, VALUE addr)
static VALUE
rb_dlcfunc_inspect(VALUE self)
{
VALUE val;
char *str;
int str_size;
struct cfunc_data *cfunc;
TypedData_Get_Struct(self, struct cfunc_data, &dlcfunc_data_type, cfunc);
str_size = (cfunc->name ? strlen(cfunc->name) : 0) + 100;
str = ruby_xmalloc(str_size);
snprintf(str, str_size - 1,
"#<DL::CFunc:%p ptr=%p type=%d name='%s'>",
return rb_sprintf("#<DL::CFunc:%p ptr=%p type=%d name='%s'>",
cfunc,
cfunc->ptr,
cfunc->type,
cfunc->name ? cfunc->name : "");
val = rb_tainted_str_new2(str);
ruby_xfree(str);
return val;
}

View file

@ -186,7 +186,7 @@ static VALUE
rb_dlptr_s_malloc(int argc, VALUE argv[], VALUE klass)
{
VALUE size, sym, obj;
int s;
long s;
freefunc_t f;
switch (rb_scan_args(argc, argv, "11", &size, &sym)) {