Skip to content

Commit b167967

Browse files
Fix x86 truncation warning in offset_range.pass.cpp.
offset_range.pass.cpp(49): warning C4244: 'initializing': conversion from 'const _Ty' to 'size_t', possible loss of data std::min() is returning std::streamoff, which was being unnecessarily narrowed to std::size_t.
1 parent d3a4a9b commit b167967

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libcxx/test/std/input.output/file.streams/fstreams/ifstream.members/offset_range.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void test_tellg(std::streamoff total_size) {
4646
ofs.open(p, std::ios::out | std::ios::binary);
4747
assert(ofs.is_open());
4848
for (std::streamoff size = 0; size < total_size;) {
49-
std::size_t n = std::min(static_cast<std::streamoff>(data.size()), total_size - size);
49+
std::streamoff n = std::min(static_cast<std::streamoff>(data.size()), total_size - size);
5050
ofs.write(data.data(), n);
5151
size += n;
5252
}

0 commit comments

Comments
 (0)