# HG changeset patch # User Santeri Piippo # Date 1402729138 -10800 # Node ID a1d9b7fff8f7a30cf393b902624d927e1daa37d3 # Parent c18c8846f6a7ab500001439e2aeffc4955e7761a - got rid of the old numeric() function diff -r c18c8846f6a7 -r a1d9b7fff8f7 src/ldConfig.cc --- a/src/ldConfig.cc Sat Jun 14 09:56:07 2014 +0300 +++ b/src/ldConfig.cc Sat Jun 14 09:58:58 2014 +0300 @@ -83,9 +83,6 @@ if (not parseLDConfigTag (pars, "CODE", valuestr)) continue; - if (not numeric (valuestr)) - continue; // not a number - // Ensure that the code is within [0 - 511] bool ok; code = valuestr.toShort (&ok); diff -r c18c8846f6a7 -r a1d9b7fff8f7 src/miscallenous.cc --- a/src/miscallenous.cc Sat Jun 14 09:56:07 2014 +0300 +++ b/src/miscallenous.cc Sat Jun 14 09:58:58 2014 +0300 @@ -138,38 +138,6 @@ // ============================================================================= // -bool numeric (const QString& tok) -{ - bool gotDot = false; - - for (int i = 0; i < tok.length(); ++i) - { - const QChar c = tok[i]; - - // Allow leading hyphen for negatives - if (i == 0 && c == '-') - continue; - - // Check for decimal point - if (not gotDot && c == '.') - { - gotDot = true; - continue; - } - - if (c >= '0' && c <= '9') - continue; // Digit - - // If the above cases didn't catch this character, it was - // illegal and this is therefore not a number. - return false; - } - - return true; -} - -// ============================================================================= -// void simplify (int& numer, int& denom) { bool repeat; diff -r c18c8846f6a7 -r a1d9b7fff8f7 src/miscallenous.h --- a/src/miscallenous.h Sat Jun 14 09:56:07 2014 +0300 +++ b/src/miscallenous.h Sat Jun 14 09:58:58 2014 +0300 @@ -32,9 +32,6 @@ // Prime numbers extern const int g_primes[NUM_PRIMES]; -// Returns whether a given string represents a floating point number. -bool numeric (const QString& tok); - // Simplifies the given fraction. void simplify (int& numer, int& denom);