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

pull/13383/head
Vadim Pisarevsky 14 years ago
parent 92852ca06e
commit 23a9b7bb9c
  1. 2
      3rdparty/libjasper/jas_debug.c
  2. 8
      3rdparty/libjasper/jp2_cod.c
  3. 3
      3rdparty/libjasper/jpc_cs.c
  4. 6
      3rdparty/libjasper/jpc_mqdec.c
  5. 4
      3rdparty/libjasper/jpc_mqenc.c
  6. 2
      3rdparty/libjasper/jpc_t2dec.c
  7. 4
      3rdparty/libjpeg/transupp.c
  8. 2
      3rdparty/libtiff/tif_predict.c
  9. 12
      3rdparty/libtiff/tif_unix.c
  10. 4
      modules/calib3d/src/circlesgrid.cpp
  11. 5
      modules/features2d/test/test_features2d.cpp
  12. 8
      modules/flann/include/opencv2/flann/general.h
  13. 13
      modules/flann/include/opencv2/flann/logger.h
  14. 1
      modules/flann/src/precomp.hpp
  15. 4
      modules/highgui/src/window_cocoa.mm
  16. 6
      modules/objdetect/src/datamatrix.cpp
  17. 19
      modules/python/src/cv.cpp
  18. 1
      modules/python/src/opencv2x.h

@ -125,7 +125,7 @@ int jas_memdump(FILE *out, void *data, size_t len)
uchar *dp;
dp = data;
for (i = 0; i < len; i += 16) {
fprintf(out, "%04x:", i);
fprintf(out, "%04x:", (int)i);
for (j = 0; j < 16; ++j) {
if (i + j < len) {
fprintf(out, " %02x", dp[i + j]);

@ -490,18 +490,18 @@ int jp2_box_put(jp2_box_t *box, jas_stream_t *out)
box->len = jas_stream_tell(tmpstream) + JP2_BOX_HDRLEN(false);
jas_stream_rewind(tmpstream);
}
extlen = (box->len >= (((uint_fast64_t)1) << 32)) != 0;
if (jp2_putuint32(out, extlen ? 1 : box->len)) {
//extlen = (box->len >= (((uint_fast64_t)1) << 32)) != 0;
if (jp2_putuint32(out, /*extlen ? 1 :*/ box->len)) {
goto error;
}
if (jp2_putuint32(out, box->type)) {
goto error;
}
if (extlen) {
/*if (extlen) {
if (jp2_putuint64(out, box->len)) {
goto error;
}
}
}*/
if (dataflag) {
if (jas_stream_copy(out, tmpstream, box->len - JP2_BOX_HDRLEN(false))) {

@ -240,8 +240,7 @@ jpc_ms_t *jpc_getms(jas_stream_t *in, jpc_cstate_t *cstate)
}
/* Get the marker type. */
if (jpc_getuint16(in, &ms->id) || ms->id < JPC_MS_MIN ||
ms->id > JPC_MS_MAX) {
if (jpc_getuint16(in, &ms->id) || ms->id < JPC_MS_MIN /*|| ms->id > JPC_MS_MAX*/) {
jpc_ms_destroy(ms);
return 0;
}

@ -300,7 +300,7 @@ void jpc_mqdec_dump(jpc_mqdec_t *mqdec, FILE *out)
fprintf(out, "MQDEC A = %08lx, C = %08lx, CT=%08lx, ",
(unsigned long) mqdec->areg, (unsigned long) mqdec->creg,
(unsigned long) mqdec->ctreg);
fprintf(out, "CTX = %d, ", mqdec->curctx - mqdec->ctxs);
fprintf(out, "IND %d, MPS %d, QEVAL %x\n", *mqdec->curctx -
jpc_mqstates, (*mqdec->curctx)->mps, (*mqdec->curctx)->qeval);
fprintf(out, "CTX = %d, ", (int)(mqdec->curctx - mqdec->ctxs));
fprintf(out, "IND %d, MPS %d, QEVAL %x\n", (int)(*mqdec->curctx -
jpc_mqstates), (int)(*mqdec->curctx)->mps, (int)(*mqdec->curctx)->qeval);
}

@ -386,7 +386,7 @@ int jpc_mqenc_dump(jpc_mqenc_t *mqenc, FILE *out)
fprintf(out, "AREG = %08x, CREG = %08x, CTREG = %d\n",
mqenc->areg, mqenc->creg, mqenc->ctreg);
fprintf(out, "IND = %02d, MPS = %d, QEVAL = %04x\n",
*mqenc->curctx - jpc_mqstates, (*mqenc->curctx)->mps,
(*mqenc->curctx)->qeval);
(int)(*mqenc->curctx - jpc_mqstates), (int)(*mqenc->curctx)->mps,
(int)(*mqenc->curctx)->qeval);
return 0;
}

@ -574,7 +574,7 @@ long jpc_dec_lookahead(jas_stream_t *in)
jas_stream_ungetc(in, x >> 8) == EOF) {
return -1;
}
if (x >= JPC_MS_INMIN && x <= JPC_MS_INMAX) {
if (x >= JPC_MS_INMIN /*&& x <= JPC_MS_INMAX*/) {
return x;
}
return 0;

@ -1309,6 +1309,8 @@ jtransform_adjust_parameters (j_decompress_ptr srcinfo,
case JXFORM_ROT_270:
transpose_critical_parameters(dstinfo);
break;
default:
break;
}
/* Adjust Exif properties */
@ -1446,6 +1448,8 @@ jtransform_perfect_transform(JDIMENSION image_width, JDIMENSION image_height,
if (image_height % (JDIMENSION) MCU_height)
result = FALSE;
break;
default:
break;
}
return result;

@ -584,7 +584,7 @@ PredictorEncodeTile(TIFF* tif, tidata_t bp0, tsize_t cc0, tsample_t s)
{
TIFFErrorExt(tif->tif_clientdata, module,
"Out of memory allocating %d byte temp buffer.",
cc0 );
(int)cc0 );
return 0;
}
memcpy( working_copy, bp0, cc0 );

@ -51,25 +51,25 @@
static tsize_t
_tiffReadProc(thandle_t fd, tdata_t buf, tsize_t size)
{
return ((tsize_t) read((int) fd, buf, (size_t) size));
return ((tsize_t) read((int) (size_t)fd, buf, (size_t) size));
}
static tsize_t
_tiffWriteProc(thandle_t fd, tdata_t buf, tsize_t size)
{
return ((tsize_t) write((int) fd, buf, (size_t) size));
return ((tsize_t) write((int) (size_t)fd, buf, (size_t) size));
}
static toff_t
_tiffSeekProc(thandle_t fd, toff_t off, int whence)
{
return ((toff_t) lseek((int) fd, (off_t) off, whence));
return ((toff_t) lseek((int) (size_t)fd, (off_t) off, whence));
}
static int
_tiffCloseProc(thandle_t fd)
{
return (close((int) fd));
return (close((int) (size_t)fd));
}
@ -81,7 +81,7 @@ _tiffSizeProc(thandle_t fd)
return ((fsize = lseek((int) fd, 0, SEEK_END)) < 0 ? 0 : fsize);
#else
struct stat sb;
return (toff_t) (fstat((int) fd, &sb) < 0 ? 0 : sb.st_size);
return (toff_t) (fstat((int) (size_t)fd, &sb) < 0 ? 0 : sb.st_size);
#endif
}
@ -133,7 +133,7 @@ TIFFFdOpen(int fd, const char* name, const char* mode)
TIFF* tif;
tif = TIFFClientOpen(name, mode,
(thandle_t) fd,
(thandle_t) (size_t)fd,
_tiffReadProc, _tiffWriteProc,
_tiffSeekProc, _tiffCloseProc, _tiffSizeProc,
_tiffMapProc, _tiffUnmapProc);

@ -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;
}

@ -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;

@ -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,

@ -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;

@ -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"

@ -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)
{

@ -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);

@ -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)));
}

@ -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>")
{

Loading…
Cancel
Save