Skip to content

Commit 1bf0881

Browse files
committed
0.8.6 that nativejson conformance test though…
1 parent d295122 commit 1bf0881

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/parser.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ macro_rules! expect_string {
157157
}
158158

159159

160-
fn exponent_to_power(e: i16) -> f64 {
160+
fn exponent_to_power(e: i32) -> f64 {
161161
static POWERS: [f64; 22] = [
162162
1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8,
163163
1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16,
@@ -185,7 +185,7 @@ fn exponent_to_power(e: i16) -> f64 {
185185
}
186186
}
187187

188-
fn make_float(num: u64, e: i16) -> f64 {
188+
fn make_float(num: u64, e: i32) -> f64 {
189189
(num as f64) * exponent_to_power(e)
190190
}
191191

@@ -457,7 +457,7 @@ impl<'a> Parser<'a> {
457457
// Attempt to continue reading digits that would overflow
458458
// u64 into freshly converted f64
459459

460-
let mut e = 0i16;
460+
let mut e = 0i32;
461461
loop {
462462
match next_byte!(self || break) {
463463
b'0' ... b'9' => e += 1,
@@ -471,7 +471,7 @@ impl<'a> Parser<'a> {
471471
self.read_number_with_fraction(num, e)
472472
}
473473

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> {
475475
if next_byte!(self || return Ok(make_float(num, e))) == b'.' {
476476
loop {
477477
let ch = next_byte!(self || break);
@@ -508,11 +508,11 @@ impl<'a> Parser<'a> {
508508

509509
let ch = next_byte!(self);
510510
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,
512512
_ => return self.unexpected_character(ch),
513513
};
514514

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);
516516

517517
return Ok(num * exponent_to_power(e * sign));
518518
},

0 commit comments

Comments
 (0)