@@ -157,7 +157,7 @@ macro_rules! expect_string {
157
157
}
158
158
159
159
160
- fn exponent_to_power ( e : i16 ) -> f64 {
160
+ fn exponent_to_power ( e : i32 ) -> f64 {
161
161
static POWERS : [ f64 ; 22 ] = [
162
162
1e1 , 1e2 , 1e3 , 1e4 , 1e5 , 1e6 , 1e7 , 1e8 ,
163
163
1e9 , 1e10 , 1e11 , 1e12 , 1e13 , 1e14 , 1e15 , 1e16 ,
@@ -185,7 +185,7 @@ fn exponent_to_power(e: i16) -> f64 {
185
185
}
186
186
}
187
187
188
- fn make_float ( num : u64 , e : i16 ) -> f64 {
188
+ fn make_float ( num : u64 , e : i32 ) -> f64 {
189
189
( num as f64 ) * exponent_to_power ( e)
190
190
}
191
191
@@ -457,7 +457,7 @@ impl<'a> Parser<'a> {
457
457
// Attempt to continue reading digits that would overflow
458
458
// u64 into freshly converted f64
459
459
460
- let mut e = 0i16 ;
460
+ let mut e = 0i32 ;
461
461
loop {
462
462
match next_byte ! ( self || break ) {
463
463
b'0' ... b'9' => e += 1 ,
@@ -471,7 +471,7 @@ impl<'a> Parser<'a> {
471
471
self . read_number_with_fraction ( num, e)
472
472
}
473
473
474
- fn read_number_with_fraction ( & mut self , mut num : u64 , mut e : i16 ) -> JsonResult < f64 > {
474
+ fn read_number_with_fraction ( & mut self , mut num : u64 , mut e : i32 ) -> JsonResult < f64 > {
475
475
if next_byte ! ( self || return Ok ( make_float( num, e) ) ) == b'.' {
476
476
loop {
477
477
let ch = next_byte ! ( self || break ) ;
@@ -508,11 +508,11 @@ impl<'a> Parser<'a> {
508
508
509
509
let ch = next_byte ! ( self ) ;
510
510
let mut e = match ch {
511
- b'0' ... b'9' => ( ch - b'0' ) as i16 ,
511
+ b'0' ... b'9' => ( ch - b'0' ) as i32 ,
512
512
_ => return self . unexpected_character ( ch) ,
513
513
} ;
514
514
515
- read_num ! ( self , digit, e = ( e << 3 ) + ( e << 1 ) + digit as i16 ) ;
515
+ read_num ! ( self , digit, e = ( e << 3 ) + ( e << 1 ) + digit as i32 ) ;
516
516
517
517
return Ok ( num * exponent_to_power ( e * sign) ) ;
518
518
} ,
0 commit comments