Revert "Use different syntax for checks that matter to typestate"

This reverts commit aa25f22f19. It broke stage2, not sure why yet.
This commit is contained in:
Graydon Hoare
2011-05-02 16:24:09 -07:00
parent 764de078e7
commit d08b443fff
182 changed files with 1239 additions and 1256 deletions

View File

@@ -72,7 +72,7 @@ state obj FILE_buf_reader(os.libc.FILE f, bool must_close) {
ret os.libc.feof(f) != 0;
}
fn seek(int offset, seek_style whence) {
assert (os.libc.fseek(f, offset, convert_whence(whence)) == 0);
check (os.libc.fseek(f, offset, convert_whence(whence)) == 0);
}
fn tell() -> uint {
ret os.libc.ftell(f) as uint;
@@ -101,14 +101,14 @@ state obj new_reader(buf_reader rdr) {
if (c0 == -1) {ret -1 as char;} // FIXME will this stay valid?
auto b0 = c0 as u8;
auto w = _str.utf8_char_width(b0);
assert (w > 0u);
check(w > 0u);
if (w == 1u) {ret b0 as char;}
auto val = 0u;
while (w > 1u) {
w -= 1u;
auto next = rdr.read_byte();
assert (next > -1);
assert (next & 0xc0 == 0x80);
check(next > -1);
check(next & 0xc0 == 0x80);
val <<= 6u;
val += (next & 0x3f) as uint;
}
@@ -279,7 +279,7 @@ state obj FILE_writer(os.libc.FILE f, bool must_close) {
}
fn seek(int offset, seek_style whence) {
assert (os.libc.fseek(f, offset, convert_whence(whence)) == 0);
check(os.libc.fseek(f, offset, convert_whence(whence)) == 0);
}
fn tell() -> uint {