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:
if (args.count() < 1) {
evalError(fL1S("sprintf(format, ...) requires at least one argument"));
evalError(fL1S("sprintf(format, ...) requires at least one argument."));
} else {
QString tmp = args.at(0).toQString(m_tmp1);
for (int i = 1; i < args.count(); ++i)
@@ -312,7 +312,7 @@ ProStringList QMakeEvaluator::evaluateExpandFunction(
}
case E_SPLIT:
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 {
const QString &sep = (args.count() == 2) ? args.at(1).toQString(m_tmp1) : statics.field_sep;
foreach (const ProString &var, values(map(args.at(0))))
@@ -347,7 +347,7 @@ ProStringList QMakeEvaluator::evaluateExpandFunction(
if (args.count() == 3)
end = args.at(2).toQString(m_tmp1).toInt(&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)));
}
}
@@ -423,7 +423,7 @@ ProStringList QMakeEvaluator::evaluateExpandFunction(
break;
case E_EVAL:
if (args.count() != 1) {
evalError(fL1S("eval(variable) requires one argument"));
evalError(fL1S("eval(variable) requires one argument."));
} else {
ret += values(map(args.at(0)));
}
@@ -548,7 +548,7 @@ ProStringList QMakeEvaluator::evaluateExpandFunction(
break;
case E_FILES:
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 {
bool recursive = false;
if (args.count() == 2)
@@ -591,7 +591,7 @@ ProStringList QMakeEvaluator::evaluateExpandFunction(
break;
case E_REPLACE:
if (args.count() != 3 ) {
evalError(fL1S("replace(var, before, after) requires three arguments"));
evalError(fL1S("replace(var, before, after) requires three arguments."));
} else {
const QRegExp before(args.at(1).toQString());
const QString &after(args.at(2).toQString(m_tmp2));
@@ -606,7 +606,7 @@ ProStringList QMakeEvaluator::evaluateExpandFunction(
case E_SORT_DEPENDS:
case E_RESOLVE_DEPENDS:
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 {
QHash<ProString, QSet<ProString> > dependencies;
ProValueMap dependees;
@@ -628,11 +628,11 @@ ProStringList QMakeEvaluator::evaluateExpandFunction(
}
break;
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)));
break;
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;
}
@@ -656,7 +656,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConditionalFunction(
return returnBool(m_functionDefs.testFunctions.contains(args[0]));
else if (args[1] == QLatin1String("replace"))
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)));
return ReturnFalse;
}
@@ -743,14 +743,14 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConditionalFunction(
return ReturnFalse;
if (m_loopLevel)
return ReturnBreak;
evalError(fL1S("unexpected break()."));
evalError(fL1S("Unexpected break()."));
return ReturnFalse;
case T_NEXT:
if (m_skipLevel)
return ReturnFalse;
if (m_loopLevel)
return ReturnNext;
evalError(fL1S("unexpected next()."));
evalError(fL1S("Unexpected next()."));
return ReturnFalse;
case T_IF: {
if (m_skipLevel && !m_cumulative)
@@ -898,7 +898,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConditionalFunction(
|| comp == QLatin1String("=") || comp == QLatin1String("==")) {
return returnBool(cnt == val);
} 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;
}
}
@@ -1104,11 +1104,11 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConditionalFunction(
return ReturnFalse;
}
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)));
return ReturnFalse;
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;
}
}

View File

@@ -697,7 +697,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProLoop(
if (!variable.isEmpty())
m_valuemapStack.top()[variable] = ProStringList(ProString(QString::number(index++), NoHash));
if (index > 1000) {
evalError(fL1S("ran into infinite loop (> 1000 iterations)."));
evalError(fL1S("Ran into infinite loop (> 1000 iterations)."));
break;
}
} else {
@@ -752,13 +752,13 @@ void QMakeEvaluator::visitProVariable(
const ProStringList &varVal = expandVariableReferences(tokPtr, sizeHint, true);
const QString &val = varVal.at(0).toQString(m_tmp1);
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;
}
QChar sep = val.at(1);
QStringList func = val.split(sep);
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;
}
@@ -1071,7 +1071,7 @@ bool QMakeEvaluator::loadSpec()
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;
}
cool:
@@ -1085,7 +1085,7 @@ bool QMakeEvaluator::loadSpec()
return false;
QString spec = m_qmakespec + QLatin1String("/qmake.conf");
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;
}
#ifdef Q_OS_UNIX
@@ -1735,7 +1735,7 @@ ProStringList QMakeEvaluator::evaluateFunction(
ProStringList ret;
if (m_valuemapStack.count() >= 100) {
evalError(fL1S("ran into infinite recursion (depth > 100)."));
evalError(fL1S("Ran into infinite recursion (depth > 100)."));
oki = false;
} else {
m_valuemapStack.push(ProValueMap());
@@ -1781,7 +1781,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBoolFunction(
if (val)
return ReturnTrue;
} 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(ret.join(QLatin1String(" :: "))));
}
@@ -1926,7 +1926,7 @@ bool QMakeEvaluator::evaluateFile(
return false;
foreach (const ProFile *pf, m_profileStack)
if (pf->fileName() == fileName) {
evalError(fL1S("circular inclusion of %1").arg(fileName));
evalError(fL1S("Circular inclusion of %1.").arg(fileName));
return false;
}
return evaluateFileDirect(fileName, type, flags);