Skip to content

Commit f698db8

Browse files
authored
Merge pull request #87 from larskanis/ruby-24-fixes
Ruby 2.4 fixes regarding Fixnum deprecation
2 parents 3048053 + a87b774 commit f698db8

File tree

14 files changed

+30
-30
lines changed

14 files changed

+30
-30
lines changed

ext/opencv/cvcapture.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ cvcapture_free(void *ptr)
3939
* Open video file or a capturing device for video capturing
4040
* @scope class
4141
* @overload open(dev = nil)
42-
* @param dev [String,Fixnum,Simbol,nil] Video capturing device
42+
* @param dev [String,Integer,Simbol,nil] Video capturing device
4343
* * If dev is a string (i.e "stream.avi"), reads video stream from a file.
4444
* * If dev is a number or symbol (included in CvCapture::INTERFACE), reads video stream from a device.
4545
* * If dev is a nil, same as CvCapture.open(:any)

ext/opencv/cvchain.cpp

Lines changed: 2 additions & 2 deletions
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;
@@ -95,7 +95,7 @@ rb_set_origin(VALUE self, VALUE origin)
9595
/*
9696
* Returns the chain codes
9797
* @overload codes
98-
* @return [Array<Fixnum>] Chain codes
98+
* @return [Array<Integer>] Chain codes
9999
* @opencv_func cvStartReadChainPoints
100100
* @opencv_func CV_READ_SEQ_ELEM
101101
*/

ext/opencv/cvcontour.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ rb_allocate(VALUE klass)
4444
* Constructor
4545
*
4646
* @overload new(seq_flags = CV_SEQ_ELTYPE_POINT | CV_SEQ_KIND_GENERIC, storage = nil)
47-
* @param [Fixnum] seq_flags Flags of the created sequence, which are combinations of
47+
* @param [Integer] seq_flags Flags of the created sequence, which are combinations of
4848
* the element types and sequence types.
4949
* - Element type:
5050
* - <tt>CV_SEQ_ELTYPE_POINT</tt>: {CvPoint}
5151
* - <tt>CV_32FC2</tt>: {CvPoint2D32f}
5252
* - <tt>CV_SEQ_ELTYPE_POINT3D</tt>: {CvPoint3D32f}
53-
* - <tt>CV_SEQ_ELTYPE_INDEX</tt>: Fixnum
54-
* - <tt>CV_SEQ_ELTYPE_CODE</tt>: Fixnum (Freeman code)
53+
* - <tt>CV_SEQ_ELTYPE_INDEX</tt>: Integer
54+
* - <tt>CV_SEQ_ELTYPE_CODE</tt>: Integer (Freeman code)
5555
* - Sequence type:
5656
* - <tt>CV_SEQ_KIND_GENERIC</tt>: Generic sequence
5757
* - <tt>CV_SEQ_KIND_CURVE</tt>: Curve

ext/opencv/cvfont.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ rb_initialize(int argc, VALUE *argv, VALUE self)
108108
/*
109109
* Returns font face
110110
* @overload face
111-
* @return [Fixnum] Font face
111+
* @return [Integer] Font face
112112
*/
113113
VALUE
114114
rb_face(VALUE self)
@@ -152,7 +152,7 @@ rb_shear(VALUE self)
152152
/*
153153
* Returns thickness
154154
* @overload thickness
155-
* @return [Fixnum] thickness
155+
* @return [Integer] thickness
156156
*/
157157
VALUE
158158
rb_thickness(VALUE self)
@@ -163,7 +163,7 @@ rb_thickness(VALUE self)
163163
/*
164164
* Returns line type
165165
* @overload line_type
166-
* @return [Fixnum] line_type
166+
* @return [Integer] line_type
167167
*/
168168
VALUE
169169
rb_line_type(VALUE self)

