fixed several warnings from Xcode 4 LLVM compiler; fixed bug #920

This commit is contained in:
Vadim Pisarevsky
2011-04-30 19:29:26 +00:00
parent 92852ca06e
commit 23a9b7bb9c
18 changed files with 51 additions and 53 deletions

View File

@@ -73,7 +73,7 @@ void CirclesGridClusterFinder::hierarchicalClustering(const vector<Point2f> poin
}
int patternClusterIdx = 0;
while(clusters[patternClusterIdx].size() < patternSize.area() && countNonZero(distsMask == 255) > 0)
while((int)clusters[patternClusterIdx].size() < patternSize.area() && countNonZero(distsMask == 255) > 0)
{
Point minLoc;
minMaxLoc(dists, 0, 0, &minLoc, 0, distsMask);
@@ -93,7 +93,7 @@ void CirclesGridClusterFinder::hierarchicalClustering(const vector<Point2f> poin
}
patternPoints.clear();
if(clusters[patternClusterIdx].size() != patternSize.area())
if((int)clusters[patternClusterIdx].size() != patternSize.area())
{
return;
}

View File

@@ -481,10 +481,9 @@ protected:
return true;
}
string name;
const DistanceType maxDist;
const float prevTime;
string name;
Ptr<DescriptorExtractor> dextractor;
Distance distance;
@@ -516,7 +515,7 @@ class CV_DescriptorMatcherTest : public cvtest::BaseTest
{
public:
CV_DescriptorMatcherTest( const string& _name, const Ptr<DescriptorMatcher>& _dmatcher, float _badPart ) :
name(_name), badPart(_badPart), dmatcher(_dmatcher)
badPart(_badPart), name(_name), dmatcher(_dmatcher)
{}
protected:
static const int dim = 500;

View File

@@ -36,6 +36,7 @@
#include <stdexcept>
#include <cassert>
#include "opencv2/flann/object_factory.h"
#include "opencv2/flann/logger.h"
namespace cvflann {
@@ -58,13 +59,6 @@ enum flann_centers_init_t {
FLANN_CENTERS_KMEANSPP = 2
};
enum flann_log_level_t {
FLANN_LOG_NONE = 0,
FLANN_LOG_FATAL = 1,
FLANN_LOG_ERROR = 2,
FLANN_LOG_WARN = 3,
FLANN_LOG_INFO = 4
};
enum flann_distance_t {
FLANN_DIST_EUCLIDEAN = 1,

View File

@@ -31,15 +31,20 @@
#ifndef _OPENCV_LOGGER_H_
#define _OPENCV_LOGGER_H_
#include <cstdio>
#include <stdarg.h>
#include "opencv2/flann/general.h"
namespace cvflann
{
enum flann_log_level_t {
FLANN_LOG_NONE = 0,
FLANN_LOG_FATAL = 1,
FLANN_LOG_ERROR = 2,
FLANN_LOG_WARN = 3,
FLANN_LOG_INFO = 4
};
class CV_EXPORTS Logger
{
FILE* stream;

View File

@@ -7,7 +7,6 @@
#include "opencv2/flann/dist.h"
#include "opencv2/flann/index_testing.h"
#include "opencv2/flann/logger.h"
#include "opencv2/flann/saving.h"
#include "opencv2/flann/general.h"

View File

@@ -122,7 +122,7 @@ static bool wasInitialized = false;
- (void)createSliderWithName:(const char *)name maxValue:(int)max value:(int *)value callback:(CvTrackbarCallback)callback;
@end
static void icvCocoaCleanup(void)
/*static void icvCocoaCleanup(void)
{
//cout << "icvCocoaCleanup" << endl;
if( application )
@@ -132,7 +132,7 @@ static void icvCocoaCleanup(void)
application = 0;
[pool release];
}
}
}*/
CV_IMPL int cvInitSystem( int argc, char** argv)
{

View File

@@ -62,7 +62,7 @@ static const uint8 Alog[256] = { 1,2,4,8,16,32,64,128,45,90,180,69,138,57,114,22
169,127,254,209,143,51,102,204,181,71,142,49,98,196,165,103,206,177,79,158,17,34,68,136,61,122,244,197,167,99,
198,161,111,222,145,15,30,60,120,240,205,183,67,134,33,66,132,37,74,148,5,10,20,40,80,160,109,218,153,31,62,
124,248,221,151,3,6,12,24,48,96,192,173,119,238,241,207,179,75,150,1 };
static const uint8 Log[256] = { -255,255,1,240,2,225,241,53,3,38,226,133,242,43,54,210,4,195,39,
static const uint8 Log[256] = { (uchar)-255,255,1,240,2,225,241,53,3,38,226,133,242,43,54,210,4,195,39,
114,227,106,134,28,243,140,44,23,55,118,211,234,5,219,196,96,40,222,115,103,228,78,107,125,
135,8,29,162,244,186,141,180,45,99,24,49,56,13,119,153,212,199,235,91,6,76,220,217,197,11,97,
184,41,36,223,253,116,138,104,193,229,86,79,171,108,165,126,145,136,34,9,74,30,32,163,84,245,
@@ -161,9 +161,9 @@ int Sampler::hasbars()
void Sampler::timing()
{
uint8 dark = getpixel(9, 0);
uint8 light, dark = getpixel(9, 0);
for (int i = 1; i < 3; i += 2) {
uint8 light = getpixel(9, i);
light = getpixel(9, i);
// if (light <= dark)
// goto endo;
dark = getpixel(9, i + 1);

View File

@@ -1394,7 +1394,7 @@ static void cvsubdiv2dpoint_specials(void)
/************************************************************************/
/* convert_to_X: used after PyArg_ParseTuple in the generated code */
static int convert_to_PyObjectPTR(PyObject *o, PyObject **dst, const char *name = "no_name")
/*static int convert_to_PyObjectPTR(PyObject *o, PyObject **dst, const char *name = "no_name")
{
*dst = o;
return 1;
@@ -1404,7 +1404,7 @@ static int convert_to_PyCallableObjectPTR(PyObject *o, PyObject **dst, const cha
{
*dst = o;
return 1;
}
}*/
static int convert_to_char(PyObject *o, char *dst, const char *name = "no_name")
{
@@ -2097,7 +2097,7 @@ static int convert_to_CvArrs(PyObject *o, CvArrs *dst, const char *name = "no_na
return 1;
}
static int convert_to_floatPTRPTR(PyObject *o, float*** dst, const char *name = "no_name")
/*static int convert_to_floatPTRPTR(PyObject *o, float*** dst, const char *name = "no_name")
{
PyObject *fi = PySequence_Fast(o, name);
if (fi == NULL)
@@ -2113,7 +2113,7 @@ static int convert_to_floatPTRPTR(PyObject *o, float*** dst, const char *name =
}
*dst = r;
return 1;
}
}*/
static int convert_to_CvFontPTR(PyObject *o, CvFont** dst, const char *name = "no_name")
{
@@ -2126,7 +2126,7 @@ static int convert_to_CvFontPTR(PyObject *o, CvFont** dst, const char *name = "n
}
}
static int convert_to_CvContourTreePTR(PyObject *o, CvContourTree** dst, const char *name = "no_name")
/*static int convert_to_CvContourTreePTR(PyObject *o, CvContourTree** dst, const char *name = "no_name")
{
if (PyType_IsSubtype(o->ob_type, &cvcontourtree_Type)) {
(*dst) = ((cvcontourtree_t*)o)->a;
@@ -2135,7 +2135,7 @@ static int convert_to_CvContourTreePTR(PyObject *o, CvContourTree** dst, const c
(*dst) = NULL;
return failmsg("Expected CvContourTree for argument '%s'", name);
}
}
}*/
static int convert_to_CvRNGPTR(PyObject *o, CvRNG** dst, const char *name = "no_name")
{
@@ -2607,12 +2607,12 @@ static PyObject *FROM_CvRNG(CvRNG r)
return (PyObject*)m;
}
static PyObject *FROM_CvContourTreePTR(CvContourTree *r)
/*static PyObject *FROM_CvContourTreePTR(CvContourTree *r)
{
cvcontourtree_t *m = PyObject_NEW(cvcontourtree_t, &cvcontourtree_Type);
m->a = r;
return (PyObject*)m;
}
}*/
static PyObject *FROM_generic(generic r)
{
@@ -3690,8 +3690,7 @@ static PyObject *pyfinddatamatrix(PyObject *self, PyObject *args)
ERRWRAP(codes = cvFindDataMatrix(image));
PyObject *pycodes = PyList_New(codes.size());
int i;
for (i = 0; i < codes.size(); i++) {
for (size_t i = 0; i < codes.size(); i++) {
DataMatrixCode *pc = &codes[i];
PyList_SetItem(pycodes, i, Py_BuildValue("(sOO)", pc->msg, FROM_CvMat(pc->corners), FROM_CvMat(pc->original)));
}

View File

@@ -555,7 +555,6 @@ template<typename _Tp> static inline PyObject* pyopencv_from(const vector<_Tp>&
}
static PyObject* pyopencv_from(const KeyPoint&);
static bool pyopencv_from(PyObject*,KeyPoint&,const char*);
template<typename _Tp> static inline bool pyopencv_to_generic_vec(PyObject* obj, vector<_Tp>& value, const char* name="<unknown>")
{