- got rid of the old numeric() function

Sat, 14 Jun 2014 09:58:58 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Sat, 14 Jun 2014 09:58:58 +0300
changeset 800
a1d9b7fff8f7
parent 799
c18c8846f6a7
child 801
f6abc9eb4217

- got rid of the old numeric() function

src/ldConfig.cc file | annotate | diff | comparison | revisions
src/miscallenous.cc file | annotate | diff | comparison | revisions
src/miscallenous.h file | annotate | diff | comparison | revisions
--- 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);
--- 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;
--- 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);
 

mercurial