Skip to content

Commit

Permalink
* ext/curses/curses.c, ext/digest/digest.c, ext/dl/handle.c,
Browse files Browse the repository at this point in the history
  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().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Dec 20, 2002
1 parent 5b615c7 commit 3780ede
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 15 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Fri Dec 20 20:19:49 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>

* 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().

Fri Dec 20 18:29:04 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>

* io.c (rb_io_fwrite): separated from io_write().
Expand Down
2 changes: 1 addition & 1 deletion ext/curses/curses.c
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ Init_curses()
#endif /* USE_MOUSE */

cWindow = rb_define_class_under(mCurses, "Window", rb_cData);
rb_define_singleton_method(cWindow, "allocate", window_s_allocate, 0);
rb_define_alloc_func(cWindow, window_s_allocate);
rb_define_method(cWindow, "initialize", window_initialize, 4);
rb_define_method(cWindow, "subwin", window_subwin, 4);
rb_define_method(cWindow, "close", window_close, 0);
Expand Down
2 changes: 1 addition & 1 deletion ext/digest/digest.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ Init_digest()

cDigest_Base = rb_define_class_under(mDigest, "Base", rb_cObject);

rb_define_singleton_method(cDigest_Base, "allocate", rb_digest_base_alloc, 0);
rb_define_alloc_func(cDigest_Base, rb_digest_base_alloc);
rb_define_singleton_method(cDigest_Base, "digest", rb_digest_base_s_digest, 1);
rb_define_singleton_method(cDigest_Base, "hexdigest", rb_digest_base_s_hexdigest, 1);

