fixed minor bugs that kept toolbox from building under R2006b -- dont call mxGetPr with a char variable --.

This commit is contained in:
Dave Goodwin 2006-12-14 17:48:51 +00:00
parent 71b71cd3f5
commit 7c3d9c8320
3 changed files with 8 additions and 6 deletions

View file

@ -14,13 +14,15 @@
bool ok = true;
int status, buflen;
char* input_buf;
double* ptr;
double* ptr = 0;
int n, nsp, mjob, show_thermo;
// methods to set attributes
if (job < 0) {
mjob = -job;
ptr = mxGetPr(prhs[3]);
if (mxIsChar(prhs[3]) != 1) {
ptr = mxGetPr(prhs[3]);
}
m = mxGetM(prhs[3]);
n = mxGetN(prhs[3]);
@ -75,10 +77,8 @@
int buflen, status;
char* input_buf;
if (mxIsChar(prhs[3]) == 1) {
if(mxGetM(prhs[3]) != 1)
mexErrMsgTxt("Input must be a row vector.");
buflen = (mxGetM(prhs[3]) * mxGetN(prhs[3])) + 1;
input_buf = (char*)mxCalloc(buflen, sizeof(char));
status = mxGetString(prhs[3], input_buf, buflen);

View file

@ -13,7 +13,9 @@ static void thermoset( int nlhs, mxArray *plhs[],
double vv;
int th = getInt(prhs[1]);
int job = -getInt(prhs[2]);
double* ptr = mxGetPr(prhs[3]);
double* ptr = 0;
if (mxIsDouble(prhs[3]) == 1)
ptr = mxGetPr(prhs[3]);
int m = mxGetM(prhs[3]);
int n = mxGetN(prhs[3]);

View file

@ -13,7 +13,7 @@ f.close()
fb = open('cantera/buildux.m','w')
fb.write("""
disp('building Cantera..');
mex -v private/ctmethods.cpp private/ctfunctions.cpp ...
mex -cxx -v private/ctmethods.cpp private/ctfunctions.cpp ...
private/xmlmethods.cpp private/phasemethods.cpp ...
private/thermomethods.cpp private/kineticsmethods.cpp ...
private/mixturemethods.cpp ...