From 75ebf3910794079ca1ade31ac4a79e58f0827e03 Mon Sep 17 00:00:00 2001 From: ttate Date: Fri, 19 Apr 2002 04:05:54 +0000 Subject: [PATCH] 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 --- ChangeLog | 4 ++++ ext/dl/ptr.c | 39 --------------------------------------- 2 files changed, 4 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5d9c00b7017a6b..66ac553536aace 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Apr 18 17:01:43 2002 Takaaki Tateishi + + * ext/dl/ptr.c (rb_dlptr_cast): removed. + Thu Apr 18 17:01:43 2002 Tanaka Akira * re.c (rb_reg_to_s): new function for Regexp#to_s. diff --git a/ext/dl/ptr.c b/ext/dl/ptr.c index 7a62c0d410bd39..7024e29740d574 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);