MRI: use rb_data_type_t and initialize in definition #58

Merged
cremno merged 2 commits from mri-use-rb_data_type_t into master 2014-08-29 20:17:25 +00:00
4 changed files with 9 additions and 9 deletions
Showing only changes of commit 0203e28436 - Show all commits

View File

@ -29,7 +29,7 @@
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
void initType(rb_data_type_struct &type, void initType(rb_data_type_t &type,
const char *name, const char *name,
void (*freeInst)(void *)) void (*freeInst)(void *))
{ {

View File

@ -62,12 +62,12 @@ void
raiseRbExc(const Exception &exc); raiseRbExc(const Exception &exc);
#define DECL_TYPE(Klass) \ #define DECL_TYPE(Klass) \
extern rb_data_type_struct Klass##Type extern rb_data_type_t Klass##Type
#define DEF_TYPE(Klass) \ #define DEF_TYPE(Klass) \
rb_data_type_struct Klass##Type rb_data_type_t Klass##Type
void initType(rb_data_type_struct &type, void initType(rb_data_type_t &type,
const char *name, const char *name,
void (*freeInst)(void*)); void (*freeInst)(void*));
@ -109,7 +109,7 @@ getPrivateData(VALUE self)
template<class C> template<class C>
static inline C * static inline C *
getPrivateDataCheck(VALUE self, const rb_data_type_struct &type) getPrivateDataCheck(VALUE self, const rb_data_type_t &type)
{ {
/* We don't check for disposed here because any disposable /* We don't check for disposed here because any disposable
* property is always also nullable */ * property is always also nullable */
@ -124,7 +124,7 @@ setPrivateData(VALUE self, void *p)
} }
inline VALUE inline VALUE
wrapObject(void *p, const rb_data_type_struct &type, wrapObject(void *p, const rb_data_type_t &type,
VALUE underKlass = rb_cObject) VALUE underKlass = rb_cObject)
{ {
VALUE klass = rb_const_get(underKlass, rb_intern(type.wrap_struct_name)); VALUE klass = rb_const_get(underKlass, rb_intern(type.wrap_struct_name));
@ -137,7 +137,7 @@ wrapObject(void *p, const rb_data_type_struct &type,
inline VALUE inline VALUE
wrapProperty(VALUE self, void *prop, const char *iv, wrapProperty(VALUE self, void *prop, const char *iv,
const rb_data_type_struct &type, const rb_data_type_t &type,
VALUE underKlass = rb_cObject) VALUE underKlass = rb_cObject)
{ {
VALUE propObj = wrapObject(prop, type, underKlass); VALUE propObj = wrapObject(prop, type, underKlass);

View File

@ -28,7 +28,7 @@
#include "binding-util.h" #include "binding-util.h"
#include "binding-types.h" #include "binding-types.h"
rb_data_type_struct TilemapAutotilesType; rb_data_type_t TilemapAutotilesType;
RB_METHOD(tilemapAutotilesSet) RB_METHOD(tilemapAutotilesSet)
{ {

View File

@ -30,7 +30,7 @@
#include "binding-types.h" #include "binding-types.h"
DEF_TYPE(TilemapVX); DEF_TYPE(TilemapVX);
rb_data_type_struct BitmapArrayType; rb_data_type_t BitmapArrayType;
RB_METHOD(tilemapVXInitialize) RB_METHOD(tilemapVXInitialize)
{ {