Expand Down
2 changes: 1 addition & 1 deletion ext/dl/handle.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ void
Init_dlhandle()
{
rb_cDLHandle = rb_define_class_under(rb_mDL, "Handle", rb_cObject);
rb_define_singleton_method(rb_cDLHandle, "allocate", rb_dlhandle_s_allocate, 0);
rb_define_alloc_func(rb_cDLHandle, rb_dlhandle_s_allocate);
rb_define_method(rb_cDLHandle, "initialize", rb_dlhandle_initialize, -1);
rb_define_method(rb_cDLHandle, "to_i", rb_dlhandle_to_i, 0);
rb_define_method(rb_cDLHandle, "to_ptr", rb_dlhandle_to_ptr, 0);
Expand Down
2 changes: 1 addition & 1 deletion ext/dl/ptr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ void
Init_dlptr()
{
rb_cDLPtrData = rb_define_class_under(rb_mDL, "PtrData", rb_cObject);
rb_define_singleton_method(rb_cDLPtrData, "allocate", rb_dlptr_s_allocate, 0);
rb_define_alloc_func(rb_cDLPtrData, rb_dlptr_s_allocate);
rb_define_singleton_method(rb_cDLPtrData, "malloc", rb_dlptr_s_malloc, -1);
rb_define_method(rb_cDLPtrData, "initialize", rb_dlptr_initialize, -1);
rb_define_method(rb_cDLPtrData, "free=", rb_dlptr_free_set, 1);
Expand Down
2 changes: 1 addition & 1 deletion ext/dl/sym.c
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ void
Init_dlsym()
{
rb_cDLSymbol = rb_define_class_under(rb_mDL, "Symbol", rb_cObject);
rb_define_singleton_method(rb_cDLSymbol, "allocate", rb_dlsym_s_allocate, 0);
rb_define_alloc_func(rb_cDLSymbol, rb_dlsym_s_allocate);
rb_define_singleton_method(rb_cDLSymbol, "char2type", rb_s_dlsym_char2type, 1);
rb_define_method(rb_cDLSymbol, "initialize", rb_dlsym_initialize, -1);
rb_define_method(rb_cDLSymbol, "call", rb_dlsym_call, -1);
Expand Down
2 changes: 1 addition & 1 deletion ext/gdbm/gdbm.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ Init_gdbm()
rb_eGDBMFatalError = rb_define_class("GDBMFatalError", rb_eException);
rb_include_module(rb_cGDBM, rb_mEnumerable);

rb_define_singleton_method(rb_cGDBM, "allocate", fgdbm_s_alloc, 0);
rb_define_alloc_func(rb_cGDBM, fgdbm_s_alloc);
rb_define_singleton_method(rb_cGDBM, "open", fgdbm_s_open, -1);

rb_define_method(rb_cGDBM, "initialize", fgdbm_initialize, -1);
Expand Down
2 changes: 1 addition & 1 deletion ext/iconv/iconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ void
Init_iconv _((void))
{
VALUE rb_cIconv = rb_define_class("Iconv", rb_cData);
rb_define_singleton_method(rb_cIconv, "allocate", iconv_s_allocate, 0);
rb_define_alloc_func(rb_cIconv, iconv_s_allocate);
rb_define_singleton_method(rb_cIconv, "open", iconv_s_open, 2);
rb_define_singleton_method(rb_cIconv, "iconv", iconv_s_iconv, -1);
rb_define_method(rb_cIconv, "initialize", iconv_initialize, 2);
Expand Down
2 changes: 1 addition & 1 deletion ext/stringio/stringio.c
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ void
Init_stringio()
{
VALUE StringIO = rb_define_class("StringIO", rb_cData);
rb_define_singleton_method(StringIO, "allocate", strio_s_allocate, 0);
rb_define_alloc_func(StringIO, strio_s_allocate);
rb_define_singleton_method(StringIO, "open", strio_s_open, -1);
rb_define_method(StringIO, "initialize", strio_initialize, -1);
rb_enable_super(StringIO, "initialize");
Expand Down
3 changes: 1 addition & 2 deletions ext/strscan/strscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,7 @@ Init_strscan()
rb_obj_freeze(tmp);
rb_const_set(StringScanner, rb_intern("Id"), tmp);

rb_define_singleton_method(StringScanner, "allocate",
strscan_s_allocate, 0);
rb_define_alloc_func(StringScanner, strscan_s_allocate);
rb_define_private_method(StringScanner, "initialize",
strscan_initialize, -1);
rb_define_singleton_method(StringScanner, "must_C_version",
Expand Down
2 changes: 1 addition & 1 deletion ext/tcltklib/tcltklib.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ Init_tcltklib()
rb_define_module_function(lib, "get_eventloop_weight",
get_eventloop_weight, 0);

rb_define_singleton_method(ip, "allocate", ip_alloc, 0);
rb_define_alloc_func(ip, ip_alloc);
rb_define_method(ip, "initialize", ip_init, 0);
rb_define_method(ip, "_eval", ip_eval, 1);
rb_define_method(ip, "_toUTF8",ip_toUTF8,2);
Expand Down
8 changes: 4 additions & 4 deletions ext/win32ole/win32ole.c
Original file line number Diff line number Diff line change
Expand Up @@ -5244,7 +5244,7 @@ Init_win32ole()

cWIN32OLE = rb_define_class("WIN32OLE", rb_cObject);

rb_define_singleton_method(cWIN32OLE, "allocate", fole_s_allocate, 0);
rb_define_alloc_func(cWIN32OLE, fole_s_allocate);

rb_define_method(cWIN32OLE, "initialize", fole_initialize, -1);
rb_enable_super(cWIN32OLE, "initialize");
Expand Down Expand Up @@ -5314,7 +5314,7 @@ Init_win32ole()
rb_define_singleton_method(cWIN32OLE_TYPE, "ole_classes", foletype_s_ole_classes, 1);
rb_define_singleton_method(cWIN32OLE_TYPE, "typelibs", foletype_s_typelibs, 0);
rb_define_singleton_method(cWIN32OLE_TYPE, "progids", foletype_s_progids, 0);
rb_define_singleton_method(cWIN32OLE_TYPE, "allocate", foletype_s_allocate, 0);
rb_define_alloc_func(cWIN32OLE_TYPE, foletype_s_allocate);
rb_define_method(cWIN32OLE_TYPE, "initialize", foletype_initialize, 2);
rb_enable_super(cWIN32OLE_TYPE, "initialize");
rb_define_method(cWIN32OLE_TYPE, "name", foletype_name, 0);
Expand Down Expand Up @@ -5343,7 +5343,7 @@ Init_win32ole()
rb_define_method(cWIN32OLE_VARIABLE, "varkind", folevariable_varkind, 0);

cWIN32OLE_METHOD = rb_define_class("WIN32OLE_METHOD", rb_cObject);
rb_define_singleton_method(cWIN32OLE_METHOD, "allocate", folemethod_s_allocate, 0);
rb_define_alloc_func(cWIN32OLE_METHOD, folemethod_s_allocate);
rb_define_method(cWIN32OLE_METHOD, "initialize", folemethod_initialize, 2);
rb_enable_super(cWIN32OLE_METHOD, "initialize");

Expand Down Expand Up @@ -5377,7 +5377,7 @@ Init_win32ole()

cWIN32OLE_EVENT = rb_define_class("WIN32OLE_EVENT", rb_cObject);

rb_define_singleton_method(cWIN32OLE_EVENT, "allocate", fev_s_allocate, 0);
rb_define_alloc_func(cWIN32OLE_EVENT, fev_s_allocate);
rb_define_method(cWIN32OLE_EVENT, "initialize", fev_initialize, -1);
rb_enable_super(cWIN32OLE_EVENT, "initialize");
rb_define_singleton_method(cWIN32OLE_EVENT, "message_loop", fev_s_msg_loop, 0);
Expand Down

0 comments on commit 3780ede

Please sign in to comment.