diff options
author | ttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-04-19 04:05:54 +0000 |
---|---|---|
committer | ttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-04-19 04:05:54 +0000 |
commit | 75ebf3910794079ca1ade31ac4a79e58f0827e03 (patch) | |
tree | d03acc64be1fe80fe8fb7daf50a7b60eff05d507 /ext/dl | |
parent | 9021157411ab02797f75f204e3a9324c506eb046 (diff) | |
download | ruby-75ebf3910794079ca1ade31ac4a79e58f0827e03.tar.gz |
ext/dl/ptr.c: remove rb_dlptr_cast().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl')
-rw-r--r-- | ext/dl/ptr.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/ext/dl/ptr.c b/ext/dl/ptr.c index 7a62c0d410..7024e29740 100644 --- a/ext/dl/ptr.c +++ b/ext/dl/ptr.c @@ -208,44 +208,6 @@ rb_dlptr_init(int argc, VALUE argv[], VALUE self) return Qnil; } -static VALUE -rb_dlptr_cast(int argc, VALUE argv[], VALUE self) -{ - VALUE klass, rest, val, *pass_argv; - int pass_argc, i; - struct ptr_data *data; - - Data_Get_Struct(self, struct ptr_data, data); - rb_scan_args(argc, argv, "1*", &klass, &rest); - - /* prepare the arguments of `new' method */ - pass_argc = argc + 1; - pass_argv = ALLOCA_N(VALUE, pass_argc); - pass_argv[0] = DLLONG2NUM(data->ptr); - pass_argv[1] = rb_dlsym_new(data->free, NULL, NULL); - for( i=2; i < pass_argc; i++ ){ - pass_argv[i] = rb_ary_entry(rest,i-2); - }; - - /* remove the data */ - ((struct ptr_data *)(RDATA(self)->data))->ptr = 0; - (RDATA(self)->dfree)(RDATA(self)->data); - - /* call the `new' method of klass with prepared arguments */ - val = rb_funcall2(klass, rb_intern("new"), pass_argc, pass_argv); - - RDATA(self)->basic.klass = RDATA(val)->basic.klass; - RDATA(self)->basic.flags = RDATA(val)->basic.flags; - RDATA(self)->dmark = RDATA(val)->dmark; - RDATA(self)->dfree = RDATA(val)->dfree; - RDATA(self)->data = RDATA(val)->data; - - RDATA(val)->dmark = 0; - RDATA(val)->dfree = 0; - - return Qnil; -} - VALUE rb_dlptr_to_i(VALUE self) { @@ -1050,7 +1012,6 @@ Init_dlptr() rb_define_method(rb_cDLPtrData, "eql?", rb_dlptr_eql, 1); rb_define_method(rb_cDLPtrData, "+", rb_dlptr_plus, 1); rb_define_method(rb_cDLPtrData, "-", rb_dlptr_minus, 1); - rb_define_method(rb_cDLPtrData, "cast!", rb_dlptr_cast, -1); rb_define_method(rb_cDLPtrData, "define_data_type", rb_dlptr_define_data_type, -1); rb_define_method(rb_cDLPtrData, "struct!", rb_dlptr_define_struct, -1); |