diff --git a/apps/opencs/view/settings/usersettingsdialog.hpp b/apps/opencs/view/settings/usersettingsdialog.hpp index 2047efde3..31d40ca01 100644 --- a/apps/opencs/view/settings/usersettingsdialog.hpp +++ b/apps/opencs/view/settings/usersettingsdialog.hpp @@ -3,6 +3,7 @@ #include #include +#include #ifndef Q_MOC_RUN #include diff --git a/components/compiler/scanner.cpp b/components/compiler/scanner.cpp index d5095a50a..b45015d1e 100644 --- a/components/compiler/scanner.cpp +++ b/components/compiler/scanner.cpp @@ -1,6 +1,7 @@ #include "scanner.hpp" +#include #include #include #include @@ -163,6 +164,7 @@ namespace Compiler bool Scanner::scanInt (char c, Parser& parser, bool& cont) { + assert(c != '\0'); std::string value; value += c; @@ -187,11 +189,7 @@ namespace Compiler } } - /* - * value could be empty only if scanInt is called with c == '\0'. - * That is unlikely so it should be replaced by assertion. - */ - if (value.empty() || error) + if (error) return false; TokenLoc loc (mLoc);