Skip to content

Commit b407c9f

Browse files
committed
indicies must be uint
1 parent 11b347c commit b407c9f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

datetime.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,23 @@ static month_lookup_vec: [i32, ..365] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
5252
#[inline(always)]
5353
pub fn month_lookup(doy: i32, ly: bool) -> i32 {
5454
let xtra = (ly && doy > 58) as i32;
55-
month_lookup_vec[doy - xtra]
55+
month_lookup_vec[(doy - xtra) as uint]
5656
}
5757

5858
static accume_days_vec: [i32, ..13] = [0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
5959

6060
#[inline(always)]
6161
fn accume_days(m: i32, ly: bool) -> i32 {
6262
let xtra = (ly && m > 2) as i32;
63-
accume_days_vec[m] + xtra
63+
accume_days_vec[m as uint] + xtra
6464
}
6565

6666
static month_length_vec: [i32, ..13] = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
6767

6868
#[inline(always)]
6969
pub fn month_length(m: i32, ly: bool) -> i32 {
7070
let xtra = (ly && m == 2) as i32;
71-
month_length_vec[m] + xtra
71+
month_length_vec[m as uint] + xtra
7272
}
7373

7474
pub struct DateSpec { year: i32, mon: i32, mday: i32, yday: i32}

0 commit comments

Comments
 (0)