mirror of
https://github.com/opencv/opencv.git
synced 2025-08-01 02:18:01 +08:00
Fixed minor issues reported by GCC 7.2
This commit is contained in:
parent
18a4ced07a
commit
184daa155f
2
3rdparty/libjasper/CMakeLists.txt
vendored
2
3rdparty/libjasper/CMakeLists.txt
vendored
@ -25,7 +25,7 @@ endif(WIN32 AND NOT MINGW)
|
|||||||
|
|
||||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wno-implicit-function-declaration -Wno-uninitialized -Wmissing-prototypes
|
ocv_warnings_disable(CMAKE_C_FLAGS -Wno-implicit-function-declaration -Wno-uninitialized -Wmissing-prototypes
|
||||||
-Wno-unused-but-set-parameter -Wmissing-declarations -Wunused -Wshadow
|
-Wno-unused-but-set-parameter -Wmissing-declarations -Wunused -Wshadow
|
||||||
-Wsign-compare -Wstrict-overflow)
|
-Wsign-compare -Wstrict-overflow -Wpointer-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
|
||||||
|
|
||||||
|
@ -534,7 +534,7 @@ bool CvCascadeClassifier::load( const string cascadeDirName )
|
|||||||
featureEvaluator->init( featureParams, numPos + numNeg, cascadeParams.winSize );
|
featureEvaluator->init( featureParams, numPos + numNeg, cascadeParams.winSize );
|
||||||
fs.release();
|
fs.release();
|
||||||
|
|
||||||
char buf[10];
|
char buf[16] = {0};
|
||||||
for ( int si = 0; si < numStages; si++ )
|
for ( int si = 0; si < numStages; si++ )
|
||||||
{
|
{
|
||||||
sprintf( buf, "%s%d", "stage", si);
|
sprintf( buf, "%s%d", "stage", si);
|
||||||
|
@ -519,7 +519,7 @@ private:
|
|||||||
|
|
||||||
// Double QR step involving rows l:n and columns m:n
|
// Double QR step involving rows l:n and columns m:n
|
||||||
|
|
||||||
for (int k = m; k <= n1 - 1; k++) {
|
for (int k = m; k < n1; k++) {
|
||||||
bool notlast = (k != n1 - 1);
|
bool notlast = (k != n1 - 1);
|
||||||
if (k != m) {
|
if (k != m) {
|
||||||
p = H[k][k - 1];
|
p = H[k][k - 1];
|
||||||
@ -761,7 +761,7 @@ private:
|
|||||||
int low = 0;
|
int low = 0;
|
||||||
int high = n - 1;
|
int high = n - 1;
|
||||||
|
|
||||||
for (int m = low + 1; m <= high - 1; m++) {
|
for (int m = low + 1; m < high; m++) {
|
||||||
|
|
||||||
// Scale column.
|
// Scale column.
|
||||||
|
|
||||||
@ -822,7 +822,7 @@ private:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int m = high - 1; m >= low + 1; m--) {
|
for (int m = high - 1; m > low; m--) {
|
||||||
if (H[m][m - 1] != 0.0) {
|
if (H[m][m - 1] != 0.0) {
|
||||||
for (int i = m + 1; i <= high; i++) {
|
for (int i = m + 1; i <= high; i++) {
|
||||||
ort[i] = H[i][m - 1];
|
ort[i] = H[i][m - 1];
|
||||||
@ -1083,7 +1083,7 @@ void LDA::lda(InputArrayOfArrays _src, InputArray _lbls) {
|
|||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
// clip number of components to be a valid number
|
// clip number of components to be a valid number
|
||||||
if ((_num_components <= 0) || (_num_components > (C - 1))) {
|
if ((_num_components <= 0) || (_num_components >= C)) {
|
||||||
_num_components = (C - 1);
|
_num_components = (C - 1);
|
||||||
}
|
}
|
||||||
// holds the mean over all classes
|
// holds the mean over all classes
|
||||||
|
@ -3173,7 +3173,7 @@ void resize(int src_type,
|
|||||||
short* ialpha = (short*)alpha;
|
short* ialpha = (short*)alpha;
|
||||||
float* beta = alpha + width*ksize;
|
float* beta = alpha + width*ksize;
|
||||||
short* ibeta = ialpha + width*ksize;
|
short* ibeta = ialpha + width*ksize;
|
||||||
float cbuf[MAX_ESIZE];
|
float cbuf[MAX_ESIZE] = {0};
|
||||||
|
|
||||||
for( dx = 0; dx < dsize.width; dx++ )
|
for( dx = 0; dx < dsize.width; dx++ )
|
||||||
{
|
{
|
||||||
|
@ -209,7 +209,7 @@ void CV_DetectorTest::run( int )
|
|||||||
vector<string>::const_iterator it = imageFilenames.begin();
|
vector<string>::const_iterator it = imageFilenames.begin();
|
||||||
for( int ii = 0; it != imageFilenames.end(); ++it, ii++ )
|
for( int ii = 0; it != imageFilenames.end(); ++it, ii++ )
|
||||||
{
|
{
|
||||||
char buf[10];
|
char buf[16] = {0};
|
||||||
sprintf( buf, "%s%d", "img_", ii );
|
sprintf( buf, "%s%d", "img_", ii );
|
||||||
//cvWriteComment( validationFS.fs, buf, 0 );
|
//cvWriteComment( validationFS.fs, buf, 0 );
|
||||||
validationFS << *it;
|
validationFS << *it;
|
||||||
@ -265,7 +265,7 @@ int CV_DetectorTest::runTestCase( int detectorIdx, vector<vector<Rect> >& object
|
|||||||
Mat image = images[ii];
|
Mat image = images[ii];
|
||||||
if( image.empty() )
|
if( image.empty() )
|
||||||
{
|
{
|
||||||
char msg[30];
|
char msg[50] = {0};
|
||||||
sprintf( msg, "%s %d %s", "image ", ii, " can not be read" );
|
sprintf( msg, "%s %d %s", "image ", ii, " can not be read" );
|
||||||
ts->printf( cvtest::TS::LOG, msg );
|
ts->printf( cvtest::TS::LOG, msg );
|
||||||
return cvtest::TS::FAIL_INVALID_TEST_DATA;
|
return cvtest::TS::FAIL_INVALID_TEST_DATA;
|
||||||
@ -278,7 +278,7 @@ int CV_DetectorTest::runTestCase( int detectorIdx, vector<vector<Rect> >& object
|
|||||||
|
|
||||||
if( write_results )
|
if( write_results )
|
||||||
{
|
{
|
||||||
char buf[10];
|
char buf[16] = {0};
|
||||||
sprintf( buf, "%s%d", "img_", ii );
|
sprintf( buf, "%s%d", "img_", ii );
|
||||||
string imageIdxStr = buf;
|
string imageIdxStr = buf;
|
||||||
validationFS << imageIdxStr << "[:";
|
validationFS << imageIdxStr << "[:";
|
||||||
@ -313,7 +313,7 @@ int CV_DetectorTest::validate( int detectorIdx, vector<vector<Rect> >& objects )
|
|||||||
int noPair = 0;
|
int noPair = 0;
|
||||||
|
|
||||||
// read validation rectangles
|
// read validation rectangles
|
||||||
char buf[10];
|
char buf[16] = {0};
|
||||||
sprintf( buf, "%s%d", "img_", imageIdx );
|
sprintf( buf, "%s%d", "img_", imageIdx );
|
||||||
string imageIdxStr = buf;
|
string imageIdxStr = buf;
|
||||||
FileNode node = validationFS.getFirstTopLevelNode()[VALIDATION][detectorNames[detectorIdx]][imageIdxStr];
|
FileNode node = validationFS.getFirstTopLevelNode()[VALIDATION][detectorNames[detectorIdx]][imageIdxStr];
|
||||||
|
@ -393,27 +393,27 @@ static int xioctl( int fd, int request, void *arg)
|
|||||||
Returns the global numCameras with the correct value (we hope) */
|
Returns the global numCameras with the correct value (we hope) */
|
||||||
|
|
||||||
static void icvInitCapture_V4L() {
|
static void icvInitCapture_V4L() {
|
||||||
int deviceHandle;
|
int deviceHandle;
|
||||||
int CameraNumber;
|
int CameraNumber;
|
||||||
char deviceName[MAX_DEVICE_DRIVER_NAME];
|
char deviceName[MAX_DEVICE_DRIVER_NAME];
|
||||||
|
|
||||||
CameraNumber = 0;
|
CameraNumber = 0;
|
||||||
while(CameraNumber < MAX_CAMERAS) {
|
while(CameraNumber < MAX_CAMERAS) {
|
||||||
/* Print the CameraNumber at the end of the string with a width of one character */
|
/* Print the CameraNumber at the end of the string with a width of one character */
|
||||||
sprintf(deviceName, "/dev/video%1d", CameraNumber);
|
sprintf(deviceName, "/dev/video%1d", CameraNumber);
|
||||||
/* Test using an open to see if this new device name really does exists. */
|
/* Test using an open to see if this new device name really does exists. */
|
||||||
deviceHandle = open(deviceName, O_RDONLY);
|
deviceHandle = open(deviceName, O_RDONLY);
|
||||||
if (deviceHandle != -1) {
|
if (deviceHandle != -1) {
|
||||||
/* This device does indeed exist - add it to the total so far */
|
/* This device does indeed exist - add it to the total so far */
|
||||||
// add indexList
|
numCameras++;
|
||||||
indexList|=(1 << CameraNumber);
|
// add indexList
|
||||||
numCameras++;
|
indexList|=(1 << CameraNumber);
|
||||||
}
|
}
|
||||||
if (deviceHandle != -1)
|
if (deviceHandle != -1)
|
||||||
close(deviceHandle);
|
close(deviceHandle);
|
||||||
/* Set up to test the next /dev/video source in line */
|
/* Set up to test the next /dev/video source in line */
|
||||||
CameraNumber++;
|
CameraNumber++;
|
||||||
} /* End while */
|
} /* End while */
|
||||||
|
|
||||||
}; /* End icvInitCapture_V4L */
|
}; /* End icvInitCapture_V4L */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user