summaryrefslogtreecommitdiff
path: root/ext/dl/dl.c
diff options
context:
space:
mode:
authorttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-11 14:44:53 +0000
committerttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-11 14:44:53 +0000
commit5434d73ef7fada1c75499f18a7b7b0ca5c79a39b (patch)
tree1606e5b4cce23b294c984705c2c5c92c5e4513f3 /ext/dl/dl.c
parent176542da7f415dd4709ea3b1c38f39e3f58ba567 (diff)
Get rid of STR2CSTR. (Thanks N.Nakada)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/dl.c')
-rw-r--r--ext/dl/dl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/dl/dl.c b/ext/dl/dl.c
index 47cc864a7cb..6b7f01b3ff6 100644
--- a/ext/dl/dl.c
+++ b/ext/dl/dl.c
@@ -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