Get rid of STR2CSTR. (Thanks N.Nakada)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ttate 2002-06-11 14:44:53 +00:00
Родитель 176542da7f
Коммит 5434d73ef7
3 изменённых файлов: 7 добавлений и 5 удалений

Просмотреть файл

@ -5,7 +5,7 @@ LDSHARED_TEST = $(LDSHARED) $(LDFLAGS) test/test.o -o test/libtest.so $(LOCAL_LI
libtest.so: test/libtest.so
test/libtest.so: test/test.o test/libtest.def
test/libtest.so: test/test.o $(srcdir)/test/libtest.def
$(RUBY) -rftools -e 'ARGV.each do|d|File.mkpath(File.dirname(d))end' $@
$(LDSHARED_TEST:dl.def=test/libtest.def)

Просмотреть файл

@ -582,7 +582,7 @@ rb_dl_callback(int argc, VALUE argv[], VALUE self)
}
Check_Type(type, T_STRING);
switch( STR2CSTR(type)[0] ){
switch( RSTRING(type)->ptr[0] ){
case '0':
rettype = 0x00;
break;
@ -608,7 +608,7 @@ rb_dl_callback(int argc, VALUE argv[], VALUE self)
rettype = 0x07;
break;
default:
rb_raise(rb_eDLTypeError, "unsupported type `%c'", STR2CSTR(type)[0]);
rb_raise(rb_eDLTypeError, "unsupported type `%c'", RSTRING(type)->ptr[0]);
}
entry = -1;
@ -626,7 +626,8 @@ rb_dl_callback(int argc, VALUE argv[], VALUE self)
rb_assoc_new(INT2NUM(rettype),INT2NUM(entry)),
rb_assoc_new(type,proc));
sprintf(fname, "rb_dl_callback_func_%d_%d", rettype, entry);
return rb_dlsym_new((void (*)())rb_dl_callback_table[rettype][entry], fname, STR2CSTR(type));
return rb_dlsym_new((void (*)())rb_dl_callback_table[rettype][entry],
fname, RSTRING(type)->ptr);
}
static VALUE

Просмотреть файл

@ -33,7 +33,8 @@ def mkfunc(rettype, fnum, argc)
" obj = rb_hash_aref(DLFuncTable, rb_assoc_new(INT2NUM(#{rettype.to_s}),INT2NUM(#{fnum.to_s})));",
" proto = rb_ary_entry(obj, 0);",
" proc = rb_ary_entry(obj, 1);",
" rb_dl_scan_callback_args(buff, STR2CSTR(proto), &argc, argv);",
" Check_Type(proto, T_STRING);",
" rb_dl_scan_callback_args(buff, RSTRING(proto)->ptr, &argc, argv);",
" retval = rb_funcall2(proc, id_call, argc, argv);",
"",
ret_code,