get rid of INIT_TYPE() / initType()
A function to initialize rb_data_type_t variables is not needed. Also fix a FIXME (WindowVX's name is now "Window") on the way.
This commit is contained in:
parent
0203e28436
commit
173ee07959
14 changed files with 35 additions and 62 deletions
|
@ -28,7 +28,16 @@
|
|||
#include "ruby/encoding.h"
|
||||
#include "ruby/intern.h"
|
||||
|
||||
DEF_TYPE(FileInt);
|
||||
static void
|
||||
fileIntFreeInstance(void *inst)
|
||||
{
|
||||
SDL_RWops *ops = static_cast<SDL_RWops*>(inst);
|
||||
|
||||
SDL_RWclose(ops);
|
||||
SDL_FreeRW(ops);
|
||||
}
|
||||
|
||||
DEF_TYPE_CUSTOMFREE(FileInt, fileIntFreeInstance);
|
||||
|
||||
static VALUE
|
||||
fileIntForPath(const char *path)
|
||||
|
@ -100,15 +109,6 @@ RB_METHOD(fileIntBinmode)
|
|||
return Qnil;
|
||||
}
|
||||
|
||||
static void
|
||||
fileIntFreeInstance(void *inst)
|
||||
{
|
||||
SDL_RWops *ops = static_cast<SDL_RWops*>(inst);
|
||||
|
||||
SDL_RWclose(ops);
|
||||
SDL_FreeRW(ops);
|
||||
}
|
||||
|
||||
VALUE
|
||||
kernelLoadDataInt(const char *filename)
|
||||
{
|
||||
|
@ -196,8 +196,6 @@ RB_METHOD(_marshalLoad)
|
|||
void
|
||||
fileIntBindingInit()
|
||||
{
|
||||
initType(FileIntType, "FileInt", fileIntFreeInstance);
|
||||
|
||||
VALUE klass = rb_define_class("FileInt", rb_cIO);
|
||||
rb_define_alloc_func(klass, classAllocate<&FileIntType>);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue