Fix OS X build warnings

This commit is contained in:
Andrey Kamaev 2012-10-22 19:13:29 +04:00
parent 40030d2ca0
commit 2e91405833
9 changed files with 52 additions and 24 deletions

View File

@ -182,10 +182,20 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use )
_PCH_GET_TARGET_COMPILE_FLAGS(_target_cflags ${_name} ${_pch_output_to_use} ${_dowarn})
#MESSAGE("Add flags ${_target_cflags} to ${_targetName} " )
SET_TARGET_PROPERTIES(${_targetName}
PROPERTIES
COMPILE_FLAGS ${_target_cflags}
)
GET_TARGET_PROPERTY(_sources ${_targetName} SOURCES)
FOREACH(src ${_sources})
if(NOT "${src}" MATCHES "\\.mm$")
get_source_file_property(_flags "${src}" COMPILE_FLAGS)
if(_flags)
set(_flags "${_flags} ${_target_cflags}")
else()
set(_flags "${_target_cflags}")
endif()
set_source_files_properties("${src}" PROPERTIES COMPILE_FLAGS "${_flags}")
endif()
ENDFOREACH()
ADD_CUSTOM_TARGET(pch_Generate_${_targetName}
DEPENDS ${_pch_output_to_use}

View File

@ -59,6 +59,9 @@
# ifdef ANDROID
template <typename Scalar> Scalar log2(Scalar v) { using std::log; return log(v)/log(Scalar(2)); }
# endif
# if defined __GNUC__ && defined __APPLE__
# pragma GCC diagnostic ignored "-Wshadow"
# endif
# include <unsupported/Eigen/MatrixFunctions>
# include <Eigen/Dense>
#endif

View File

@ -503,6 +503,9 @@ bool CvCaptureCAM::setProperty(int property_id, double value) {
didOutputVideoFrame:(CVImageBufferRef)videoFrame
withSampleBuffer:(QTSampleBuffer *)sampleBuffer
fromConnection:(QTCaptureConnection *)connection {
(void)captureOutput;
(void)sampleBuffer;
(void)connection;
CVBufferRetain(videoFrame);
CVImageBufferRef imageBufferToRelease = mCurrentImageBuffer;
@ -519,6 +522,9 @@ bool CvCaptureCAM::setProperty(int property_id, double value) {
- (void)captureOutput:(QTCaptureOutput *)captureOutput
didDropVideoFrameWithSampleBuffer:(QTSampleBuffer *)sampleBuffer
fromConnection:(QTCaptureConnection *)connection {
(void)captureOutput;
(void)sampleBuffer;
(void)connection;
cout << "Camera dropped frame!" << endl;
}

View File

@ -48,6 +48,10 @@
# pragma warning( disable: 4100 4244 4267 )
#endif
#if defined __GNUC__ && defined __APPLE__
# pragma GCC diagnostic ignored "-Wshadow"
#endif
#include <ImfHeader.h>
#include <ImfInputFile.h>
#include <ImfOutputFile.h>

View File

@ -45,6 +45,10 @@
#ifdef HAVE_OPENEXR
#if defined __GNUC__ && defined __APPLE__
# pragma GCC diagnostic ignored "-Wshadow"
#endif
#include <ImfChromaticities.h>
#include <ImfInputFile.h>
#include <ImfChannelList.h>

View File

@ -136,7 +136,7 @@ static bool wasInitialized = false;
}
}*/
CV_IMPL int cvInitSystem( int argc, char** argv)
CV_IMPL int cvInitSystem( int , char** )
{
//cout << "cvInitSystem" << endl;
wasInitialized = true;
@ -159,7 +159,7 @@ CV_IMPL int cvInitSystem( int argc, char** argv)
return 0;
}
CVWindow *cvGetWindow(const char *name) {
static CVWindow *cvGetWindow(const char *name) {
//cout << "cvGetWindow" << endl;
NSAutoreleasePool* localpool = [[NSAutoreleasePool alloc] init];
NSString *cvname = [NSString stringWithFormat:@"%s", name];
@ -614,6 +614,7 @@ void cvSetModeWindow_COCOA( const char* name, double prop_value )
@synthesize status;
- (void)cvSendMouseEvent:(NSEvent *)event type:(int)type flags:(int)flags {
(void)event;
//cout << "cvSendMouseEvent" << endl;
NSPoint mp = [NSEvent mouseLocation];
//NSRect visible = [[self contentView] frame];
@ -924,6 +925,7 @@ void cvSetModeWindow_COCOA( const char* name, double prop_value )
}
- (void)sliderChanged:(NSNotification *)notification {
(void)notification;
int pos = [slider intValue];
if(value)
*value = pos;

View File

@ -169,7 +169,7 @@ private:
__instype *split = median;
for (; split != last && deref(ctor(*split), dim) ==
deref(ctor(*median), dim); ++split);
deref(ctor(*median), dim); ++split) {}
if (split == last) { // leaf
int nexti = -1;
@ -387,9 +387,8 @@ public:
// ret_nn_pq is an array containing the (at most) k nearest neighbors
// (see bbf_nn structure def above).
template < class __desctype >
int find_nn_bbf(const __desctype * d,
int k, int emax,
bbf_nn_pqueue & ret_nn_pq) const {
int find_nn_bbf(const __desctype * d, int k, int emax, bbf_nn_pqueue & ret_nn_pq) const
{
assert(k > 0);
ret_nn_pq.clear();
@ -400,7 +399,8 @@ public:
// iterate while queue non-empty and emax>0
tmp_pq.clear();
tmp_pq.push_back(bbf_node(root_node, 0));
while (tmp_pq.size() && emax > 0) {
while (tmp_pq.size() && emax > 0)
{
// from node nearest query point d, run to leaf
std::pop_heap(tmp_pq.begin(), tmp_pq.end());
@ -408,18 +408,17 @@ public:
tmp_pq.erase(tmp_pq.end() - 1);
int i;
for (i = bbf.node;
i != -1 && nodes[i].dim >= 0;
i = bbf_branch(i, d, tmp_pq));
for (i = bbf.node; i != -1 && nodes[i].dim >= 0; i = bbf_branch(i, d, tmp_pq)) {}
if (i != -1) {
if (i != -1)
{
// add points in leaf/bin to ret_nn_pq
do {
bbf_new_nn(ret_nn_pq, k, d, nodes[i].value);
} while (-1 != (i = nodes[i].right));
// add points in leaf/bin to ret_nn_pq
do {
bbf_new_nn(ret_nn_pq, k, d, nodes[i].value);
} while (-1 != (i = nodes[i].right));
--emax;
--emax;
}
}

View File

@ -414,7 +414,7 @@ static void icvFindStereoCorrespondenceByBirchfieldDP( uchar* src1, uchar* src2,
for( x = 1; x < imgW; x++ )
{
i = x - 1;
for( ; x < imgW && dest[y*widthStep+x] == dest[y*widthStep+x-1]; x++ );
for( ; x < imgW && dest[y*widthStep+x] == dest[y*widthStep+x-1]; x++ ) {}
s = x - i;
for( ; i < x; i++ )
{

View File

@ -633,7 +633,7 @@ static CvTestSeqElem* icvTestSeqReadElemOne(CvTestSeq_* pTS, CvFileStorage* fs,
for(i0=0, i1=1; i1<KeyFrameNum;)
{
for(i1=i0+1; i1<KeyFrameNum && KeyFrames[i1]<0; i1++);
for(i1=i0+1; i1<KeyFrameNum && KeyFrames[i1]<0; i1++) {}
assert(i1<KeyFrameNum);
assert(i1>i0);
@ -779,7 +779,7 @@ static CvTestSeqElem* icvTestSeqReadElemAll(CvTestSeq_* pTS, CvFileStorage* fs,
}
/* Find last element: */
for(pElemLast=pElemNew;pElemLast && pElemLast->next;pElemLast= pElemLast->next);
for(pElemLast=pElemNew;pElemLast && pElemLast->next;pElemLast= pElemLast->next) {}
} /* Next element. */
} /* Read all element in sequence. */
@ -842,7 +842,7 @@ CvTestSeq* cvCreateTestSeq(char* pConfigfile, char** videos, int numvideo, float
else
{
CvTestSeqElem* p = NULL;
for(p=pTS->pElemList;p->next;p=p->next);
for(p=pTS->pElemList;p->next;p=p->next) {}
p->next = pElemNew;
}
} /* Read all videos. */