Skip to content

Commit bcd0aef

Browse files
author
Andrey Kamaev
committed
Fix gcc build errors and warnings
1 parent 5eac041 commit bcd0aef

File tree

6 files changed

+147
-138
lines changed

6 files changed

+147
-138
lines changed

3rdparty/libjasper/jpc_qmfb.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@
9494
#define QMFB_SPLITBUFSIZE 4096
9595
#define QMFB_JOINBUFSIZE 4096
9696

97-
int jpc_ft_analyze(jpc_fix_t *a, int xstart, int ystart, int width, int height,
97+
int jpc_ft_analyze(int *a, int xstart, int ystart, int width, int height,
9898
int stride);
9999
int jpc_ft_synthesize(int *a, int xstart, int ystart, int width, int height,
100100
int stride);
101101

102-
int jpc_ns_analyze(jpc_fix_t *a, int xstart, int ystart, int width, int height,
102+
int jpc_ns_analyze(int *a, int xstart, int ystart, int width, int height,
103103
int stride);
104-
int jpc_ns_synthesize(jpc_fix_t *a, int xstart, int ystart, int width,
104+
int jpc_ns_synthesize(int *a, int xstart, int ystart, int width,
105105
int height, int stride);
106106

107107
void jpc_ft_fwdlift_row(jpc_fix_t *a, int numcols, int parity);
@@ -1556,7 +1556,7 @@ void jpc_ft_invlift_colres(jpc_fix_t *a, int numrows, int numcols, int stride,
15561556

15571557
}
15581558

1559-
int jpc_ft_analyze(jpc_fix_t *a, int xstart, int ystart, int width, int height,
1559+
int jpc_ft_analyze(int *a, int xstart, int ystart, int width, int height,
15601560
int stride)
15611561
{
15621562
int numrows = height;
@@ -1568,7 +1568,7 @@ int jpc_ft_analyze(jpc_fix_t *a, int xstart, int ystart, int width, int height,
15681568
int maxcols;
15691569

15701570
maxcols = (numcols / JPC_QMFB_COLGRPSIZE) * JPC_QMFB_COLGRPSIZE;
1571-
startptr = &a[0];
1571+
startptr = (jpc_fix_t*)&a[0];
15721572
for (i = 0; i < maxcols; i += JPC_QMFB_COLGRPSIZE) {
15731573
jpc_qmfb_split_colgrp(startptr, numrows, stride, rowparity);
15741574
jpc_ft_fwdlift_colgrp(startptr, numrows, stride, rowparity);
@@ -1581,7 +1581,7 @@ int jpc_ft_analyze(jpc_fix_t *a, int xstart, int ystart, int width, int height,
15811581
rowparity);
15821582
}
15831583

1584-
startptr = &a[0];
1584+
startptr = (jpc_fix_t*)&a[0];
15851585
for (i = 0; i < numrows; ++i) {
15861586
jpc_qmfb_split_row(startptr, numcols, colparity);
15871587
jpc_ft_fwdlift_row(startptr, numcols, colparity);
@@ -1604,15 +1604,15 @@ int jpc_ft_synthesize(int *a, int xstart, int ystart, int width, int height,
16041604
jpc_fix_t *startptr;
16051605
int i;
16061606

1607-
startptr = &a[0];
1607+
startptr = (jpc_fix_t*)&a[0];
16081608
for (i = 0; i < numrows; ++i) {
16091609
jpc_ft_invlift_row(startptr, numcols, colparity);
16101610
jpc_qmfb_join_row(startptr, numcols, colparity);
16111611
startptr += stride;
16121612
}
16131613

16141614
maxcols = (numcols / JPC_QMFB_COLGRPSIZE) * JPC_QMFB_COLGRPSIZE;
1615-
startptr = &a[0];
1615+
startptr = (jpc_fix_t*)&a[0];
16161616
for (i = 0; i < maxcols; i += JPC_QMFB_COLGRPSIZE) {
16171617
jpc_ft_invlift_colgrp(startptr, numrows, stride, rowparity);
16181618
jpc_qmfb_join_colgrp(startptr, numrows, stride, rowparity);
@@ -3068,7 +3068,7 @@ void jpc_ns_invlift_col(jpc_fix_t *a, int numrows, int stride,
30683068

30693069
}
30703070

3071-
int jpc_ns_analyze(jpc_fix_t *a, int xstart, int ystart, int width, int height,
3071+
int jpc_ns_analyze(int *a, int xstart, int ystart, int width, int height,
30723072
int stride)
30733073
{
30743074

@@ -3081,7 +3081,7 @@ int jpc_ns_analyze(jpc_fix_t *a, int xstart, int ystart, int width, int height,
30813081
int maxcols;
30823082

30833083
maxcols = (numcols / JPC_QMFB_COLGRPSIZE) * JPC_QMFB_COLGRPSIZE;
3084-
startptr = &a[0];
3084+
startptr = (jpc_fix_t*)&a[0];
30853085
for (i = 0; i < maxcols; i += JPC_QMFB_COLGRPSIZE) {
30863086
jpc_qmfb_split_colgrp(startptr, numrows, stride, rowparity);
30873087
jpc_ns_fwdlift_colgrp(startptr, numrows, stride, rowparity);
@@ -3094,7 +3094,7 @@ int jpc_ns_analyze(jpc_fix_t *a, int xstart, int ystart, int width, int height,
30943094
rowparity);
30953095
}
30963096

3097-
startptr = &a[0];
3097+
startptr = (jpc_fix_t*)&a[0];
30983098
for (i = 0; i < numrows; ++i) {
30993099
jpc_qmfb_split_row(startptr, numcols, colparity);
31003100
jpc_ns_fwdlift_row(startptr, numcols, colparity);
@@ -3105,7 +3105,7 @@ int jpc_ns_analyze(jpc_fix_t *a, int xstart, int ystart, int width, int height,
31053105

31063106
}
31073107

3108-
int jpc_ns_synthesize(jpc_fix_t *a, int xstart, int ystart, int width,
3108+
int jpc_ns_synthesize(int *a, int xstart, int ystart, int width,
31093109
int height, int stride)
31103110
{
31113111

@@ -3117,15 +3117,15 @@ int jpc_ns_synthesize(jpc_fix_t *a, int xstart, int ystart, int width,
31173117
jpc_fix_t *startptr;
31183118
int i;
31193119

3120-
startptr = &a[0];
3120+
startptr = (jpc_fix_t*)&a[0];
31213121
for (i = 0; i < numrows; ++i) {
31223122
jpc_ns_invlift_row(startptr, numcols, colparity);
31233123
jpc_qmfb_join_row(startptr, numcols, colparity);
31243124
startptr += stride;
31253125
}
31263126

31273127
maxcols = (numcols / JPC_QMFB_COLGRPSIZE) * JPC_QMFB_COLGRPSIZE;
3128-
startptr = &a[0];
3128+
startptr = (jpc_fix_t*)&a[0];
31293129
for (i = 0; i < maxcols; i += JPC_QMFB_COLGRPSIZE) {
31303130
jpc_ns_invlift_colgrp(startptr, numrows, stride, rowparity);
31313131
jpc_qmfb_join_colgrp(startptr, numrows, stride, rowparity);

modules/core/include/opencv2/core/internal.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ CV_INLINE IppiSize ippiSize(int width, int height)
135135
# if defined __AVX__ || (defined _MSC_FULL_VER && _MSC_FULL_VER >= 160040219)
136136
# include <immintrin.h>
137137
# define CV_AVX 1
138+
# if defined(_XCR_XFEATURE_ENABLED_MASK)
139+
# define __xgetbv() _xgetbv(_XCR_XFEATURE_ENABLED_MASK)
140+
# else
141+
# define __xgetbv() 0
142+
# endif
138143
# else
139144
# define CV_AVX 0
140145
# endif

modules/highgui/src/cap_gstreamer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ bool CvCapture_GStreamer::grabFrame()
183183
IplImage * CvCapture_GStreamer::retrieveFrame(int)
184184
{
185185
if(!buffer)
186-
return false;
186+
return 0;
187187

188188
if(!frame) {
189189
gint height, width;
@@ -193,7 +193,7 @@ IplImage * CvCapture_GStreamer::retrieveFrame(int)
193193

194194
if(!gst_structure_get_int(structure, "width", &width) ||
195195
!gst_structure_get_int(structure, "height", &height))
196-
return false;
196+
return 0;
197197

198198
frame = cvCreateImageHeader(cvSize(width, height), IPL_DEPTH_8U, 3);
199199
gst_caps_unref(buff_caps);
@@ -572,7 +572,7 @@ CvVideoWriter* cvCreateVideoWriter_GStreamer(const char* filename, int fourcc, d
572572
return wrt;
573573

574574
delete wrt;
575-
return false;
575+
return 0;
576576
}
577577

578578
void CvCapture_GStreamer::close()
@@ -746,5 +746,5 @@ CvCapture* cvCreateCapture_GStreamer(int type, const char* filename )
746746
return capture;
747747

748748
delete capture;
749-
return false;
749+
return 0;
750750
}

modules/nonfree/src/surf.cpp

Lines changed: 84 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -257,16 +257,97 @@ interpolateKeypoint( float N9[3][9], int dx, int dy, int ds, KeyPoint& kpt )
257257
return ok;
258258
}
259259

260+
// Multi-threaded construction of the scale-space pyramid
261+
struct SURFBuildInvoker
262+
{
263+
SURFBuildInvoker( const Mat& _sum, const vector<int>& _sizes,
264+
const vector<int>& _sampleSteps,
265+
vector<Mat>& _dets, vector<Mat>& _traces )
266+
{
267+
sum = &_sum;
268+
sizes = &_sizes;
269+
sampleSteps = &_sampleSteps;
270+
dets = &_dets;
271+
traces = &_traces;
272+
}
273+
274+
void operator()(const BlockedRange& range) const
275+
{
276+
for( int i=range.begin(); i<range.end(); i++ )
277+
calcLayerDetAndTrace( *sum, (*sizes)[i], (*sampleSteps)[i], (*dets)[i], (*traces)[i] );
278+
}
279+
280+
const Mat *sum;
281+
const vector<int> *sizes;
282+
const vector<int> *sampleSteps;
283+
vector<Mat>* dets;
284+
vector<Mat>* traces;
285+
};
286+
287+
// Multi-threaded search of the scale-space pyramid for keypoints
288+
struct SURFFindInvoker
289+
{
290+
SURFFindInvoker( const Mat& _sum, const Mat& _mask_sum,
291+
const vector<Mat>& _dets, const vector<Mat>& _traces,
292+
const vector<int>& _sizes, const vector<int>& _sampleSteps,
293+
const vector<int>& _middleIndices, vector<KeyPoint>& _keypoints,
294+
int _nOctaveLayers, float _hessianThreshold )
295+
{
296+
sum = &_sum;
297+
mask_sum = &_mask_sum;
298+
dets = &_dets;
299+
traces = &_traces;
300+
sizes = &_sizes;
301+
sampleSteps = &_sampleSteps;
302+
middleIndices = &_middleIndices;
303+
keypoints = &_keypoints;
304+
nOctaveLayers = _nOctaveLayers;
305+
hessianThreshold = _hessianThreshold;
306+
}
307+
308+
static void findMaximaInLayer( const Mat& sum, const Mat& mask_sum,
309+
const vector<Mat>& dets, const vector<Mat>& traces,
310+
const vector<int>& sizes, vector<KeyPoint>& keypoints,
311+
int octave, int layer, float hessianThreshold, int sampleStep );
312+
313+
void operator()(const BlockedRange& range) const
314+
{
315+
for( int i=range.begin(); i<range.end(); i++ )
316+
{
317+
int layer = (*middleIndices)[i];
318+
int octave = i / nOctaveLayers;
319+
findMaximaInLayer( *sum, *mask_sum, *dets, *traces, *sizes,
320+
*keypoints, octave, layer, hessianThreshold,
321+
(*sampleSteps)[layer] );
322+
}
323+
}
324+
325+
const Mat *sum;
326+
const Mat *mask_sum;
327+
const vector<Mat>* dets;
328+
const vector<Mat>* traces;
329+
const vector<int>* sizes;
330+
const vector<int>* sampleSteps;
331+
const vector<int>* middleIndices;
332+
vector<KeyPoint>* keypoints;
333+
int nOctaveLayers;
334+
float hessianThreshold;
335+
336+
#ifdef HAVE_TBB
337+
static tbb::mutex findMaximaInLayer_m;
338+
#endif
339+
};
340+
260341
#ifdef HAVE_TBB
261-
static tbb::mutex findMaximaInLayer_m;
342+
tbb::mutex SURFFindInvoker::findMaximaInLayer_m;
262343
#endif
263344

345+
264346
/*
265347
* Find the maxima in the determinant of the Hessian in a layer of the
266348
* scale-space pyramid
267349
*/
268-
static void
269-
findMaximaInLayer( const Mat& sum, const Mat& mask_sum,
350+
void SURFFindInvoker::findMaximaInLayer( const Mat& sum, const Mat& mask_sum,
270351
const vector<Mat>& dets, const vector<Mat>& traces,
271352
const vector<int>& sizes, vector<KeyPoint>& keypoints,
272353
int octave, int layer, float hessianThreshold, int sampleStep )
@@ -367,84 +448,6 @@ findMaximaInLayer( const Mat& sum, const Mat& mask_sum,
367448
}
368449
}
369450

370-
371-
// Multi-threaded construction of the scale-space pyramid
372-
struct SURFBuildInvoker
373-
{
374-
SURFBuildInvoker( const Mat& _sum, const vector<int>& _sizes,
375-
const vector<int>& _sampleSteps,
376-
vector<Mat>& _dets, vector<Mat>& _traces )
377-
{
378-
sum = &_sum;
379-
sizes = &_sizes;
380-
sampleSteps = &_sampleSteps;
381-
dets = &_dets;
382-
traces = &_traces;
383-
}
384-
385-
void operator()(const BlockedRange& range) const
386-
{
387-
for( int i=range.begin(); i<range.end(); i++ )
388-
calcLayerDetAndTrace( *sum, (*sizes)[i], (*sampleSteps)[i], (*dets)[i], (*traces)[i] );
389-
}
390-
391-
const Mat *sum;
392-
const vector<int> *sizes;
393-
const vector<int> *sampleSteps;
394-
vector<Mat>* dets;
395-
vector<Mat>* traces;
396-
};
397-
398-
// Multi-threaded search of the scale-space pyramid for keypoints
399-
struct SURFFindInvoker
400-
{
401-
SURFFindInvoker( const Mat& _sum, const Mat& _mask_sum,
402-
const vector<Mat>& _dets, const vector<Mat>& _traces,
403-
const vector<int>& _sizes, const vector<int>& _sampleSteps,
404-
const vector<int>& _middleIndices, vector<KeyPoint>& _keypoints,
405-
int _nOctaveLayers, float _hessianThreshold )
406-
{
407-
sum = &_sum;
408-
mask_sum = &_mask_sum;
409-
dets = &_dets;
410-
traces = &_traces;
411-
sizes = &_sizes;
412-
sampleSteps = &_sampleSteps;
413-
middleIndices = &_middleIndices;
414-
keypoints = &_keypoints;
415-
nOctaveLayers = _nOctaveLayers;
416-
hessianThreshold = _hessianThreshold;
417-
418-
#ifdef HAVE_TBB
419-
//touch the mutex to ensure that it's initialization is finished
420-
CV_Assert(&findMaximaInLayer_m > 0);
421-
#endif
422-
}
423-
424-
void operator()(const BlockedRange& range) const
425-
{
426-
for( int i=range.begin(); i<range.end(); i++ )
427-
{
428-
int layer = (*middleIndices)[i];
429-
int octave = i / nOctaveLayers;
430-
findMaximaInLayer( *sum, *mask_sum, *dets, *traces, *sizes,
431-
*keypoints, octave, layer, hessianThreshold,
432-
(*sampleSteps)[layer] );
433-
}
434-
}
435-
436-
const Mat *sum;
437-
const Mat *mask_sum;
438-
const vector<Mat>* dets;
439-
const vector<Mat>* traces;
440-
const vector<int>* sizes;
441-
const vector<int>* sampleSteps;
442-
const vector<int>* middleIndices;
443-
vector<KeyPoint>* keypoints;
444-
int nOctaveLayers;
445-
float hessianThreshold;
446-
};
447-
448451
struct KeypointGreater
449452
{
450453
inline bool operator()(const KeyPoint& kp1, const KeyPoint& kp2) const

0 commit comments

Comments
 (0)