replace use of old-style casts

time-shift
Houtan Bastani 2019-07-30 15:15:23 -04:00
parent 53ae549350
commit 1501032a3f
No known key found for this signature in database
GPG Key ID: 000094FB955BE169
1 changed files with 5 additions and 5 deletions

View File

@ -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);