Commit 7efe5acb authored by thomas.forbriger's avatar thomas.forbriger

any2matlab [FIX]: declare variable with requested type

The dims variable passed to function mxCreateStructArray was declared int,
while the declaration of mxCreateStructArray makes the compiler expect a
variable of type const mwSize*
parent df9e28bd
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* seismic dataformats to MATLAB. * seismic dataformats to MATLAB.
* *
* \author Daniel Armbruster * \author Daniel Armbruster
* \version V1.2 * \version V1.4
* \date 07/09/2011 * \date 07/09/2011
* *
* ---- * ----
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
* - 31/10/2013 V1.3 (Thomas Forbriger): removed explicit list of format * - 31/10/2013 V1.3 (Thomas Forbriger): removed explicit list of format
* types since this was out of date and always is * types since this was out of date and always is
* likely to be out of date * likely to be out of date
* - 28/06/2019 V1.4 (Thomas Forbriger): fix type issue by declaring
* trace and dims as mwSize rather than int
* *
* \section general General * \section general General
* *
...@@ -209,7 +211,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) ...@@ -209,7 +211,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
// set filetype to lower case // set filetype to lower case
transform(filetype.begin(), filetype.end(), filetype.begin(), tolower); transform(filetype.begin(), filetype.end(), filetype.begin(), tolower);
int trace = 0; mwSize trace = 0;
bool hot = false; bool hot = false;
{ {
...@@ -236,7 +238,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) ...@@ -236,7 +238,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
} }
} }
int dims[2] = {1, trace}; mwSize dims[2] = {1, trace};
// create a 1-by-n array of strucntraces. // create a 1-by-n array of strucntraces.
plhs[0] = mxCreateStructArray(2, dims, number_of_fields, field_names); plhs[0] = mxCreateStructArray(2, dims, number_of_fields, field_names);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment