Skip to content

Commit af14c1d

Browse files
committed
Ruby 2.4 fixes
1 parent 76a076d commit af14c1d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

ext/opencv/cvchain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ rb_initialize(int argc, VALUE *argv, VALUE self)
6262
raise_cverror(e);
6363
}
6464
CvSeq* self_ptr = CVSEQ(self);
65-
cCvSeq::register_elem_class(self_ptr, rb_cFixnum);
65+
cCvSeq::register_elem_class(self_ptr, rb_cInteger);
6666
register_root_object(self_ptr, storage_value);
6767

6868
return self;

ext/opencv/cvseq.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ eltype2class(int eltype, VALUE* ret) {
4343
break;
4444
case CV_SEQ_ELTYPE_CODE:
4545
case CV_SEQ_ELTYPE_INDEX:
46-
*ret = rb_cFixnum;
46+
*ret = rb_cInteger;
4747
break;
4848
case CV_SEQ_ELTYPE_PPOINT: // or CV_SEQ_ELTYPE_PTR:
4949
// Not supported
@@ -132,7 +132,7 @@ class2seq_flags_value(VALUE klass) {
132132
else if (klass == cCvPoint3D32f::rb_class()) {
133133
seq_flags = CV_SEQ_ELTYPE_POINT3D;
134134
}
135-
else if (klass == rb_cFixnum) {
135+
else if (klass == rb_cInteger) {
136136
seq_flags = CV_SEQ_ELTYPE_INDEX;
137137
}
138138
else {
@@ -421,7 +421,7 @@ rb_pop(VALUE self)
421421
VALUE object = Qnil;
422422
VALUE klass = seqblock_class(seq);
423423
try {
424-
if (klass == rb_cFixnum) {
424+
if (klass == rb_cInteger) {
425425
int n = 0;
426426
cvSeqPop(seq, &n);
427427
object = INT2FIX(n);
@@ -489,7 +489,7 @@ rb_shift(VALUE self)
489489

490490
VALUE object = Qnil;
491491
try {
492-
if (seqblock_class(seq) == rb_cFixnum) {
492+
if (seqblock_class(seq) == rb_cInteger) {
493493
int n = 0;
494494
cvSeqPopFront(seq, &n);
495495
object = INT2NUM(n);
@@ -525,7 +525,7 @@ rb_each(VALUE self)
525525
if (seq->total > 0) {
526526
VALUE klass = seqblock_class(seq);
527527
try {
528-
if (klass == rb_cFixnum)
528+
if (klass == rb_cInteger)
529529
for (int i = 0; i < seq->total; ++i)
530530
rb_yield(INT2NUM(*CV_GET_SEQ_ELEM(int, seq, i)));
531531
else
@@ -570,7 +570,7 @@ rb_insert(VALUE self, VALUE index, VALUE object)
570570
if (CLASS_OF(object) != klass)
571571
rb_raise(rb_eTypeError, "arguments should be %s.", rb_class2name(klass));
572572
try {
573-
if (klass == rb_cFixnum) {
573+
if (klass == rb_cInteger) {
574574
int n = NUM2INT(object);
575575
cvSeqInsert(seq, NUM2INT(index), &n);
576576
}

0 commit comments

Comments
 (0)