Permalink
Browse files

Using RARRAY_LEN and RARRAY_PTR for Ruby 1.9 compatibility

  • Loading branch information...
santana committed Mar 21, 2012
1 parent e5f05ae commit 3d259b5e81a869d596d149230016b1f350ab3cfe
Showing with 4 additions and 4 deletions.
  1. +4 −4 ext/informixc.ec
View
@@ -32,7 +32,7 @@
#include <sqlstype.h>
#include <sqltypes.h>
-static VALUE rb_cDate, rb_cBigDecimal, rb_cRational;
+static VALUE rb_cDate, rb_cBigDecimal;
/* Modules */
static VALUE rb_mInformix;
@@ -1909,8 +1909,8 @@ make_result(cursor_t *c, VALUE record)
if (BUILTIN_TYPE(record) == T_ARRAY) {
rb_ary_store(record, i, item);
}
- else {
- rb_hash_aset(record, RARRAY(c->field_names)->ptr[i], item);
+ else {
+ rb_hash_aset(record, RARRAY_PTR(c->field_names)[i], item);
}
}
return record;
@@ -2720,7 +2720,7 @@ each_by(VALUE self, VALUE n, VALUE type)
for(;;) {
records = fetch_many(self, n, type);
- if (RARRAY(records)->len == 0)
+ if (RARRAY_LEN(records) == 0)
return self;
rb_yield(records);
}

0 comments on commit 3d259b5

Please sign in to comment.