From d4d2a6ef7b4fca8621c177590d6313f92ba4d973 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Wed, 3 Sep 2014 12:34:54 +0400 Subject: [PATCH] fixed android warnings --- modules/saliency/doc/misc | 1 - modules/saliency/src/BING/CmFile.cpp | 6 +++--- modules/saliency/src/BING/kyheader.hpp | 1 - modules/saliency/src/BING/objectnessBING.cpp | 4 ++-- 4 files changed, 5 insertions(+), 7 deletions(-) delete mode 160000 modules/saliency/doc/misc diff --git a/modules/saliency/doc/misc b/modules/saliency/doc/misc deleted file mode 160000 index 16789e8dc..000000000 --- a/modules/saliency/doc/misc +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 16789e8dcad170f502c81ea2b9714a4dd6bff0c1 diff --git a/modules/saliency/src/BING/CmFile.cpp b/modules/saliency/src/BING/CmFile.cpp index 2bcc4fd14..2c9ba9dd0 100644 --- a/modules/saliency/src/BING/CmFile.cpp +++ b/modules/saliency/src/BING/CmFile.cpp @@ -52,7 +52,7 @@ bool CmFile::MkDir( std::string &_path ) if( _path.size() == 0 ) return false; static char buffer[1024]; - strcpy( buffer, _S( _path ) ); + strcpy( buffer, _path.c_str() ); #ifdef _WIN32 for (int i = 0; buffer[i] != 0; i ++) { @@ -64,7 +64,7 @@ bool CmFile::MkDir( std::string &_path ) } } - CreateDirectoryA(_S(_path), 0); + CreateDirectoryA(_path.c_str(), 0); return true; #else for ( int i = 0; buffer[i] != 0; i++ ) @@ -76,7 +76,7 @@ bool CmFile::MkDir( std::string &_path ) buffer[i] = '/'; } } - mkdir( _S( _path ), 0 ); + mkdir( _path.c_str(), 0 ); return true; #endif } diff --git a/modules/saliency/src/BING/kyheader.hpp b/modules/saliency/src/BING/kyheader.hpp index 1bc9807f3..bbe7b8f4e 100644 --- a/modules/saliency/src/BING/kyheader.hpp +++ b/modules/saliency/src/BING/kyheader.hpp @@ -100,7 +100,6 @@ enum CV_FLIP_VERTICAL = 0, CV_FLIP_HORIZONTAL = 1 }; -#define _S(str) ((str).c_str()) #define CHK_IND(p) ((p).x >= 0 && (p).x < _w && (p).y >= 0 && (p).y < _h) #define CV_Assert_(expr, args) \ {\ diff --git a/modules/saliency/src/BING/objectnessBING.cpp b/modules/saliency/src/BING/objectnessBING.cpp index 26309d572..67e17106f 100644 --- a/modules/saliency/src/BING/objectnessBING.cpp +++ b/modules/saliency/src/BING/objectnessBING.cpp @@ -104,7 +104,7 @@ int ObjectnessBING::loadTrainedModel( std::string modelName ) // Return -1, 0, if( !matRead( s1, filters1f ) || !matRead( sI, idx1i ) ) { - printf( "Can't load model: %s or %s\n", _S( s1 ), _S( sI ) ); + printf( "Can't load model: %s or %s\n", s1.c_str(), sI.c_str() ); return 0; } @@ -401,7 +401,7 @@ void ObjectnessBING::getObjBndBoxesForSingleImage( Mat img, ValStructVec sortedBB = finalBoxes.getSortedStructVal(); std::ofstream ofs; - ofs.open( _S( fName + ".txt" ), std::ofstream::out ); + ofs.open( ( fName + ".txt" ).c_str(), std::ofstream::out ); std::stringstream dim; dim << sortedBB.size(); ofs << dim.str() << "\n";