ext/opencv/cvpoint.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Document-class: OpenCV::CvPoint
1313
*
1414
* This class means one point on X axis Y axis.
15-
* X and Y takes the value of the Fixnum. see also CvPoint2D32F
15+
* X and Y takes the value of the Integer. see also CvPoint2D32F
1616
*
1717
* C structure is here, very simple.
1818
* typdef struct CvPoint {

ext/opencv/cvscalar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ rb_allocate(VALUE klass)
5353
* call-seq:
5454
* new([d1][,d2][,d3][,d4])
5555
*
56-
* Create new Scalar. Argument should be Fixnum (or nil as 0).
56+
* Create new Scalar. Argument should be Integer (or nil as 0).
5757
*/
5858
VALUE
5959
rb_initialize(int argc, VALUE *argv, VALUE self)

ext/opencv/cvseq.cpp

Lines changed: 10 additions & 10 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 {
@@ -146,14 +146,14 @@ class2seq_flags_value(VALUE klass) {
146146
* Constructor
147147
*
148148
* @overload new(seq_flags, storage = nil)
149-
* @param [Fixnum] seq_flags Flags of the created sequence, which are combinations of
149+
* @param [Integer] seq_flags Flags of the created sequence, which are combinations of
150150
* the element types and sequence types.
151151
* - Element type:
152152
* - <tt>CV_SEQ_ELTYPE_POINT</tt>: {CvPoint}
153153
* - <tt>CV_32FC2</tt>: {CvPoint2D32f}
154154
* - <tt>CV_SEQ_ELTYPE_POINT3D</tt>: {CvPoint3D32f}
155-
* - <tt>CV_SEQ_ELTYPE_INDEX</tt>: Fixnum
156-
* - <tt>CV_SEQ_ELTYPE_CODE</tt>: Fixnum (Freeman code)
155+
* - <tt>CV_SEQ_ELTYPE_INDEX</tt>: Integer
156+
* - <tt>CV_SEQ_ELTYPE_CODE</tt>: Integer (Freeman code)
157157
* - Sequence type:
158158
* - <tt>CV_SEQ_KIND_GENERIC</tt>: Generic sequence
159159
* - <tt>CV_SEQ_KIND_CURVE</tt>: Curve
@@ -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
@@ -567,10 +567,10 @@ rb_insert(VALUE self, VALUE index, VALUE object)
567567
Check_Type(index, T_FIXNUM);
568568
CvSeq *seq = CVSEQ(self);
569569
VALUE klass = seqblock_class(seq);
570-
if (CLASS_OF(object) != klass)
570+
if (!rb_obj_is_kind_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
}

ext/opencv/cvsize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Document-class: OpenCV::CvSize
1313
*
1414
* This class means one size on X axis Y axis.
15-
* X and Y takes the value of the Fixnum.
15+
* X and Y takes the value of the Integer.
1616
*
1717
* C structure is here, very simple.
1818
* typdef struct CvSize {

ext/opencv/cvtwopoints.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Document-class: OpenCV::CvTwoPoints
1313
*
1414
* This class means one twopoints on X axis Y axis.
15-
* X and Y takes the value of the Fixnum. see also CvTwopoints2D32F
15+
* X and Y takes the value of the Integer. see also CvTwopoints2D32F
1616
*
1717
* C structure is here, very simple.
1818
* typdef struct CvTwopoints {

ext/opencv/iplimage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ rb_reset_roi(VALUE self)
193193
}
194194

195195
/*
196-
* Return COI as Fixnum.
196+
* Return COI as Integer.
197197
*/
198198
VALUE
199199
rb_get_coi(VALUE self)
@@ -213,7 +213,7 @@ rb_get_coi(VALUE self)
213213
* set_coi(coi)
214214
* set_coi(coi){|image| ...}
215215
*
216-
* Set COI. <i>coi</i> should be Fixnum.
216+
* Set COI. <i>coi</i> should be Integer.
217217
* Return self.
218218
*/
219219
VALUE

0 commit comments

Comments
 (0)