change some statics to constants

This commit is contained in:
Oliver 'ker' Schneider
2015-06-07 19:50:13 +02:00
parent 2c8d75d655
commit ec078a033b
13 changed files with 18 additions and 22 deletions

View File

@@ -24,7 +24,6 @@ use num::flt2dec::estimator::estimate_scaling_factor;
use num::flt2dec::bignum::Digit32 as Digit;
use num::flt2dec::bignum::Big32x36 as Big;
// FIXME(#22540) const ref to static array seems to ICE
static POW10: [Digit; 10] = [1, 10, 100, 1000, 10000, 100000,
1000000, 10000000, 100000000, 1000000000];
static TWOPOW10: [Digit; 10] = [2, 20, 200, 2000, 20000, 200000,
@@ -328,4 +327,3 @@ pub fn format_exact(d: &Decoded, buf: &mut [u8], limit: i16) -> (/*#digits*/ usi
(len, k)
}

View File

@@ -87,7 +87,7 @@ for i in xrange(-308, 333, 8):
f = ((f << 64 >> (l-1)) + 1) >> 1; e += l - 64
print ' (%#018x, %5d, %4d),' % (f, e, i)
*/
// FIXME(#22540) const ref to static array seems to ICE
#[doc(hidden)]
pub static CACHED_POW10: [(u64, i16, i16); 81] = [ // (f, e, k)
(0xe61acf033d1a45df, -1087, -308),
@@ -746,4 +746,3 @@ pub fn format_exact(d: &Decoded, buf: &mut [u8], limit: i16) -> (/*#digits*/ usi
None => fallback(d, buf, limit),
}
}