replace use of old-style casts
parent
53ae549350
commit
1501032a3f
|
@ -48,16 +48,16 @@ mexFunction(int nlhs, mxArray *plhs[],
|
|||
/*
|
||||
* Allocate memory
|
||||
*/
|
||||
maxnargs = (int) (mxGetN(prhs[0])/2+1);
|
||||
argument = (char *) mxCalloc(mxGetN(prhs[0])+1, sizeof(char));
|
||||
args = (char **) mxCalloc(maxnargs, sizeof(char *));
|
||||
maxnargs = static_cast<int> (mxGetN(prhs[0])/2+1);
|
||||
argument = static_cast<char *> (mxCalloc(mxGetN(prhs[0])+1, sizeof(char)));
|
||||
args = static_cast<char **> (mxCalloc(maxnargs, sizeof(char *)));
|
||||
if (argument == NULL || args == NULL)
|
||||
DYN_MEX_FUNC_ERR_MSG_TXT("Error in MS-SBVAR MEX file: could not allocate memory. (1)");
|
||||
|
||||
/*
|
||||
* Create argument string from prhs and parse to create args / nargs
|
||||
*/
|
||||
if (!(args[nargs] = (char *) mxCalloc(strlen(mainarg)+1, sizeof(char))))
|
||||
if (!(args[nargs] = static_cast<char *> (mxCalloc(strlen(mainarg)+1, sizeof(char)))))
|
||||
DYN_MEX_FUNC_ERR_MSG_TXT("Error in MS-SBVAR MEX file: could not allocate memory. (2)");
|
||||
|
||||
strncpy(args[nargs++], mainarg, strlen(mainarg));
|
||||
|
@ -68,7 +68,7 @@ mexFunction(int nlhs, mxArray *plhs[],
|
|||
beginarg = &argument[0];
|
||||
while ((n = strcspn(beginarg, " ")))
|
||||
{
|
||||
if (!(args[nargs] = (char *) mxCalloc(n+1, sizeof(char))))
|
||||
if (!(args[nargs] = static_cast<char *> (mxCalloc(n+1, sizeof(char)))))
|
||||
DYN_MEX_FUNC_ERR_MSG_TXT("Error in MS-SBVAR MEX file: could not allocate memory. (3)");
|
||||
|
||||
strncpy(args[nargs++], beginarg, n);
|
||||
|
|
Loading…
Reference in New Issue