From a3e10782aefb67cf939bdf4efa95a469e0ec592e Mon Sep 17 00:00:00 2001 From: ser1zw Date: Mon, 18 Apr 2011 01:08:47 +0900 Subject: [PATCH] modified cvcontourtree.cpp, cvfont.h, iplconvkernel.cpp to suppress warnings --- ext/opencv/cvcontourtree.cpp | 4 +++- ext/opencv/cvfont.h | 2 +- ext/opencv/iplconvkernel.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ext/opencv/cvcontourtree.cpp b/ext/opencv/cvcontourtree.cpp index ccbfe4db..382c4e19 100644 --- a/ext/opencv/cvcontourtree.cpp +++ b/ext/opencv/cvcontourtree.cpp @@ -78,7 +78,9 @@ rb_contour(int argc, VALUE *argv, VALUE self) { VALUE criteria, storage; rb_scan_args(argc, argv, "01", &criteria); - CvSeq *contour = cvContourFromContourTree(CVCONTOURTREE(self), CVMEMSTORAGE(storage), VALUE_TO_CVTERMCRITERIA(criteria)); + storage = cCvMemStorage::new_object(); + CvSeq *contour = cvContourFromContourTree(CVCONTOURTREE(self), CVMEMSTORAGE(storage), + VALUE_TO_CVTERMCRITERIA(criteria)); return cCvSeq::new_sequence(cCvContour::rb_class(), contour, cCvPoint::rb_class(), storage); } diff --git a/ext/opencv/cvfont.h b/ext/opencv/cvfont.h index ce0256cb..429d2790 100644 --- a/ext/opencv/cvfont.h +++ b/ext/opencv/cvfont.h @@ -24,7 +24,7 @@ __NAMESPACE_BEGIN_CVFONT #define FO_VSCALE(op) NUM2DBL(rb_hash_aref(op, ID2SYM(rb_intern("vscale")))) #define FO_SHEAR(op) NUM2DBL(rb_hash_aref(op, ID2SYM(rb_intern("shear")))) #define FO_THICKNESS(op) FIX2INT(rb_hash_aref(op, ID2SYM(rb_intern("thickness")))) -#define FO_LINE_TYPE(op) FIX2INT(rb_hash_aref(op, ID2SYM(rb_intern("line_type"))) == ID2SYM("aa") ? INT2FIX(CV_AA) : rb_hash_aref(op, ID2SYM(rb_intern("line_type")))) +#define FO_LINE_TYPE(op) FIX2INT(rb_hash_aref(op, ID2SYM(rb_intern("line_type")))) VALUE rb_class(); diff --git a/ext/opencv/iplconvkernel.cpp b/ext/opencv/iplconvkernel.cpp index a87e8b41..317cd272 100644 --- a/ext/opencv/iplconvkernel.cpp +++ b/ext/opencv/iplconvkernel.cpp @@ -89,7 +89,7 @@ rb_initialize(int argc, VALUE *argv, VALUE self) int _cols = NUM2INT(cols); int _rows = NUM2INT(rows); int num_values; - int *_values; + int *_values = NULL; const int INVALID_SHAPE = -1; shape_type = CVMETHOD("STRUCTURING_ELEMENT_SHAPE", shape, INVALID_SHAPE);