ext/Generator.c in rubyfb-0.5.4 vs ext/Generator.c in rubyfb-0.5.5

- old
+ new

@@ -28,17 +28,11 @@ #include "Common.h" #include "ResultSet.h" #include "Statement.h" #include "Transaction.h" #include "DataArea.h" -#ifdef OS_UNIX - #include <inttypes.h> -#else - typedef short int16_t; - typedef long int32_t; - typedef long long int64_t; -#endif +#include "rfbint.h" /* Function prototypes. */ static VALUE allocateGenerator(VALUE); static VALUE initializeGenerator(VALUE, VALUE, VALUE); static VALUE getGeneratorName(VALUE); @@ -174,11 +168,11 @@ GeneratorHandle *generator = NULL; int32_t number = 0; Data_Get_Struct(self, GeneratorHandle, generator); - number = getGeneratorValue(STR2CSTR(name), 0, generator->connection); + number = getGeneratorValue(StringValuePtr(name), 0, generator->connection); return(INT2NUM(number)); } @@ -204,11 +198,11 @@ if(TYPE(step) != T_FIXNUM) { rb_fireruby_raise(NULL, "Invalid generator step value."); } - number = getGeneratorValue(STR2CSTR(name), FIX2INT(step), + number = getGeneratorValue(StringValuePtr(name), FIX2INT(step), generator->connection); return(INT2NUM(number)); } @@ -228,11 +222,11 @@ Data_Get_Struct(self, GeneratorHandle, generator); name = rb_iv_get(self, "@name"); /* Drop the generator. */ - deleteGenerator(STR2CSTR(name), generator->connection); + deleteGenerator(StringValuePtr(name), generator->connection); return(self); } @@ -265,11 +259,11 @@ if(handle->handle == 0) { rb_fireruby_raise(NULL, "Connection is closed."); } - if(checkForGenerator(STR2CSTR(name), &handle->handle)) + if(checkForGenerator(StringValuePtr(name), &handle->handle)) { exists = Qtrue; } return(exists); @@ -308,10 +302,10 @@ } Data_Get_Struct(connection, ConnectionHandle, handle); if(handle->handle != 0) { - installGenerator(STR2CSTR(name), &handle->handle); + installGenerator(StringValuePtr(name), &handle->handle); result = rb_generator_new(name, connection); } else { rb_fireruby_raise(NULL,