| ... | ... | @@ -220,7 +220,8 @@ pub const File = struct { |
| 220 | 220 | pub fn seekTo(self: &File, pos: usize) -> %void { |
| 221 | 221 | switch (builtin.os) { |
| 222 | 222 | Os.linux, Os.macosx, Os.ios => { |
| 223 | | const result = system.lseek(self.handle, @bitCast(isize, pos), system.SEEK_SET); |
| 223 | const ipos = try math.cast(isize, pos); |
| 224 | const result = system.lseek(self.handle, ipos, system.SEEK_SET); |
| 224 | 225 | const err = system.getErrno(result); |
| 225 | 226 | if (err > 0) { |
| 226 | 227 | return switch (err) { |
| ... | ... | @@ -234,7 +235,8 @@ pub const File = struct { |
| 234 | 235 | } |
| 235 | 236 | }, |
| 236 | 237 | Os.windows => { |
| 237 | | if (system.SetFilePointerEx(self.handle, @bitCast(isize, pos), null, system.FILE_BEGIN) == 0) { |
| 238 | const ipos = try math.cast(isize, pos); |
| 239 | if (system.SetFilePointerEx(self.handle, ipos, null, system.FILE_BEGIN) == 0) { |
| 238 | 240 | const err = system.GetLastError(); |
| 239 | 241 | return switch (err) { |
| 240 | 242 | system.ERROR.INVALID_PARAMETER => error.BadFd, |