diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2018-04-11 14:09:48 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2018-04-11 14:09:48 +0300 |
commit | 487b9a266f9a2d5e81902fde842c41cbd53f1ce4 (patch) | |
tree | aaf7fed1f6d2b30b0ee7c25cc81bf608e336b7f0 /include/afio/v2.0/detail/impl/posix/file_handle.ipp | |
parent | ed04b40b799d1cb2b4c1787b9a1089050e3c89ae (diff) |
Convert AFIO over to use std::byte for buffers instead of char.
Diffstat (limited to 'include/afio/v2.0/detail/impl/posix/file_handle.ipp')
-rw-r--r-- | include/afio/v2.0/detail/impl/posix/file_handle.ipp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/afio/v2.0/detail/impl/posix/file_handle.ipp b/include/afio/v2.0/detail/impl/posix/file_handle.ipp index 13e0e779..3b3afa98 100644 --- a/include/afio/v2.0/detail/impl/posix/file_handle.ipp +++ b/include/afio/v2.0/detail/impl/posix/file_handle.ipp @@ -462,7 +462,7 @@ result<file_handle::extent_type> file_handle::zero(file_handle::extent_type offs // Fall back onto a write of zeros if(bytes < utils::page_size()) { - auto *buffer = static_cast<char *>(alloca(bytes)); + auto *buffer = static_cast<byte *>(alloca(bytes)); memset(buffer, 0, bytes); OUTCOME_TRY(written, write(offset, {{buffer, bytes}}, d)); return written[0].len; @@ -471,8 +471,8 @@ result<file_handle::extent_type> file_handle::zero(file_handle::extent_type offs { extent_type ret = 0; auto blocksize = utils::file_buffer_default_size(); - char *buffer = utils::page_allocator<char>().allocate(blocksize); - auto unbufferh = undoer([buffer, blocksize] { utils::page_allocator<char>().deallocate(buffer, blocksize); }); + byte *buffer = utils::page_allocator<byte>().allocate(blocksize); + auto unbufferh = undoer([buffer, blocksize] { utils::page_allocator<byte>().deallocate(buffer, blocksize); }); (void) unbufferh; while(bytes > 0) { |