develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34172 - trunk/languages/perl6/src/pmc

From:
infinoid
Date:
December 20, 2008 19:19
Subject:
[svn:parrot] r34172 - trunk/languages/perl6/src/pmc
Message ID:
20081221031907.CB5EFCBA12@x12.develooper.com
Author: infinoid
Date: Sat Dec 20 19:19:07 2008
New Revision: 34172

Modified:
   trunk/languages/perl6/src/pmc/perl6str.pmc

Log:
[cage] Fix up some t/codingstd/check_isxxx.t failures.
Reformat some if/else chains to make it a little more readable.

Modified: trunk/languages/perl6/src/pmc/perl6str.pmc
==============================================================================
--- trunk/languages/perl6/src/pmc/perl6str.pmc	(original)
+++ trunk/languages/perl6/src/pmc/perl6str.pmc	Sat Dec 20 19:19:07 2008
@@ -33,9 +33,12 @@
     //continue until the end or until we've hit a non-digit
     while (pos + underscore_skip < stop) {
         unsigned int current = *(pos + underscore_skip);
-        if (isdigit(current))      current -= '0';
-        else if (isalpha(current)) current = tolower((unsigned char)current) - 'a' + 10;
-        else break;
+        if (isdigit((unsigned char)current))
+            current -= '0';
+        else if (isalpha((unsigned char)current))
+            current = tolower((unsigned char)current) - 'a' + 10;
+        else
+           break;
 
         if (current >= radix) break;
         number = number * radix + current;
@@ -57,9 +60,12 @@
         unsigned int current = *(pos + underscore_skip);
         /* if we find an 'e' in radix 10, we're done */
         if (radix == 10 && tolower((unsigned char)current) == 'e') break;
-        if (isdigit(current)) current -= '0';
-        else if (isalpha(current)) current = tolower((unsigned char)current) - 'a' + 10;
-        else break;
+        if (isdigit((unsigned char)current))
+            current -= '0';
+        else if (isalpha((unsigned char)current))
+            current = tolower((unsigned char)current) - 'a' + 10;
+        else
+            break;
 
         if (current >= radix) break;
         frac /= radix;



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About