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