[Matlab] Fix detection of errors when importing Kinetics

Cast the unsigned return type of newKineticsFromXML to a signed type so that the
check on the Matlab side (which looks at the sign of the return value) can
detect and report errors.

Cherry-pick of trunk r2724.
This commit is contained in:
Ray Speth 2014-02-13 22:39:38 +00:00
parent 849dc5c82f
commit c7efc2d059

View file

@ -24,7 +24,7 @@ void kineticsmethods(int nlhs, mxArray* plhs[],
int in2 = getInt(prhs[5]);
int in3 = getInt(prhs[6]);
int in4 = getInt(prhs[7]);
vv = (double) newKineticsFromXML(root, iph, in1, in2, in3, in4);
vv = static_cast<int>(newKineticsFromXML(root, iph, in1, in2, in3, in4));
plhs[0] = mxCreateNumericMatrix(1,1,mxDOUBLE_CLASS,mxREAL);
double* h = mxGetPr(plhs[0]);
*h = vv;