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;