summaryrefslogtreecommitdiff
path: root/ext/dl/dl.c
diff options
context:
space:
mode:
authorttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-04 08:27:48 +0000
committerttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-04 08:27:48 +0000
commit1502ea7c0c91d1384caeefee46b61f8e2fd1567f (patch)
tree4495286806b9985027b917cba43087c4f31c44d9 /ext/dl/dl.c
parentb5856f738a1dc9e89f9cbc492192c8668780e1c3 (diff)
Patch [ruby-dev:16747] (Thanks Nakada)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/dl.c')
-rw-r--r--ext/dl/dl.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/dl/dl.c b/ext/dl/dl.c
index f9b5a145cb..0eda4926d7 100644
--- a/ext/dl/dl.c
+++ b/ext/dl/dl.c
@@ -323,7 +323,7 @@ c_parray(VALUE v, long *size)
case T_STRING:
{
char *str, *src;
- src = StringValuePtr(e);
+ src = RSTRING(e)->ptr;
str = dlstrdup(src);
ary[i] = (void*)str;
};
@@ -472,7 +472,7 @@ rb_dl_strdup(VALUE self, VALUE str)
void *p;
str = rb_String(str);
- return rb_dlptr_new(strdup(StringValuePtr(str)), RSTRING(str)->len, dlfree);
+ return rb_dlptr_new(strdup(RSTRING(str)->ptr), RSTRING(str)->len, dlfree);
}
static VALUE
@@ -482,7 +482,7 @@ rb_dl_sizeof(VALUE self, VALUE str)
}
static VALUE
-rb_dl_callback_type(VALUE str)
+rb_dl_callback_type(VALUE *str)
{
char *type;
int len;
@@ -490,8 +490,8 @@ rb_dl_callback_type(VALUE str)
long ftype;
ftype = 0;
- type = StringValuePtr(str);
- len = RSTRING(str)->len;
+ type = StringValuePtr(*str);
+ len = RSTRING(*str)->len;
if( len - 1 > MAX_CBARG ){
rb_raise(rb_eDLError, "maximum number of the argument is %d.", MAX_CBARG);
@@ -567,7 +567,7 @@ rb_dl_set_callback(int argc, VALUE argv[], VALUE self)
rb_bug("rb_dl_set_callback");
};
- key = rb_dl_callback_type(types);
+ key = rb_dl_callback_type(&types);
entry = rb_hash_aref(DLFuncTable, key);
if( entry == Qnil ){
entry = rb_hash_new();
@@ -578,7 +578,7 @@ rb_dl_set_callback(int argc, VALUE argv[], VALUE self)
if( func ){
rb_hash_aset(entry, num, proc);
snprintf(func_name, 1023, "rb_dl_func%d_%d", NUM2INT(key), NUM2INT(num));
- return rb_dlsym_new(func, func_name, StringValuePtr(types));
+ return rb_dlsym_new(func, func_name, RSTRING(types)->ptr);
}
else{
return Qnil;
@@ -591,7 +591,7 @@ rb_dl_get_callback(VALUE self, VALUE types, VALUE num)
VALUE key;
VALUE entry;
- key = rb_dl_callback_type(types);
+ key = rb_dl_callback_type(&types);
entry = rb_hash_aref(DLFuncTable, key);
if( entry == Qnil ){
return Qnil;