From 85ce703fabc94df19aedf130baad81cb4870fa88 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 20 Dec 2002 11:30:13 +0000 Subject: [PATCH] ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 12 ++++++------ ext/dbm/dbm.c | 8 +++----- ext/sdbm/init.c | 8 +++----- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d5cf4e9ce..d42301d8f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,10 @@ -Fri Dec 20 20:19:49 2002 Nobuyoshi Nakada +Fri Dec 20 20:29:04 2002 Nobuyoshi Nakada - * ext/curses/curses.c, ext/digest/digest.c, ext/dl/handle.c, - ext/dl/ptr.c, ext/dl/sym.c, ext/gdbm/gdbm.c, ext/iconv/iconv.c, - ext/stringio/stringio.c, ext/strscan/strscan.c, - ext/tcltklib/tcltklib.c, ext/win32ole/win32ole.c: - use rb_define_alloc_func(). + * ext/curses/curses.c, ext/dbm/dbm.c, ext/digest/digest.c, + ext/dl/handle.c, ext/dl/ptr.c, ext/dl/sym.c, ext/gdbm/gdbm.c, + ext/iconv/iconv.c, ext/sdbm/init.c, ext/stringio/stringio.c, + ext/strscan/strscan.c, ext/tcltklib/tcltklib.c, + ext/win32ole/win32ole.c: use rb_define_alloc_func(). Fri Dec 20 18:29:04 2002 Nobuyoshi Nakada diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c index 88c4233cae..c3102de9dc 100644 --- a/ext/dbm/dbm.c +++ b/ext/dbm/dbm.c @@ -65,14 +65,12 @@ fdbm_close(obj) } static VALUE -fdbm_s_new(argc, argv, klass) +fdbm_alloc(argc, argv, klass) int argc; VALUE *argv; VALUE klass; { - VALUE obj = Data_Wrap_Struct(klass, 0, free_dbm, 0); - rb_obj_call_init(obj, argc, argv); - return obj; + return Data_Wrap_Struct(klass, 0, free_dbm, 0); } static VALUE @@ -720,7 +718,7 @@ Init_dbm() rb_eDBMError = rb_define_class("DBMError", rb_eStandardError); rb_include_module(rb_cDBM, rb_mEnumerable); - rb_define_singleton_method(rb_cDBM, "new", fdbm_s_new, -1); + rb_define_alloc_func(rb_cDBM, fdbm_alloc); rb_define_singleton_method(rb_cDBM, "open", fdbm_s_open, -1); rb_define_method(rb_cDBM, "initialize", fdbm_initialize, -1); diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c index 99945d3a7d..81dc59a080 100644 --- a/ext/sdbm/init.c +++ b/ext/sdbm/init.c @@ -57,14 +57,12 @@ fsdbm_close(obj) } static VALUE -fsdbm_s_new(argc, argv, klass) +fsdbm_alloc(argc, argv, klass) int argc; VALUE *argv; VALUE klass; { - VALUE obj = Data_Wrap_Struct(klass, 0, free_sdbm, 0); - rb_obj_call_init(obj, argc, argv); - return obj; + return Data_Wrap_Struct(klass, 0, free_sdbm, 0); } static VALUE @@ -719,7 +717,7 @@ Init_sdbm() rb_eDBMError = rb_define_class("SDBMError", rb_eStandardError); rb_include_module(rb_cDBM, rb_mEnumerable); - rb_define_singleton_method(rb_cDBM, "new", fsdbm_s_new, -1); + rb_define_alloc_func(rb_cDBM, fsdbm_alloc); rb_define_singleton_method(rb_cDBM, "open", fsdbm_s_open, -1); rb_define_method(rb_cDBM, "initialize", fsdbm_initialize, -1);