Skip to content

Commit

Permalink
Fix x86 build error and warnings on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
ned14 committed Dec 8, 2021
1 parent 48ac666 commit fba45d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions include/llfio/v2.0/detail/impl/windows/file_handle.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -718,17 +718,17 @@ result<file_handle::extent_pair> file_handle::clone_extents_to(file_handle::exte
buffer = utils::page_allocator<byte>().allocate(blocksize);
}
deadline nd;
buffer_type b(buffer, utils::round_up_to_page_size(thisblock, 4096) /* to allow aligned i/o files */);
buffer_type b(buffer, utils::round_up_to_page_size((size_t) thisblock, 4096) /* to allow aligned i/o files */);
LLFIO_DEADLINE_TO_PARTIAL_DEADLINE(nd, d);
OUTCOME_TRY(auto &&readed, read({{&b, 1}, item.src.offset + thisoffset}, nd));
buffer_dirty = true;
if(readed.front().size() < thisblock)
{
return errc::resource_unavailable_try_again; // something is wrong
}
readed.front() = {readed.front().data(), thisblock};
readed.front() = {readed.front().data(), (size_t) thisblock};
LLFIO_DEADLINE_TO_PARTIAL_DEADLINE(nd, d);
const_buffer_type cb(readed.front().data(), thisblock);
const_buffer_type cb(readed.front().data(), (size_t) thisblock);
if(item.destination_extents_are_new)
{
// If we don't need to reset the bytes in the destination, try to elide
Expand Down
8 changes: 4 additions & 4 deletions include/llfio/v2.0/detail/impl/windows/map_handle.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ result<map_handle> map_handle::map(section_handle &section, size_type bytes, ext
}
if(bytes == 0u)
{
bytes = length;
bytes = (size_type) length;
}
else if(length > bytes)
{
Expand All @@ -718,7 +718,7 @@ result<map_handle> map_handle::map(section_handle &section, size_type bytes, ext
ret.value()._addr = static_cast<byte *>(addr);
ret.value()._offset = offset;
ret.value()._reservation = _bytes - (offset & 65535);
ret.value()._length = length;
ret.value()._length = (size_type) length;
ret.value()._pagesize = pagesize;
// Make my handle borrow the native handle of my backing storage
ret.value()._v.h = section.backing_native_handle().h;
Expand Down Expand Up @@ -800,7 +800,7 @@ result<map_handle::size_type> map_handle::truncate(size_type newsize, bool /* un
// If newsize isn't exactly a previous extension, this will fail, same as for the VirtualAlloc case
OUTCOME_TRY(win32_release_file_allocations(_addr + newsize, _reservation - newsize));
_reservation = newsize;
_length = length;
_length = (size_type) length;
return _reservation;
}
// Try to map an additional part of the section directly after this map
Expand All @@ -818,7 +818,7 @@ result<map_handle::size_type> map_handle::truncate(size_type newsize, bool /* un
return ntkernel_error(ntstat);
}
_reservation += _bytes;
_length = length;
_length = (size_type) length;
return _reservation;
}

Expand Down

0 comments on commit fba45d6

Please sign in to comment.