STYLE: remove FULLDEBUG output on readLabel, readScalar

- used in various places to test if the input can be parsed as a
  label/scalar, so warnings tend to flood the output.

- be more explicit when encountering range errors
This commit is contained in:
Mark Olesen
2017-10-12 12:15:56 +02:00
parent 9bb8f6aefc
commit f116217466
10 changed files with 79 additions and 138 deletions

View File

@ -30,7 +30,8 @@ License
const Foam::Enum<Foam::parsing::errorType>
Foam::parsing::errorNames
{
{ errorType::GENERAL, "General error parsing" },
{ errorType::GENERAL, "General error parsing" },
{ errorType::RANGE, "Range error while parsing" },
{ errorType::TRAILING, "Trailing content found parsing" },
};

View File

@ -56,7 +56,8 @@ namespace parsing
{
NONE = 0, //!< No error encountered
GENERAL = 1, //!< General parsing error
TRAILING = 2, //!< Trailing content detected
RANGE = 2, //!< Range error
TRAILING = 3, //!< Trailing content detected
};

View File

@ -32,7 +32,7 @@ inline Foam::parsing::errorType Foam::parsing::checkConversion
if (errno || endptr == buf)
{
// Some type of error OR no conversion
return errorType::GENERAL;
return (errno == ERANGE ? errorType::RANGE : errorType::GENERAL);
}
// Trailing spaces are permitted