{
// Print an optional message, something like "Checking timer t";
double t = elapsed_time();
+ std::streamsize ss = std::cout.precision();
if (_msg.empty() == false)
{
std::wcerr << L"[" << _msg << L"]" << L" : ";
std::wcerr << L"Elapsed time ["
<< std::setiosflags(std::ios::fixed)
<< std::setprecision(3)
- << t << L"] milliseconds"
+ << t
+ << std::setprecision(ss)
+ << L"] milliseconds"
<< std::endl;
if (_bRestart == true)
}
}
- types::String *pAllFields = pIT->getAs<types::String>();
+ types::String *pAllFields;
+ if (pIT)
+ {
+ pAllFields = pIT->getAs<types::String>();
+ }
+ else
+ {
+ Scierror(999, _("Could not retrieve sub-type.\n"));
+ return types::Function::Error;
+ }
wchar_t **pwcsAllStrings = pAllFields->get();
// shift to forget first value corresponding to type.
// ++pwcsAllStrings;
bt->s_file[i] = infos->dli_fname ? strdup(infos->dli_fname) : strdup(" ");
// we calculate the relative address in the library
- snprintf(buffer, 32, "%p", p - infos->dli_fbase);
+ snprintf(buffer, 32, "%p", (void*)(p - infos->dli_fbase));
bt->s_addr[i] = strdup(buffer);
}
}
{
case 'g':
case 'G':
- free *= kooctet;
+ free *= kooctet*kooctet;
+ break;
case 'm':
case 'M':
free *= kooctet;
case 'o':
case 'O':
free /= kooctet;
+ break;
}
return (int)free;
}
if (doc == NULL)
{
printf(_("Error: Could not parse file %s.\n"), xmlfilename);
- if (encoding)
- {
- FREE(encoding);
- encoding = NULL;
- }
+ FREE(encoding);
+ encoding = NULL;
return bOK;
}
{
printf(_("Error: Not a valid module file %s (encoding not '%s') Encoding '%s' found.\n"), xmlfilename, "utf-8", encoding);
}
- if (encoding)
- {
- FREE(encoding);
- encoding = NULL;
- }
+ FREE(encoding);
+ encoding = NULL;
}
return bOK;
}
filename_VERSION_module = (char*)MALLOC(sizeof(char) * len);
sprintf(filename_VERSION_module, FORMATVERSIONFILENAME, SciPath, pstModule);
FREE(pstModule);
- if (SciPath)
- {
- FREE(SciPath);
- SciPath = NULL;
- }
+ FREE(SciPath);
+ SciPath = NULL;
if (FileExist(filename_VERSION_module))
{
*sci_version_minor = version_minor;
*sci_version_maintenance = version_maintenance;
*sci_version_revision = version_revision;
- wcscpy(_pwstSciVersionString, pwstSciVersionString);
if (pwstSciVersionString)
{
+ wcscpy(_pwstSciVersionString, pwstSciVersionString);
FREE(pwstSciVersionString);
pwstSciVersionString = NULL;
}
+ else
+ {
+ _pwstSciVersionString = NULL;
+ }
}
else
{
fprintf(stderr, _("Error: Not a valid version file %s (encoding not 'utf-8') Encoding '%s' found\n"), filename_VERSION_module, encoding);
}
- if (encoding)
- {
- FREE(encoding);
- encoding = NULL;
- }
+ FREE(encoding);
+ encoding = NULL;
bOK = TRUE;
}
else
wcscpy(_pwstSciVersionString, L"");
bOK = TRUE;
}
-
- if (filename_VERSION_module)
- {
- FREE(filename_VERSION_module);
- filename_VERSION_module = NULL;
- }
+ FREE(filename_VERSION_module);
+ filename_VERSION_module = NULL;
}
return bOK;
}
{
scilabWriteW(parser.getErrorMessage());
ThreadManagement::UnlockParser();
+ FREE(command);
continue;
}
#endif
int ret = parser->getExitStatus();
delete parser;
+ FREE(pwstFileName);
return ret;
}