ValueFlow: Use getOrdinalText()

This commit is contained in:
Daniel Marjamäki 2017-05-23 15:01:56 +02:00
parent e73657b198
commit 6e1544bd49
1 changed files with 2 additions and 9 deletions

View File

@ -24,6 +24,7 @@
#include "symboldatabase.h"
#include "token.h"
#include "tokenlist.h"
#include "utils.h"
#include <stack>
namespace {
@ -2766,15 +2767,7 @@ static void valueFlowSubFunction(TokenList *tokenlist, ErrorLogger *errorLogger,
// Error path..
for (std::list<ValueFlow::Value>::iterator it = argvalues.begin(); it != argvalues.end(); ++it) {
std::string nr = MathLib::toString(argnr + 1);
if (argnr==0)
nr += "st";
else if (argnr==1)
nr += "nd";
else if (argnr==2)
nr += "rd";
else
nr += "th";
std::string nr = MathLib::toString(argnr + 1) + getOrdinalText(argnr + 1);
it->errorPath.push_back(ErrorPathItem(argtok,
"Calling function '" +