inline size_t Mat::total() const
{
if( dims <= 2 )
- return rows*cols;
+ return (size_t)rows*cols;
size_t p = 1;
for( int i = 0; i < dims; i++ )
p *= size[i];
template<typename _Tp> struct CV_EXPORTS Matx_FastSolveOp<_Tp, 2, 1>
{
bool operator()(const Matx<_Tp, 2, 2>& a, const Matx<_Tp, 2, 1>& b,
- Matx<_Tp, 2, 1>& x, int method) const
+ Matx<_Tp, 2, 1>& x, int) const
{
_Tp d = determinant(a);
if( d == 0 )
return conjugate(*this);
}
-template<typename _Tp, int cn> inline Vec<_Tp, cn> Vec<_Tp, cn>::cross(const Vec<_Tp, cn>& v) const
+template<typename _Tp, int cn> inline Vec<_Tp, cn> Vec<_Tp, cn>::cross(const Vec<_Tp, cn>&) const
{
CV_Error(CV_StsError, "for arbitrary-size vector there is no cross-product defined");
return Vec<_Tp, cn>();
{
const _Tp *ptr1 = &v1[0], *ptr2 = &v2[0];
#if CV_ENABLE_UNROLLED
- for(; i <= n - 4; i += 4 )
+ const size_t n2 = (n > 4) ? n : 4;
+ for(; i <= n2 - 4; i += 4 )
s += (_Tw)ptr1[i]*ptr2[i] + (_Tw)ptr1[i+1]*ptr2[i+1] +
(_Tw)ptr1[i+2]*ptr2[i+2] + (_Tw)ptr1[i+3]*ptr2[i+3];
#endif
unsigned t = next();
return (((uint64)t << 32) | next())*5.4210108624275221700372640043497e-20;
}
-inline int RNG::uniform(int a, int b) { return a == b ? a : next()%(b - a) + a; }
+inline int RNG::uniform(int a, int b) { return a == b ? a : (int)(next()%(b - a) + a); }
inline float RNG::uniform(float a, float b) { return ((float)*this)*(b - a) + a; }
inline double RNG::uniform(double a, double b) { return ((double)*this)*(b - a) + a; }
inline size_t FileNode::size() const
{
int t = type();
- return t == MAP ? ((CvSet*)node->data.map)->active_count :
- t == SEQ ? node->data.seq->total : (size_t)!isNone();
+ return t == MAP ? (size_t)((CvSet*)node->data.map)->active_count :
+ t == SEQ ? (size_t)node->data.seq->total : (size_t)!isNone();
}
inline CvFileNode* FileNode::operator *() { return (CvFileNode*)node; }
if( CV_IS_MAT_CONT( mat->type ))
{
total_size = (size_t)mat->dim[0].size*(mat->dim[0].step != 0 ?
- mat->dim[0].step : total_size);
+ (size_t)mat->dim[0].step : total_size);
}
else
{
using namespace cv;
namespace {
-void helpParser()
+#if 0
+static void helpParser()
{
printf("\nThe CommandLineParser class is designed for command line arguments parsing\n"
"Keys map: \n"
" It also works with 'unsigned int', 'double', and 'float' types \n"
);
}
+#endif
vector<string> split_string(const string& str, const string& delimiters)
{
\r
const CvOpenGlFuncTab* g_glFuncTab = 0;\r
\r
-//#ifdef HAVE_CUDA\r
+#if defined HAVE_CUDA || defined HAVE_OPENGL\r
const CvOpenGlFuncTab* glFuncTab()\r
{\r
static EmptyGlFuncTab empty;\r
return g_glFuncTab ? g_glFuncTab : ∅\r
}\r
-//#endif\r
+#endif\r
}\r
\r
CvOpenGlFuncTab::~CvOpenGlFuncTab()\r
fs->buffer_end = fs->buffer_start + buf_size;
if( fs->fmt == CV_STORAGE_FORMAT_XML )
{
- size_t file_size = fs->file ? ftell( fs->file ) : (size_t)0;
+ size_t file_size = fs->file ? (size_t)ftell( fs->file ) : (size_t)0;
fs->strstorage = cvCreateChildMemStorage( fs->memstorage );
if( !append || file_size == 0 )
{
cvtest::randUni( rng, elem_mat, cvScalarAll(0), cvScalarAll(255) );
whence = op - 7;
- pos = whence < 0 ? 0 : whence > 0 ? sseq->count : cvtest::randInt(rng) % (sseq->count+1);
+ pos = whence < 0 ? 0 : whence > 0 ? sseq->count : (int)(cvtest::randInt(rng) % (sseq->count+1));
if( whence != 0 )
{
cvSeqPushMulti( seq, elem, count, whence < 0 );
if( sseq->count > 0 )
{
// choose the random element among the added
- pos = count > 0 ? cvtest::randInt(rng) % count + pos : MAX(pos-1,0);
- elem2 = cvGetSeqElem( seq, pos );
+ pos = count > 0 ? (int)(cvtest::randInt(rng) % count + pos) : MAX(pos-1,0);
+ elem2 = cvGetSeqElem( seq, pos );
CV_TS_SEQ_CHECK_CONDITION( elem2 != 0, "multi push operation doesn't add elements" );
CV_TS_SEQ_CHECK_CONDITION( seq->total == sseq->count &&
memcmp( elem2, cvTsSimpleSeqElem(sseq,pos), elem_size) == 0,
count = cvtest::randInt(rng) % (sseq->count+1);
whence = op - 10;
pos = whence < 0 ? 0 : whence > 0 ? sseq->count - count :
- cvtest::randInt(rng) % (sseq->count - count + 1);
+ (int)(cvtest::randInt(rng) % (sseq->count - count + 1));
if( whence != 0 )
{
int sz = 0, dsz = 0, slice;
for( slice = 0; slice < maxSlice; slice++, sz += dsz )
{
- dsz = slice+1 < maxSlice ? cvtest::randInt(rng) % (SZ - sz + 1) : SZ - sz;
+ dsz = slice+1 < maxSlice ? (int)(cvtest::randInt(rng) % (SZ - sz + 1)) : SZ - sz;
Mat aslice = arr[k].colRange(sz, sz + dsz);
tested_rng.fill(aslice, dist_type, A, B);
}
* @param k_nn the number of nearest neighbors
* @param checked_average used for debugging
*/
- void getNeighbors(const ElementType* vec, bool do_radius, float radius, bool do_k, unsigned int k_nn,
- float& checked_average)
+ void getNeighbors(const ElementType* vec, bool /*do_radius*/, float radius, bool do_k, unsigned int k_nn,
+ float& /*checked_average*/)
{
static std::vector<ScoreIndexPair> score_index_heap;
void operator() (const BlockedRange& range) const;
- void operator= (const FastNlMeansDenoisingInvoker& invoker) {
+ void operator= (const FastNlMeansDenoisingInvoker&) {
CV_Error(CV_StsNotImplemented, "Assigment operator is not implemented");
}
void operator() (const BlockedRange& range) const;
- void operator= (const FastNlMeansMultiDenoisingInvoker& invoker) {
+ void operator= (const FastNlMeansMultiDenoisingInvoker&) {
CV_Error(CV_StsNotImplemented, "Assigment operator is not implemented");
}
// part can be omitted.
//
// Returns the value of the flag, or NULL if the parsing failed.
-const char* ParseFlagValue(const char* str,
+static const char* ParseFlagValue(const char* str,
const char* flag,
bool def_optional) {
// str and flag must not be NULL.
*result = (&dummy < ptr);
}
+#if GTEST_HAS_CLONE
static bool StackGrowsDown() {
int dummy;
bool result;
StackLowerThanAddress(&dummy, &result);
return result;
}
+#endif
// Spawns a child process with the same executable as the current process in
// a thread-safe manner and instructs it to run the death test. The