| ... | ... | @@ -242,7 +242,7 @@ pub const File = struct { |
| 242 | 242 | }, |
| 243 | 243 | Os.windows => { |
| 244 | 244 | var pos: windows.LARGE_INTEGER = undefined; |
| 245 | | if (windows.SetFilePointerEx(self.handle, 0, *pos, windows.FILE_CURRENT) == 0) { |
| 245 | if (windows.SetFilePointerEx(self.handle, 0, &pos, windows.FILE_CURRENT) == 0) { |
| 246 | 246 | const err = windows.GetLastError(); |
| 247 | 247 | return switch (err) { |
| 248 | 248 | windows.ERROR.INVALID_PARAMETER => error.BadFd, |
| ... | ... | @@ -251,13 +251,7 @@ pub const File = struct { |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | assert(pos >= 0); |
| 254 | | if (@sizeOf(@typeOf(pos)) > @sizeOf(usize)) { |
| 255 | | if (pos > @maxValue(usize)) { |
| 256 | | return error.FilePosLargerThanPointerRange; |
| 257 | | } |
| 258 | | } |
| 259 | | |
| 260 | | return usize(pos); |
| 254 | return math.cast(usize, pos) catch error.FilePosLargerThanPointerRange; |
| 261 | 255 | }, |
| 262 | 256 | else => @compileError("unsupported OS"), |
| 263 | 257 | } |