Fixed cmake and build issues when using Visual Studio 2015

This commit is contained in:
Maksim Shabunin
2015-10-26 16:55:42 +03:00
parent 4552ca98c4
commit f49936a849
59 changed files with 520 additions and 460 deletions

View File

@@ -1119,7 +1119,7 @@ extern "C" {
("jdoubleArray _da_retval_ = env->NewDoubleArray(%(cnt)i); " +
"jdouble _tmp_retval_[%(cnt)i] = {%(args)s}; " +
"env->SetDoubleArrayRegion(_da_retval_, 0, %(cnt)i, _tmp_retval_);") %
{ "cnt" : len(fields), "args" : ", ".join(["_retval_" + f[1] for f in fields]) } )
{ "cnt" : len(fields), "args" : ", ".join(["(jdouble)_retval_" + f[1] for f in fields]) } )
if fi.classname and fi.ctype and not fi.static: # non-static class method except c-tor
# adding 'self'
jn_args.append ( ArgInfo([ "__int64", "nativeObj", "", [], "" ]) )
@@ -1167,7 +1167,7 @@ extern "C" {
j_prologue.append( "double[] %s_out = new double[%i];" % (a.name, len(fields)) )
c_epilogue.append( \
"jdouble tmp_%(n)s[%(cnt)i] = {%(args)s}; env->SetDoubleArrayRegion(%(n)s_out, 0, %(cnt)i, tmp_%(n)s);" %
{ "n" : a.name, "cnt" : len(fields), "args" : ", ".join([a.name + f[1] for f in fields]) } )
{ "n" : a.name, "cnt" : len(fields), "args" : ", ".join(["(jdouble)" + a.name + f[1] for f in fields]) } )
if a.ctype in ('bool', 'int', 'long', 'float', 'double'):
j_epilogue.append('if(%(n)s!=null) %(n)s[0] = (%(t)s)%(n)s_out[0];' % {'n':a.name,'t':a.ctype})
else:

View File

@@ -1069,7 +1069,7 @@ JNIEXPORT void JNICALL Java_org_opencv_core_Mat_locateROI_10
Size wholeSize;
Point ofs;
me->locateROI( wholeSize, ofs );
jdouble tmp_wholeSize[2] = {wholeSize.width, wholeSize.height}; env->SetDoubleArrayRegion(wholeSize_out, 0, 2, tmp_wholeSize); jdouble tmp_ofs[2] = {ofs.x, ofs.y}; env->SetDoubleArrayRegion(ofs_out, 0, 2, tmp_ofs);
jdouble tmp_wholeSize[2] = {(jdouble)wholeSize.width, (jdouble)wholeSize.height}; env->SetDoubleArrayRegion(wholeSize_out, 0, 2, tmp_wholeSize); jdouble tmp_ofs[2] = {(jdouble)ofs.x, (jdouble)ofs.y}; env->SetDoubleArrayRegion(ofs_out, 0, 2, tmp_ofs);
} catch(const std::exception &e) {
throwJavaException(env, &e, method_name);
} catch (...) {
@@ -1488,7 +1488,7 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Mat_n_1size
Mat* me = (Mat*) self; //TODO: check for NULL
Size _retval_ = me->size( );
jdoubleArray _da_retval_ = env->NewDoubleArray(2);
jdouble _tmp_retval_[2] = {_retval_.width, _retval_.height};
jdouble _tmp_retval_[2] = {(jdouble)_retval_.width, (jdouble)_retval_.height};
env->SetDoubleArrayRegion(_da_retval_, 0, 2, _tmp_retval_);
return _da_retval_;
} catch(const std::exception &e) {

View File

@@ -451,9 +451,9 @@ JNIEXPORT void JNICALL Java_org_opencv_gpu_DeviceInfo_queryMemory_10
size_t totalMemory;
size_t freeMemory;
me->queryMemory( totalMemory, freeMemory );
jdouble tmp_totalMemory[1] = {totalMemory};
jdouble tmp_totalMemory[1] = {(jdouble)totalMemory};
env->SetDoubleArrayRegion(totalMemory_out, 0, 1, tmp_totalMemory);
jdouble tmp_freeMemory[1] = {freeMemory};
jdouble tmp_freeMemory[1] = {(jdouble)freeMemory};
env->SetDoubleArrayRegion(freeMemory_out, 0, 1, tmp_freeMemory);
return;
} catch(const std::exception &e) {