diff --git a/mex/sources/ms-sbvar/mex_top_level.cc b/mex/sources/ms-sbvar/mex_top_level.cc index d2542c4be..7c2f6d56b 100644 --- a/mex/sources/ms-sbvar/mex_top_level.cc +++ b/mex/sources/ms-sbvar/mex_top_level.cc @@ -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 (mxGetN(prhs[0])/2+1); + argument = static_cast (mxCalloc(mxGetN(prhs[0])+1, sizeof(char))); + args = static_cast (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 (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 (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);