aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ebml.rs
diff options
context:
space:
mode:
authorMarijn Haverbeke <[email protected]>2011-03-24 12:11:32 +0100
committerGraydon Hoare <[email protected]>2011-03-25 08:22:52 -0700
commita0455144774de6c9dc0ff0e87fe4352f8a70cac3 (patch)
treea487499a7e61e5fbda47d93eba806fb02373d1ed /src/lib/ebml.rs
parentfix pretty-printer (diff)
downloadrust-a0455144774de6c9dc0ff0e87fe4352f8a70cac3.tar.xz
rust-a0455144774de6c9dc0ff0e87fe4352f8a70cac3.zip
Start making the standard-lib utf-8 aware
Finally implements _str.is_utf8, adds from_chars, from_char, to_chars, char_at, char_len, (push|pop|shift|unshift)_char. Also, proper character I/O for streams.
Diffstat (limited to 'src/lib/ebml.rs')
-rw-r--r--src/lib/ebml.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/ebml.rs b/src/lib/ebml.rs
index 5eb17022..d1697eba 100644
--- a/src/lib/ebml.rs
+++ b/src/lib/ebml.rs
@@ -21,18 +21,18 @@ type reader = rec(
// TODO: eventually use u64 or big here
impure fn read_vint(&io.reader reader) -> uint {
- auto a = reader.read_byte();
+ auto a = reader.read_byte() as u8;
if (a & 0x80u8 != 0u8) { ret (a & 0x7fu8) as uint; }
- auto b = reader.read_byte();
+ auto b = reader.read_byte() as u8;
if (a & 0x40u8 != 0u8) {
ret (((a & 0x3fu8) as uint) << 8u) | (b as uint);
}
- auto c = reader.read_byte();
+ auto c = reader.read_byte() as u8;
if (a & 0x20u8 != 0u8) {
ret (((a & 0x1fu8) as uint) << 16u) | ((b as uint) << 8u) |
(c as uint);
}
- auto d = reader.read_byte();
+ auto d = reader.read_byte() as u8;
if (a & 0x10u8 != 0u8) {
ret (((a & 0x0fu8) as uint) << 24u) | ((b as uint) << 16u) |
((c as uint) << 8u) | (d as uint);