Commit e94e5866 authored by Andrey Kamaev's avatar Andrey Kamaev

Fixed mingw build warnings

parent 988c405f
...@@ -24,7 +24,7 @@ CvParams::CvParams() : name( "params" ) {} ...@@ -24,7 +24,7 @@ CvParams::CvParams() : name( "params" ) {}
void CvParams::printDefaults() const void CvParams::printDefaults() const
{ cout << "--" << name << "--" << endl; } { cout << "--" << name << "--" << endl; }
void CvParams::printAttrs() const {} void CvParams::printAttrs() const {}
bool CvParams::scanAttr( const String prmName, const String val ) { return false; } bool CvParams::scanAttr( const String, const String ) { return false; }
//---------------------------- FeatureParams -------------------------------------- //---------------------------- FeatureParams --------------------------------------
......
...@@ -88,8 +88,8 @@ struct CV_EXPORTS CvFeatureTrackerParams ...@@ -88,8 +88,8 @@ struct CV_EXPORTS CvFeatureTrackerParams
enum { SIFT = 0, SURF = 1, OPTICAL_FLOW = 2 }; enum { SIFT = 0, SURF = 1, OPTICAL_FLOW = 2 };
CvFeatureTrackerParams(int featureType = 0, int windowSize = 0) CvFeatureTrackerParams(int featureType = 0, int windowSize = 0)
{ {
featureType = 0; feature_type = featureType;
windowSize = 0; window_size = windowSize;
} }
int feature_type; // Feature type to use int feature_type; // Feature type to use
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
* Adapted for FLANN by Marius Muja * Adapted for FLANN by Marius Muja
*/ */
#include "defines.h"
#include <stdexcept> #include <stdexcept>
#include <ostream> #include <ostream>
#include <typeinfo> #include <typeinfo>
...@@ -95,6 +96,16 @@ struct big_any_policy : typed_base_any_policy<T> ...@@ -95,6 +96,16 @@ struct big_any_policy : typed_base_any_policy<T>
virtual void print(std::ostream& out, void* const* src) { out << *reinterpret_cast<T const*>(*src); } virtual void print(std::ostream& out, void* const* src) { out << *reinterpret_cast<T const*>(*src); }
}; };
template<> inline void big_any_policy<flann_centers_init_t>::print(std::ostream& out, void* const* src)
{
out << int(*reinterpret_cast<flann_centers_init_t const*>(*src));
}
template<> inline void big_any_policy<flann_algorithm_t>::print(std::ostream& out, void* const* src)
{
out << int(*reinterpret_cast<flann_algorithm_t const*>(*src));
}
template<typename T> template<typename T>
struct choose_policy struct choose_policy
{ {
......
#ifdef __GNUC__
# pragma GCC diagnostic ignored "-Wsign-promo"
#endif
#ifndef _OPENCV_FLANN_PRECOMP_HPP_ #ifndef _OPENCV_FLANN_PRECOMP_HPP_
#define _OPENCV_FLANN_PRECOMP_HPP_ #define _OPENCV_FLANN_PRECOMP_HPP_
......
...@@ -542,8 +542,6 @@ bool JpegEncoder::write( const Mat& img, const vector<int>& params ) ...@@ -542,8 +542,6 @@ bool JpegEncoder::write( const Mat& img, const vector<int>& params )
}; };
bool result = false; bool result = false;
fileWrapper fw; fileWrapper fw;
int _channels = img.channels();
int channels = _channels > 1 ? 3 : 1;
int width = img.cols, height = img.rows; int width = img.cols, height = img.rows;
vector<uchar> out_buf(1 << 12); vector<uchar> out_buf(1 << 12);
...@@ -580,6 +578,9 @@ bool JpegEncoder::write( const Mat& img, const vector<int>& params ) ...@@ -580,6 +578,9 @@ bool JpegEncoder::write( const Mat& img, const vector<int>& params )
{ {
cinfo.image_width = width; cinfo.image_width = width;
cinfo.image_height = height; cinfo.image_height = height;
int _channels = img.channels();
int channels = _channels > 1 ? 3 : 1;
cinfo.input_components = channels; cinfo.input_components = channels;
cinfo.in_color_space = channels > 1 ? JCS_RGB : JCS_GRAYSCALE; cinfo.in_color_space = channels > 1 ? JCS_RGB : JCS_GRAYSCALE;
......
...@@ -519,7 +519,7 @@ int CV_MLBaseTest::read_params( CvFileStorage* _fs ) ...@@ -519,7 +519,7 @@ int CV_MLBaseTest::read_params( CvFileStorage* _fs )
return cvtest::TS::OK;; return cvtest::TS::OK;;
} }
void CV_MLBaseTest::run( int start_from ) void CV_MLBaseTest::run( int )
{ {
string filename = ts->get_data_path(); string filename = ts->get_data_path();
filename += get_validation_filename(); filename += get_validation_filename();
...@@ -527,7 +527,6 @@ void CV_MLBaseTest::run( int start_from ) ...@@ -527,7 +527,6 @@ void CV_MLBaseTest::run( int start_from )
read_params( *validationFS ); read_params( *validationFS );
int code = cvtest::TS::OK; int code = cvtest::TS::OK;
start_from = 0;
for (int i = 0; i < test_case_count; i++) for (int i = 0; i < test_case_count; i++)
{ {
int temp_code = run_test_case( i ); int temp_code = run_test_case( i );
...@@ -713,7 +712,7 @@ int CV_MLBaseTest::train( int testCaseIdx ) ...@@ -713,7 +712,7 @@ int CV_MLBaseTest::train( int testCaseIdx )
return cvtest::TS::OK; return cvtest::TS::OK;
} }
float CV_MLBaseTest::get_error( int testCaseIdx, int type, vector<float> *resp ) float CV_MLBaseTest::get_error( int /*testCaseIdx*/, int type, vector<float> *resp )
{ {
float err = 0; float err = 0;
if( !modelName.compare(CV_NBAYES) ) if( !modelName.compare(CV_NBAYES) )
...@@ -721,8 +720,8 @@ float CV_MLBaseTest::get_error( int testCaseIdx, int type, vector<float> *resp ) ...@@ -721,8 +720,8 @@ float CV_MLBaseTest::get_error( int testCaseIdx, int type, vector<float> *resp )
else if( !modelName.compare(CV_KNEAREST) ) else if( !modelName.compare(CV_KNEAREST) )
{ {
assert( 0 ); assert( 0 );
testCaseIdx = 0; /*testCaseIdx = 0;
/*int k = 2; int k = 2;
validationFS.getFirstTopLevelNode()["validation"][modelName][dataSetNames[testCaseIdx]]["model_params"]["k"] >> k; validationFS.getFirstTopLevelNode()["validation"][modelName][dataSetNames[testCaseIdx]]["model_params"]["k"] >> k;
err = knearest->calc_error( &data, k, type, resp );*/ err = knearest->calc_error( &data, k, type, resp );*/
} }
......
...@@ -181,7 +181,7 @@ public: ...@@ -181,7 +181,7 @@ public:
datastart = data = (uchar*)PyArray_DATA(o); datastart = data = (uchar*)PyArray_DATA(o);
} }
void deallocate(int* refcount, uchar* datastart, uchar* data) void deallocate(int* refcount, uchar*, uchar*)
{ {
PyEnsureGIL gil; PyEnsureGIL gil;
if( !refcount ) if( !refcount )
...@@ -349,6 +349,7 @@ static PyObject* pyopencv_from(bool value) ...@@ -349,6 +349,7 @@ static PyObject* pyopencv_from(bool value)
static bool pyopencv_to(PyObject* obj, bool& value, const char* name = "<unknown>") static bool pyopencv_to(PyObject* obj, bool& value, const char* name = "<unknown>")
{ {
(void)name;
if(!obj || obj == Py_None) if(!obj || obj == Py_None)
return true; return true;
int _val = PyObject_IsTrue(obj); int _val = PyObject_IsTrue(obj);
...@@ -365,6 +366,7 @@ static PyObject* pyopencv_from(size_t value) ...@@ -365,6 +366,7 @@ static PyObject* pyopencv_from(size_t value)
static bool pyopencv_to(PyObject* obj, size_t& value, const char* name = "<unknown>") static bool pyopencv_to(PyObject* obj, size_t& value, const char* name = "<unknown>")
{ {
(void)name;
if(!obj || obj == Py_None) if(!obj || obj == Py_None)
return true; return true;
value = (int)PyLong_AsUnsignedLong(obj); value = (int)PyLong_AsUnsignedLong(obj);
...@@ -376,8 +378,19 @@ static PyObject* pyopencv_from(int value) ...@@ -376,8 +378,19 @@ static PyObject* pyopencv_from(int value)
return PyInt_FromLong(value); return PyInt_FromLong(value);
} }
static PyObject* pyopencv_from(cvflann_flann_algorithm_t value)
{
return PyInt_FromLong(int(value));
}
static PyObject* pyopencv_from(cvflann_flann_distance_t value)
{
return PyInt_FromLong(int(value));
}
static bool pyopencv_to(PyObject* obj, int& value, const char* name = "<unknown>") static bool pyopencv_to(PyObject* obj, int& value, const char* name = "<unknown>")
{ {
(void)name;
if(!obj || obj == Py_None) if(!obj || obj == Py_None)
return true; return true;
value = (int)PyInt_AsLong(obj); value = (int)PyInt_AsLong(obj);
...@@ -391,6 +404,7 @@ static PyObject* pyopencv_from(uchar value) ...@@ -391,6 +404,7 @@ static PyObject* pyopencv_from(uchar value)
static bool pyopencv_to(PyObject* obj, uchar& value, const char* name = "<unknown>") static bool pyopencv_to(PyObject* obj, uchar& value, const char* name = "<unknown>")
{ {
(void)name;
if(!obj || obj == Py_None) if(!obj || obj == Py_None)
return true; return true;
int ivalue = (int)PyInt_AsLong(obj); int ivalue = (int)PyInt_AsLong(obj);
...@@ -405,6 +419,7 @@ static PyObject* pyopencv_from(double value) ...@@ -405,6 +419,7 @@ static PyObject* pyopencv_from(double value)
static bool pyopencv_to(PyObject* obj, double& value, const char* name = "<unknown>") static bool pyopencv_to(PyObject* obj, double& value, const char* name = "<unknown>")
{ {
(void)name;
if(!obj || obj == Py_None) if(!obj || obj == Py_None)
return true; return true;
if(PyInt_CheckExact(obj)) if(PyInt_CheckExact(obj))
...@@ -421,6 +436,7 @@ static PyObject* pyopencv_from(float value) ...@@ -421,6 +436,7 @@ static PyObject* pyopencv_from(float value)
static bool pyopencv_to(PyObject* obj, float& value, const char* name = "<unknown>") static bool pyopencv_to(PyObject* obj, float& value, const char* name = "<unknown>")
{ {
(void)name;
if(!obj || obj == Py_None) if(!obj || obj == Py_None)
return true; return true;
if(PyInt_CheckExact(obj)) if(PyInt_CheckExact(obj))
...@@ -442,6 +458,7 @@ static PyObject* pyopencv_from(const string& value) ...@@ -442,6 +458,7 @@ static PyObject* pyopencv_from(const string& value)
static bool pyopencv_to(PyObject* obj, string& value, const char* name = "<unknown>") static bool pyopencv_to(PyObject* obj, string& value, const char* name = "<unknown>")
{ {
(void)name;
if(!obj || obj == Py_None) if(!obj || obj == Py_None)
return true; return true;
char* str = PyString_AsString(obj); char* str = PyString_AsString(obj);
...@@ -453,6 +470,7 @@ static bool pyopencv_to(PyObject* obj, string& value, const char* name = "<unkno ...@@ -453,6 +470,7 @@ static bool pyopencv_to(PyObject* obj, string& value, const char* name = "<unkno
static inline bool pyopencv_to(PyObject* obj, Size& sz, const char* name = "<unknown>") static inline bool pyopencv_to(PyObject* obj, Size& sz, const char* name = "<unknown>")
{ {
(void)name;
if(!obj || obj == Py_None) if(!obj || obj == Py_None)
return true; return true;
return PyArg_ParseTuple(obj, "ii", &sz.width, &sz.height) > 0; return PyArg_ParseTuple(obj, "ii", &sz.width, &sz.height) > 0;
...@@ -465,6 +483,7 @@ static inline PyObject* pyopencv_from(const Size& sz) ...@@ -465,6 +483,7 @@ static inline PyObject* pyopencv_from(const Size& sz)
static inline bool pyopencv_to(PyObject* obj, Rect& r, const char* name = "<unknown>") static inline bool pyopencv_to(PyObject* obj, Rect& r, const char* name = "<unknown>")
{ {
(void)name;
if(!obj || obj == Py_None) if(!obj || obj == Py_None)
return true; return true;
return PyArg_ParseTuple(obj, "iiii", &r.x, &r.y, &r.width, &r.height) > 0; return PyArg_ParseTuple(obj, "iiii", &r.x, &r.y, &r.width, &r.height) > 0;
...@@ -477,6 +496,7 @@ static inline PyObject* pyopencv_from(const Rect& r) ...@@ -477,6 +496,7 @@ static inline PyObject* pyopencv_from(const Rect& r)
static inline bool pyopencv_to(PyObject* obj, Range& r, const char* name = "<unknown>") static inline bool pyopencv_to(PyObject* obj, Range& r, const char* name = "<unknown>")
{ {
(void)name;
if(!obj || obj == Py_None) if(!obj || obj == Py_None)
return true; return true;
if(PyObject_Size(obj) == 0) if(PyObject_Size(obj) == 0)
...@@ -494,6 +514,7 @@ static inline PyObject* pyopencv_from(const Range& r) ...@@ -494,6 +514,7 @@ static inline PyObject* pyopencv_from(const Range& r)
static inline bool pyopencv_to(PyObject* obj, CvSlice& r, const char* name = "<unknown>") static inline bool pyopencv_to(PyObject* obj, CvSlice& r, const char* name = "<unknown>")
{ {
(void)name;
if(!obj || obj == Py_None) if(!obj || obj == Py_None)
return true; return true;
if(PyObject_Size(obj) == 0) if(PyObject_Size(obj) == 0)
...@@ -511,6 +532,7 @@ static inline PyObject* pyopencv_from(const CvSlice& r) ...@@ -511,6 +532,7 @@ static inline PyObject* pyopencv_from(const CvSlice& r)
static inline bool pyopencv_to(PyObject* obj, Point& p, const char* name = "<unknown>") static inline bool pyopencv_to(PyObject* obj, Point& p, const char* name = "<unknown>")
{ {
(void)name;
if(!obj || obj == Py_None) if(!obj || obj == Py_None)
return true; return true;
if(PyComplex_CheckExact(obj)) if(PyComplex_CheckExact(obj))
...@@ -525,6 +547,7 @@ static inline bool pyopencv_to(PyObject* obj, Point& p, const char* name = "<unk ...@@ -525,6 +547,7 @@ static inline bool pyopencv_to(PyObject* obj, Point& p, const char* name = "<unk
static inline bool pyopencv_to(PyObject* obj, Point2f& p, const char* name = "<unknown>") static inline bool pyopencv_to(PyObject* obj, Point2f& p, const char* name = "<unknown>")
{ {
(void)name;
if(!obj || obj == Py_None) if(!obj || obj == Py_None)
return true; return true;
if(PyComplex_CheckExact(obj)) if(PyComplex_CheckExact(obj))
...@@ -549,6 +572,7 @@ static inline PyObject* pyopencv_from(const Point2f& p) ...@@ -549,6 +572,7 @@ static inline PyObject* pyopencv_from(const Point2f& p)
static inline bool pyopencv_to(PyObject* obj, Vec3d& v, const char* name = "<unknown>") static inline bool pyopencv_to(PyObject* obj, Vec3d& v, const char* name = "<unknown>")
{ {
(void)name;
if(!obj) if(!obj)
return true; return true;
return PyArg_ParseTuple(obj, "ddd", &v[0], &v[1], &v[2]) > 0; return PyArg_ParseTuple(obj, "ddd", &v[0], &v[1], &v[2]) > 0;
...@@ -792,6 +816,7 @@ template<> struct pyopencvVecConverter<string> ...@@ -792,6 +816,7 @@ template<> struct pyopencvVecConverter<string>
static inline bool pyopencv_to(PyObject *obj, CvTermCriteria& dst, const char *name="<unknown>") static inline bool pyopencv_to(PyObject *obj, CvTermCriteria& dst, const char *name="<unknown>")
{ {
(void)name;
if(!obj) if(!obj)
return true; return true;
return PyArg_ParseTuple(obj, "iid", &dst.type, &dst.max_iter, &dst.epsilon) > 0; return PyArg_ParseTuple(obj, "iid", &dst.type, &dst.max_iter, &dst.epsilon) > 0;
...@@ -804,6 +829,7 @@ static inline PyObject* pyopencv_from(const CvTermCriteria& src) ...@@ -804,6 +829,7 @@ static inline PyObject* pyopencv_from(const CvTermCriteria& src)
static inline bool pyopencv_to(PyObject *obj, TermCriteria& dst, const char *name="<unknown>") static inline bool pyopencv_to(PyObject *obj, TermCriteria& dst, const char *name="<unknown>")
{ {
(void)name;
if(!obj) if(!obj)
return true; return true;
return PyArg_ParseTuple(obj, "iid", &dst.type, &dst.maxCount, &dst.epsilon) > 0; return PyArg_ParseTuple(obj, "iid", &dst.type, &dst.maxCount, &dst.epsilon) > 0;
...@@ -816,6 +842,7 @@ static inline PyObject* pyopencv_from(const TermCriteria& src) ...@@ -816,6 +842,7 @@ static inline PyObject* pyopencv_from(const TermCriteria& src)
static inline bool pyopencv_to(PyObject *obj, RotatedRect& dst, const char *name="<unknown>") static inline bool pyopencv_to(PyObject *obj, RotatedRect& dst, const char *name="<unknown>")
{ {
(void)name;
if(!obj) if(!obj)
return true; return true;
return PyArg_ParseTuple(obj, "(ff)(ff)f", &dst.center.x, &dst.center.y, &dst.size.width, &dst.size.height, &dst.angle) > 0; return PyArg_ParseTuple(obj, "(ff)(ff)f", &dst.center.x, &dst.center.y, &dst.size.width, &dst.size.height, &dst.angle) > 0;
...@@ -847,6 +874,7 @@ static inline PyObject* pyopencv_from(const CvDTreeNode* node) ...@@ -847,6 +874,7 @@ static inline PyObject* pyopencv_from(const CvDTreeNode* node)
static bool pyopencv_to(PyObject *o, cv::flann::IndexParams& p, const char *name="<unknown>") static bool pyopencv_to(PyObject *o, cv::flann::IndexParams& p, const char *name="<unknown>")
{ {
(void)name;
bool ok = false; bool ok = false;
PyObject* keys = PyObject_CallMethod(o,(char*)"keys",0); PyObject* keys = PyObject_CallMethod(o,(char*)"keys",0);
PyObject* values = PyObject_CallMethod(o,(char*)"values",0); PyObject* values = PyObject_CallMethod(o,(char*)"values",0);
...@@ -927,7 +955,7 @@ static void OnMouse(int event, int x, int y, int flags, void* param) ...@@ -927,7 +955,7 @@ static void OnMouse(int event, int x, int y, int flags, void* param)
PyGILState_Release(gstate); PyGILState_Release(gstate);
} }
static PyObject *pycvSetMouseCallback(PyObject *self, PyObject *args, PyObject *kw) static PyObject *pycvSetMouseCallback(PyObject*, PyObject *args, PyObject *kw)
{ {
const char *keywords[] = { "window_name", "on_mouse", "param", NULL }; const char *keywords[] = { "window_name", "on_mouse", "param", NULL };
char* name; char* name;
...@@ -961,7 +989,7 @@ static void OnChange(int pos, void *param) ...@@ -961,7 +989,7 @@ static void OnChange(int pos, void *param)
PyGILState_Release(gstate); PyGILState_Release(gstate);
} }
static PyObject *pycvCreateTrackbar(PyObject *self, PyObject *args) static PyObject *pycvCreateTrackbar(PyObject*, PyObject *args)
{ {
PyObject *on_change; PyObject *on_change;
char* trackbar_name; char* trackbar_name;
...@@ -983,6 +1011,11 @@ static PyObject *pycvCreateTrackbar(PyObject *self, PyObject *args) ...@@ -983,6 +1011,11 @@ static PyObject *pycvCreateTrackbar(PyObject *self, PyObject *args)
#define MKTYPE2(NAME) pyopencv_##NAME##_specials(); if (!to_ok(&pyopencv_##NAME##_Type)) return #define MKTYPE2(NAME) pyopencv_##NAME##_specials(); if (!to_ok(&pyopencv_##NAME##_Type)) return
#ifdef __GNUC__
# pragma GCC diagnostic ignored "-Wunused-parameter"
# pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif
#include "pyopencv_generated_types.h" #include "pyopencv_generated_types.h"
#include "pyopencv_generated_funcs.h" #include "pyopencv_generated_funcs.h"
......
#include "perf_precomp.hpp" #include "perf_precomp.hpp"
#ifdef __GNUC__
# pragma GCC diagnostic ignored "-Wsign-promo"
#endif
#include "opencv2/highgui/highgui.hpp" #include "opencv2/highgui/highgui.hpp"
#include "opencv2/core/internal.hpp" #include "opencv2/core/internal.hpp"
#include "opencv2/flann/flann.hpp" #include "opencv2/flann/flann.hpp"
......
...@@ -18,7 +18,7 @@ using namespace cv; ...@@ -18,7 +18,7 @@ using namespace cv;
#if !defined(HAVE_CUDA) #if !defined(HAVE_CUDA)
int main( int argc, const char** argv ) int main( int, const char** )
{ {
cout << "Please compile the library with CUDA support" << endl; cout << "Please compile the library with CUDA support" << endl;
return -1; return -1;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#endif #endif
#if !defined(HAVE_CUDA) #if !defined(HAVE_CUDA)
int main( int argc, const char** argv ) int main( int, const char** )
{ {
std::cout << "Please compile the library with CUDA support" << std::endl; std::cout << "Please compile the library with CUDA support" << std::endl;
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment