unify error messages

- start with capital letter (unless it's a function name)
- end with period

Change-Id: I62350ca2c632cf27334fe6acad2ad0487eef74a4
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
Oswald Buddenhagen
2012-07-31 16:20:36 +02:00
parent 397cfb700b
commit 40ec38735e
2 changed files with 23 additions and 23 deletions

View File

@@ -276,7 +276,7 @@ ProStringList QMakeEvaluator::evaluateExpandFunction(
} }
case E_SPRINTF: case E_SPRINTF:
if (args.count() < 1) { if (args.count() < 1) {
evalError(fL1S("sprintf(format, ...) requires at least one argument")); evalError(fL1S("sprintf(format, ...) requires at least one argument."));
} else { } else {
QString tmp = args.at(0).toQString(m_tmp1); QString tmp = args.at(0).toQString(m_tmp1);
for (int i = 1; i < args.count(); ++i) for (int i = 1; i < args.count(); ++i)
@@ -312,7 +312,7 @@ ProStringList QMakeEvaluator::evaluateExpandFunction(
} }
case E_SPLIT: case E_SPLIT:
if (args.count() < 1 || args.count() > 2) { if (args.count() < 1 || args.count() > 2) {
evalError(fL1S("split(var, sep) requires one or two arguments")); evalError(fL1S("split(var, sep) requires one or two arguments."));
} else { } else {
const QString &sep = (args.count() == 2) ? args.at(1).toQString(m_tmp1) : statics.field_sep; const QString &sep = (args.count() == 2) ? args.at(1).toQString(m_tmp1) : statics.field_sep;
foreach (const ProString &var, values(map(args.at(0)))) foreach (const ProString &var, values(map(args.at(0))))
@@ -347,7 +347,7 @@ ProStringList QMakeEvaluator::evaluateExpandFunction(
if (args.count() == 3) if (args.count() == 3)
end = args.at(2).toQString(m_tmp1).toInt(&ok); end = args.at(2).toQString(m_tmp1).toInt(&ok);
if (!ok) if (!ok)
evalError(fL1S("member() argument 3 (end) '%2' invalid.\n") evalError(fL1S("member() argument 3 (end) '%2' invalid.")
.arg(args.at(2).toQString(m_tmp1))); .arg(args.at(2).toQString(m_tmp1)));
} }
} }
@@ -423,7 +423,7 @@ ProStringList QMakeEvaluator::evaluateExpandFunction(
break; break;
case E_EVAL: case E_EVAL:
if (args.count() != 1) { if (args.count() != 1) {
evalError(fL1S("eval(variable) requires one argument")); evalError(fL1S("eval(variable) requires one argument."));
} else { } else {
ret += values(map(args.at(0))); ret += values(map(args.at(0)));
} }
@@ -548,7 +548,7 @@ ProStringList QMakeEvaluator::evaluateExpandFunction(
break; break;
case E_FILES: case E_FILES:
if (args.count() != 1 && args.count() != 2) { if (args.count() != 1 && args.count() != 2) {
evalError(fL1S("files(pattern, recursive=false) requires one or two arguments")); evalError(fL1S("files(pattern, recursive=false) requires one or two arguments."));
} else { } else {
bool recursive = false; bool recursive = false;
if (args.count() == 2) if (args.count() == 2)
@@ -591,7 +591,7 @@ ProStringList QMakeEvaluator::evaluateExpandFunction(
break; break;
case E_REPLACE: case E_REPLACE:
if (args.count() != 3 ) { if (args.count() != 3 ) {
evalError(fL1S("replace(var, before, after) requires three arguments")); evalError(fL1S("replace(var, before, after) requires three arguments."));
} else { } else {
const QRegExp before(args.at(1).toQString()); const QRegExp before(args.at(1).toQString());
const QString &after(args.at(2).toQString(m_tmp2)); const QString &after(args.at(2).toQString(m_tmp2));
@@ -606,7 +606,7 @@ ProStringList QMakeEvaluator::evaluateExpandFunction(
case E_SORT_DEPENDS: case E_SORT_DEPENDS:
case E_RESOLVE_DEPENDS: case E_RESOLVE_DEPENDS:
if (args.count() < 1 || args.count() > 2) { if (args.count() < 1 || args.count() > 2) {
evalError(fL1S("%1(var, prefix) requires one or two arguments").arg(func.toQString(m_tmp1))); evalError(fL1S("%1(var, prefix) requires one or two arguments.").arg(func.toQString(m_tmp1)));
} else { } else {
QHash<ProString, QSet<ProString> > dependencies; QHash<ProString, QSet<ProString> > dependencies;
ProValueMap dependees; ProValueMap dependees;
@@ -628,11 +628,11 @@ ProStringList QMakeEvaluator::evaluateExpandFunction(
} }
break; break;
case E_INVALID: case E_INVALID:
evalError(fL1S("'%1' is not a recognized replace function") evalError(fL1S("'%1' is not a recognized replace function.")
.arg(func.toQString(m_tmp1))); .arg(func.toQString(m_tmp1)));
break; break;
default: default:
evalError(fL1S("Function '%1' is not implemented").arg(func.toQString(m_tmp1))); evalError(fL1S("Function '%1' is not implemented.").arg(func.toQString(m_tmp1)));
break; break;
} }
@@ -656,7 +656,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConditionalFunction(
return returnBool(m_functionDefs.testFunctions.contains(args[0])); return returnBool(m_functionDefs.testFunctions.contains(args[0]));
else if (args[1] == QLatin1String("replace")) else if (args[1] == QLatin1String("replace"))
return returnBool(m_functionDefs.replaceFunctions.contains(args[0])); return returnBool(m_functionDefs.replaceFunctions.contains(args[0]));
evalError(fL1S("defined(function, type): unexpected type [%1].\n") evalError(fL1S("defined(function, type): unexpected type [%1].")
.arg(args.at(1).toQString(m_tmp1))); .arg(args.at(1).toQString(m_tmp1)));
return ReturnFalse; return ReturnFalse;
} }
@@ -743,14 +743,14 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConditionalFunction(
return ReturnFalse; return ReturnFalse;
if (m_loopLevel) if (m_loopLevel)
return ReturnBreak; return ReturnBreak;
evalError(fL1S("unexpected break().")); evalError(fL1S("Unexpected break()."));
return ReturnFalse; return ReturnFalse;
case T_NEXT: case T_NEXT:
if (m_skipLevel) if (m_skipLevel)
return ReturnFalse; return ReturnFalse;
if (m_loopLevel) if (m_loopLevel)
return ReturnNext; return ReturnNext;
evalError(fL1S("unexpected next().")); evalError(fL1S("Unexpected next()."));
return ReturnFalse; return ReturnFalse;
case T_IF: { case T_IF: {
if (m_skipLevel && !m_cumulative) if (m_skipLevel && !m_cumulative)
@@ -898,7 +898,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConditionalFunction(
|| comp == QLatin1String("=") || comp == QLatin1String("==")) { || comp == QLatin1String("=") || comp == QLatin1String("==")) {
return returnBool(cnt == val); return returnBool(cnt == val);
} else { } else {
evalError(fL1S("unexpected modifier to count(%2)").arg(comp.toQString(m_tmp1))); evalError(fL1S("Unexpected modifier to count(%2).").arg(comp.toQString(m_tmp1)));
return ReturnFalse; return ReturnFalse;
} }
} }
@@ -1104,11 +1104,11 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConditionalFunction(
return ReturnFalse; return ReturnFalse;
} }
case T_INVALID: case T_INVALID:
evalError(fL1S("'%1' is not a recognized test function") evalError(fL1S("'%1' is not a recognized test function.")
.arg(function.toQString(m_tmp1))); .arg(function.toQString(m_tmp1)));
return ReturnFalse; return ReturnFalse;
default: default:
evalError(fL1S("Function '%1' is not implemented").arg(function.toQString(m_tmp1))); evalError(fL1S("Function '%1' is not implemented.").arg(function.toQString(m_tmp1)));
return ReturnFalse; return ReturnFalse;
} }
} }

View File

@@ -697,7 +697,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProLoop(
if (!variable.isEmpty()) if (!variable.isEmpty())
m_valuemapStack.top()[variable] = ProStringList(ProString(QString::number(index++), NoHash)); m_valuemapStack.top()[variable] = ProStringList(ProString(QString::number(index++), NoHash));
if (index > 1000) { if (index > 1000) {
evalError(fL1S("ran into infinite loop (> 1000 iterations).")); evalError(fL1S("Ran into infinite loop (> 1000 iterations)."));
break; break;
} }
} else { } else {
@@ -752,13 +752,13 @@ void QMakeEvaluator::visitProVariable(
const ProStringList &varVal = expandVariableReferences(tokPtr, sizeHint, true); const ProStringList &varVal = expandVariableReferences(tokPtr, sizeHint, true);
const QString &val = varVal.at(0).toQString(m_tmp1); const QString &val = varVal.at(0).toQString(m_tmp1);
if (val.length() < 4 || val.at(0) != QLatin1Char('s')) { if (val.length() < 4 || val.at(0) != QLatin1Char('s')) {
evalError(fL1S("the ~= operator can handle only the s/// function.")); evalError(fL1S("The ~= operator can handle only the s/// function."));
return; return;
} }
QChar sep = val.at(1); QChar sep = val.at(1);
QStringList func = val.split(sep); QStringList func = val.split(sep);
if (func.count() < 3 || func.count() > 4) { if (func.count() < 3 || func.count() > 4) {
evalError(fL1S("the s/// function expects 3 or 4 arguments.")); evalError(fL1S("The s/// function expects 3 or 4 arguments."));
return; return;
} }
@@ -1071,7 +1071,7 @@ bool QMakeEvaluator::loadSpec()
goto cool; goto cool;
} }
} }
evalError(fL1S("Could not find qmake configuration file %1").arg(qmakespec)); evalError(fL1S("Could not find qmake configuration file %1.").arg(qmakespec));
return false; return false;
} }
cool: cool:
@@ -1085,7 +1085,7 @@ bool QMakeEvaluator::loadSpec()
return false; return false;
QString spec = m_qmakespec + QLatin1String("/qmake.conf"); QString spec = m_qmakespec + QLatin1String("/qmake.conf");
if (!evaluateFileDirect(spec, QMakeHandler::EvalConfigFile, LoadProOnly)) { if (!evaluateFileDirect(spec, QMakeHandler::EvalConfigFile, LoadProOnly)) {
evalError(fL1S("Could not read qmake configuration file %1").arg(spec)); evalError(fL1S("Could not read qmake configuration file %1.").arg(spec));
return false; return false;
} }
#ifdef Q_OS_UNIX #ifdef Q_OS_UNIX
@@ -1735,7 +1735,7 @@ ProStringList QMakeEvaluator::evaluateFunction(
ProStringList ret; ProStringList ret;
if (m_valuemapStack.count() >= 100) { if (m_valuemapStack.count() >= 100) {
evalError(fL1S("ran into infinite recursion (depth > 100).")); evalError(fL1S("Ran into infinite recursion (depth > 100)."));
oki = false; oki = false;
} else { } else {
m_valuemapStack.push(ProValueMap()); m_valuemapStack.push(ProValueMap());
@@ -1781,7 +1781,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBoolFunction(
if (val) if (val)
return ReturnTrue; return ReturnTrue;
} else { } else {
evalError(fL1S("Unexpected return value from test '%1': %2") evalError(fL1S("Unexpected return value from test '%1': %2.")
.arg(function.toQString(m_tmp1)) .arg(function.toQString(m_tmp1))
.arg(ret.join(QLatin1String(" :: ")))); .arg(ret.join(QLatin1String(" :: "))));
} }
@@ -1926,7 +1926,7 @@ bool QMakeEvaluator::evaluateFile(
return false; return false;
foreach (const ProFile *pf, m_profileStack) foreach (const ProFile *pf, m_profileStack)
if (pf->fileName() == fileName) { if (pf->fileName() == fileName) {
evalError(fL1S("circular inclusion of %1").arg(fileName)); evalError(fL1S("Circular inclusion of %1.").arg(fileName));
return false; return false;
} }
return evaluateFileDirect(fileName, type, flags); return evaluateFileDirect(fileName, type, flags);