Fix signed/unsigned bug, likely cause of windows crash.
This commit is contained in:
parent
2c06e7aac9
commit
241085a073
@ -955,7 +955,7 @@ fn encode_index<T>(ebml_w: ebml::writer, buckets: ~[@~[entry<T>]],
|
||||
ebml_w.start_tag(tag_index_buckets_bucket);
|
||||
for vec::each(*bucket) |elt| {
|
||||
ebml_w.start_tag(tag_index_buckets_bucket_elt);
|
||||
assert elt.pos < (u32::max_value as uint);
|
||||
assert elt.pos < 0xffff_ffff;
|
||||
writer.write_be_u32(elt.pos as u32);
|
||||
write_fn(writer, elt.val);
|
||||
ebml_w.end_tag();
|
||||
@ -965,7 +965,7 @@ fn encode_index<T>(ebml_w: ebml::writer, buckets: ~[@~[entry<T>]],
|
||||
ebml_w.end_tag();
|
||||
ebml_w.start_tag(tag_index_table);
|
||||
for bucket_locs.each |pos| {
|
||||
assert pos < (u32::max_value as uint);
|
||||
assert pos < 0xffff_ffff;
|
||||
writer.write_be_u32(pos as u32);
|
||||
}
|
||||
ebml_w.end_tag();
|
||||
@ -975,7 +975,7 @@ fn encode_index<T>(ebml_w: ebml::writer, buckets: ~[@~[entry<T>]],
|
||||
fn write_str(writer: io::writer, &&s: ~str) { writer.write_str(s); }
|
||||
|
||||
fn write_int(writer: io::writer, &&n: int) {
|
||||
assert n < (u32::max_value as int);
|
||||
assert n < 0x7fff_ffff;
|
||||
writer.write_be_u32(n as u32);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user