Commit 0fec2eb6 authored by Andrey Pavlenko's avatar Andrey Pavlenko Committed by OpenCV Buildbot

Merge pull request #879 from apavlenko:gcc-4.8

parents e4d4b07f 2665c39a
...@@ -23,7 +23,8 @@ if(WIN32 AND NOT MINGW) ...@@ -23,7 +23,8 @@ if(WIN32 AND NOT MINGW)
add_definitions(-DJAS_WIN_MSVC_BUILD) add_definitions(-DJAS_WIN_MSVC_BUILD)
endif(WIN32 AND NOT MINGW) endif(WIN32 AND NOT MINGW)
ocv_warnings_disable(CMAKE_C_FLAGS -Wno-implicit-function-declaration -Wno-uninitialized -Wmissing-prototypes -Wmissing-declarations -Wunused -Wshadow -Wsign-compare) ocv_warnings_disable(CMAKE_C_FLAGS -Wno-implicit-function-declaration -Wno-uninitialized -Wmissing-prototypes
-Wno-unused-but-set-parameter -Wmissing-declarations -Wunused -Wshadow -Wsign-compare)
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang
ocv_warnings_disable(CMAKE_C_FLAGS /wd4013 /wd4018 /wd4101 /wd4244 /wd4267 /wd4715) # vs2005 ocv_warnings_disable(CMAKE_C_FLAGS /wd4013 /wd4018 /wd4101 /wd4244 /wd4267 /wd4715) # vs2005
......
...@@ -101,7 +101,7 @@ endif() ...@@ -101,7 +101,7 @@ endif()
if(MSVC64 OR MINGW64) if(MSVC64 OR MINGW64)
set(X86_64 1) set(X86_64 1)
elseif(MSVC AND NOT CMAKE_CROSSCOMPILING) elseif(MINGW OR (MSVC AND NOT CMAKE_CROSSCOMPILING))
set(X86 1) set(X86 1)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*") elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
set(X86_64 1) set(X86_64 1)
......
...@@ -42,7 +42,6 @@ template <typename Distance> ...@@ -42,7 +42,6 @@ template <typename Distance>
void find_nearest(const Matrix<typename Distance::ElementType>& dataset, typename Distance::ElementType* query, int* matches, int nn, void find_nearest(const Matrix<typename Distance::ElementType>& dataset, typename Distance::ElementType* query, int* matches, int nn,
int skip = 0, Distance distance = Distance()) int skip = 0, Distance distance = Distance())
{ {
typedef typename Distance::ElementType ElementType;
typedef typename Distance::ResultType DistanceType; typedef typename Distance::ResultType DistanceType;
int n = nn + skip; int n = nn + skip;
......
...@@ -52,6 +52,11 @@ ...@@ -52,6 +52,11 @@
#include <stdio.h> #include <stdio.h>
#include <setjmp.h> #include <setjmp.h>
// the following defines are a hack to avoid multiple problems with frame ponter handling and setjmp
// see http://gcc.gnu.org/ml/gcc/2011-10/msg00324.html for some details
#define mingw_getsp(...) 0
#define __builtin_frame_address(...) 0
#ifdef WIN32 #ifdef WIN32
#define XMD_H // prevent redefinition of INT32 #define XMD_H // prevent redefinition of INT32
......
...@@ -73,6 +73,11 @@ ...@@ -73,6 +73,11 @@
#pragma warning( disable: 4611 ) #pragma warning( disable: 4611 )
#endif #endif
// the following defines are a hack to avoid multiple problems with frame ponter handling and setjmp
// see http://gcc.gnu.org/ml/gcc/2011-10/msg00324.html for some details
#define mingw_getsp(...) 0
#define __builtin_frame_address(...) 0
namespace cv namespace cv
{ {
......
...@@ -93,7 +93,6 @@ icvFloodFill_CnIR( uchar* pImage, int step, CvSize roi, CvPoint seed, ...@@ -93,7 +93,6 @@ icvFloodFill_CnIR( uchar* pImage, int step, CvSize roi, CvPoint seed,
_Tp newVal, CvConnectedComp* region, int flags, _Tp newVal, CvConnectedComp* region, int flags,
std::vector<CvFFillSegment>* buffer ) std::vector<CvFFillSegment>* buffer )
{ {
typedef typename cv::DataType<_Tp>::channel_type _CTp;
_Tp* img = (_Tp*)(pImage + step * seed.y); _Tp* img = (_Tp*)(pImage + step * seed.y);
int i, L, R; int i, L, R;
int area = 0; int area = 0;
...@@ -252,7 +251,6 @@ icvFloodFillGrad_CnIR( uchar* pImage, int step, uchar* pMask, int maskStep, ...@@ -252,7 +251,6 @@ icvFloodFillGrad_CnIR( uchar* pImage, int step, uchar* pMask, int maskStep,
CvConnectedComp* region, int flags, CvConnectedComp* region, int flags,
std::vector<CvFFillSegment>* buffer ) std::vector<CvFFillSegment>* buffer )
{ {
typedef typename cv::DataType<_Tp>::channel_type _CTp;
_Tp* img = (_Tp*)(pImage + step*seed.y); _Tp* img = (_Tp*)(pImage + step*seed.y);
uchar* mask = (pMask += maskStep + 1) + maskStep*seed.y; uchar* mask = (pMask += maskStep + 1) + maskStep*seed.y;
int i, L, R; int i, L, R;
......
...@@ -1219,8 +1219,6 @@ static void resizeGeneric_( const Mat& src, Mat& dst, ...@@ -1219,8 +1219,6 @@ static void resizeGeneric_( const Mat& src, Mat& dst,
const int* yofs, const void* _beta, const int* yofs, const void* _beta,
int xmin, int xmax, int ksize ) int xmin, int xmax, int ksize )
{ {
typedef typename HResize::value_type T;
typedef typename HResize::buf_type WT;
typedef typename HResize::alpha_type AT; typedef typename HResize::alpha_type AT;
const AT* beta = (const AT*)_beta; const AT* beta = (const AT*)_beta;
......
...@@ -61,7 +61,7 @@ protected: ...@@ -61,7 +61,7 @@ protected:
{ {
int ObjNum = m_TrackList.GetBlobNum(); int ObjNum = m_TrackList.GetBlobNum();
int i; int i;
char video_name[1024]; char video_name[1024+1];
char* struct_name = NULL; char* struct_name = NULL;
CvFileStorage* storage = cvOpenFileStorage(m_pFileName,NULL,CV_STORAGE_WRITE_TEXT); CvFileStorage* storage = cvOpenFileStorage(m_pFileName,NULL,CV_STORAGE_WRITE_TEXT);
......
...@@ -117,10 +117,10 @@ class CvKDTreeWrap : public CvFeatureTree { ...@@ -117,10 +117,10 @@ class CvKDTreeWrap : public CvFeatureTree {
CvMat* results) { CvMat* results) {
int rn = results->rows * results->cols; int rn = results->rows * results->cols;
std::vector<int> inbounds; std::vector<int> inbounds;
dispatch_cvtype(mat, ((__treetype*)data)-> assert(CV_MAT_DEPTH(mat->type) == CV_32F || CV_MAT_DEPTH(mat->type) == CV_64F);
find_ortho_range((typename __treetype::scalar_type*)bounds_min->data.ptr, ((__treetype*)data)->find_ortho_range((typename __treetype::scalar_type*)bounds_min->data.ptr,
(typename __treetype::scalar_type*)bounds_max->data.ptr, (typename __treetype::scalar_type*)bounds_max->data.ptr,
inbounds)); inbounds);
std::copy(inbounds.begin(), std::copy(inbounds.begin(),
inbounds.begin() + std::min((int)inbounds.size(), rn), inbounds.begin() + std::min((int)inbounds.size(), rn),
(int*) results->data.ptr); (int*) results->data.ptr);
......
...@@ -65,12 +65,12 @@ namespace cv ...@@ -65,12 +65,12 @@ namespace cv
static const int OPT_SIZE = 100; static const int OPT_SIZE = 100;
static const char * T_ARR [] = { static const char * T_ARR [] = {
"uchar", "uchar",
"char", "char",
"ushort", "ushort",
"short", "short",
"int", "int",
"float -D T_FLOAT", "float -D T_FLOAT",
"double"}; "double"};
template < int BLOCK_SIZE, int MAX_DESC_LEN/*, typename Mask*/ > template < int BLOCK_SIZE, int MAX_DESC_LEN/*, typename Mask*/ >
...@@ -86,8 +86,8 @@ void matchUnrolledCached(const oclMat &query, const oclMat &train, const oclMat ...@@ -86,8 +86,8 @@ void matchUnrolledCached(const oclMat &query, const oclMat &train, const oclMat
vector< pair<size_t, const void *> > args; vector< pair<size_t, const void *> > args;
char opt [OPT_SIZE] = ""; char opt [OPT_SIZE] = "";
sprintf(opt, sprintf(opt,
"-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d -D MAX_DESC_LEN=%d", "-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d -D MAX_DESC_LEN=%d",
T_ARR[query.depth()], distType, block_size, m_size); T_ARR[query.depth()], distType, block_size, m_size);
if(globalSize[0] != 0) if(globalSize[0] != 0)
...@@ -128,8 +128,8 @@ void match(const oclMat &query, const oclMat &train, const oclMat &/*mask*/, ...@@ -128,8 +128,8 @@ void match(const oclMat &query, const oclMat &train, const oclMat &/*mask*/,
vector< pair<size_t, const void *> > args; vector< pair<size_t, const void *> > args;
char opt [OPT_SIZE] = ""; char opt [OPT_SIZE] = "";
sprintf(opt, sprintf(opt,
"-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d", "-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d",
T_ARR[query.depth()], distType, block_size); T_ARR[query.depth()], distType, block_size);
if(globalSize[0] != 0) if(globalSize[0] != 0)
{ {
...@@ -171,8 +171,8 @@ void matchUnrolledCached(const oclMat &query, const oclMat &train, float maxDist ...@@ -171,8 +171,8 @@ void matchUnrolledCached(const oclMat &query, const oclMat &train, float maxDist
vector< pair<size_t, const void *> > args; vector< pair<size_t, const void *> > args;
char opt [OPT_SIZE] = ""; char opt [OPT_SIZE] = "";
sprintf(opt, sprintf(opt,
"-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d -D MAX_DESC_LEN=%d", "-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d -D MAX_DESC_LEN=%d",
T_ARR[query.depth()], distType, block_size, m_size); T_ARR[query.depth()], distType, block_size, m_size);
if(globalSize[0] != 0) if(globalSize[0] != 0)
...@@ -212,8 +212,8 @@ void radius_match(const oclMat &query, const oclMat &train, float maxDistance, c ...@@ -212,8 +212,8 @@ void radius_match(const oclMat &query, const oclMat &train, float maxDistance, c
vector< pair<size_t, const void *> > args; vector< pair<size_t, const void *> > args;
char opt [OPT_SIZE] = ""; char opt [OPT_SIZE] = "";
sprintf(opt, sprintf(opt,
"-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d", "-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d",
T_ARR[query.depth()], distType, block_size); T_ARR[query.depth()], distType, block_size);
if(globalSize[0] != 0) if(globalSize[0] != 0)
...@@ -312,8 +312,8 @@ void knn_matchUnrolledCached(const oclMat &query, const oclMat &train, const ocl ...@@ -312,8 +312,8 @@ void knn_matchUnrolledCached(const oclMat &query, const oclMat &train, const ocl
vector< pair<size_t, const void *> > args; vector< pair<size_t, const void *> > args;
char opt [OPT_SIZE] = ""; char opt [OPT_SIZE] = "";
sprintf(opt, sprintf(opt,
"-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d -D MAX_DESC_LEN=%d", "-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d -D MAX_DESC_LEN=%d",
T_ARR[query.depth()], distType, block_size, m_size); T_ARR[query.depth()], distType, block_size, m_size);
if(globalSize[0] != 0) if(globalSize[0] != 0)
...@@ -348,8 +348,8 @@ void knn_match(const oclMat &query, const oclMat &train, const oclMat &/*mask*/, ...@@ -348,8 +348,8 @@ void knn_match(const oclMat &query, const oclMat &train, const oclMat &/*mask*/,
vector< pair<size_t, const void *> > args; vector< pair<size_t, const void *> > args;
char opt [OPT_SIZE] = ""; char opt [OPT_SIZE] = "";
sprintf(opt, sprintf(opt,
"-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d", "-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d",
T_ARR[query.depth()], distType, block_size); T_ARR[query.depth()], distType, block_size);
if(globalSize[0] != 0) if(globalSize[0] != 0)
...@@ -384,8 +384,8 @@ void calcDistanceUnrolled(const oclMat &query, const oclMat &train, const oclMat ...@@ -384,8 +384,8 @@ void calcDistanceUnrolled(const oclMat &query, const oclMat &train, const oclMat
vector< pair<size_t, const void *> > args; vector< pair<size_t, const void *> > args;
char opt [OPT_SIZE] = ""; char opt [OPT_SIZE] = "";
sprintf(opt, sprintf(opt,
"-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d -D MAX_DESC_LEN=%d", "-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d -D MAX_DESC_LEN=%d",
T_ARR[query.depth()], distType, block_size, m_size); T_ARR[query.depth()], distType, block_size, m_size);
if(globalSize[0] != 0) if(globalSize[0] != 0)
...@@ -420,8 +420,8 @@ void calcDistance(const oclMat &query, const oclMat &train, const oclMat &/*mask ...@@ -420,8 +420,8 @@ void calcDistance(const oclMat &query, const oclMat &train, const oclMat &/*mask
vector< pair<size_t, const void *> > args; vector< pair<size_t, const void *> > args;
char opt [OPT_SIZE] = ""; char opt [OPT_SIZE] = "";
sprintf(opt, sprintf(opt,
"-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d", "-D T=%s -D DIST_TYPE=%d -D BLOCK_SIZE=%d",
T_ARR[query.depth()], distType, block_size); T_ARR[query.depth()], distType, block_size);
if(globalSize[0] != 0) if(globalSize[0] != 0)
...@@ -561,7 +561,7 @@ void cv::ocl::BruteForceMatcher_OCL_base::matchSingle(const oclMat &query, const ...@@ -561,7 +561,7 @@ void cv::ocl::BruteForceMatcher_OCL_base::matchSingle(const oclMat &query, const
{ {
if (query.empty() || train.empty()) if (query.empty() || train.empty())
return; return;
CV_Assert(query.channels() == 1 && query.depth() < CV_64F); CV_Assert(query.channels() == 1 && query.depth() < CV_64F);
CV_Assert(train.cols == query.cols && train.type() == query.type()); CV_Assert(train.cols == query.cols && train.type() == query.type());
...@@ -673,7 +673,7 @@ void cv::ocl::BruteForceMatcher_OCL_base::matchCollection(const oclMat &query, c ...@@ -673,7 +673,7 @@ void cv::ocl::BruteForceMatcher_OCL_base::matchCollection(const oclMat &query, c
return; return;
CV_Assert(query.channels() == 1 && query.depth() < CV_64F); CV_Assert(query.channels() == 1 && query.depth() < CV_64F);
const int nQuery = query.rows; const int nQuery = query.rows;
ensureSizeIsEnough(1, nQuery, CV_32S, trainIdx); ensureSizeIsEnough(1, nQuery, CV_32S, trainIdx);
...@@ -845,8 +845,8 @@ void cv::ocl::BruteForceMatcher_OCL_base::knnMatch2Collection(const oclMat &quer ...@@ -845,8 +845,8 @@ void cv::ocl::BruteForceMatcher_OCL_base::knnMatch2Collection(const oclMat &quer
if (query.empty() || trainCollection.empty()) if (query.empty() || trainCollection.empty())
return; return;
typedef void (*caller_t)(const oclMat & query, const oclMat & trains, const oclMat & masks, // typedef void (*caller_t)(const oclMat & query, const oclMat & trains, const oclMat & masks,
const oclMat & trainIdx, const oclMat & imgIdx, const oclMat & distance); // const oclMat & trainIdx, const oclMat & imgIdx, const oclMat & distance);
CV_Assert(query.channels() == 1 && query.depth() < CV_64F); CV_Assert(query.channels() == 1 && query.depth() < CV_64F);
...@@ -993,7 +993,7 @@ void cv::ocl::BruteForceMatcher_OCL_base::knnMatch(const oclMat &query, vector< ...@@ -993,7 +993,7 @@ void cv::ocl::BruteForceMatcher_OCL_base::knnMatch(const oclMat &query, vector<
// radiusMatchSingle // radiusMatchSingle
void cv::ocl::BruteForceMatcher_OCL_base::radiusMatchSingle(const oclMat &query, const oclMat &train, void cv::ocl::BruteForceMatcher_OCL_base::radiusMatchSingle(const oclMat &query, const oclMat &train,
oclMat &trainIdx, oclMat &distance, oclMat &nMatches, float maxDistance, const oclMat &mask) oclMat &trainIdx, oclMat &distance, oclMat &nMatches, float maxDistance, const oclMat &mask)
{ {
if (query.empty() || train.empty()) if (query.empty() || train.empty())
return; return;
...@@ -1095,9 +1095,9 @@ void cv::ocl::BruteForceMatcher_OCL_base::radiusMatchCollection(const oclMat &qu ...@@ -1095,9 +1095,9 @@ void cv::ocl::BruteForceMatcher_OCL_base::radiusMatchCollection(const oclMat &qu
if (query.empty() || empty()) if (query.empty() || empty())
return; return;
#if 0
typedef void (*caller_t)(const oclMat & query, const oclMat * trains, int n, float maxDistance, const oclMat * masks, typedef void (*caller_t)(const oclMat & query, const oclMat * trains, int n, float maxDistance, const oclMat * masks,
const oclMat & trainIdx, const oclMat & imgIdx, const oclMat & distance, const oclMat & nMatches); const oclMat & trainIdx, const oclMat & imgIdx, const oclMat & distance, const oclMat & nMatches);
#if 0
static const caller_t callers[3][6] = static const caller_t callers[3][6] =
{ {
{ {
......
...@@ -60,7 +60,7 @@ void cv::ocl::gemm(const oclMat &src1, const oclMat &src2, double alpha, ...@@ -60,7 +60,7 @@ void cv::ocl::gemm(const oclMat &src1, const oclMat &src2, double alpha,
const oclMat &src3, double beta, oclMat &dst, int flags) const oclMat &src3, double beta, oclMat &dst, int flags)
{ {
CV_Assert(src1.cols == src2.rows && CV_Assert(src1.cols == src2.rows &&
(src3.empty() || src1.rows == src3.rows && src2.cols == src3.cols)); (src3.empty() || (src1.rows == src3.rows && src2.cols == src3.cols)));
CV_Assert(!(cv::GEMM_3_T & flags)); // cv::GEMM_3_T is not supported CV_Assert(!(cv::GEMM_3_T & flags)); // cv::GEMM_3_T is not supported
if(!src3.empty()) if(!src3.empty())
{ {
......
...@@ -145,7 +145,8 @@ typedef struct ...@@ -145,7 +145,8 @@ typedef struct
int imgoff; int imgoff;
float factor; float factor;
} detect_piramid_info; } detect_piramid_info;
#ifdef WIN32
#if defined WIN32 && !defined __MINGW__ && !defined __MINGW32__
#define _ALIGNED_ON(_ALIGNMENT) __declspec(align(_ALIGNMENT)) #define _ALIGNED_ON(_ALIGNMENT) __declspec(align(_ALIGNMENT))
typedef _ALIGNED_ON(128) struct GpuHidHaarFeature typedef _ALIGNED_ON(128) struct GpuHidHaarFeature
{ {
......
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