Commit 08e76815 authored by Max Kellermann's avatar Max Kellermann

io/FileDescriptor: use std::byte

parent 33ac3eb5
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "system/Error.hxx" #include "system/Error.hxx"
#include <cassert> #include <cassert>
#include <cstdint>
#include <stdexcept> #include <stdexcept>
#include <sys/stat.h> #include <sys/stat.h>
...@@ -292,7 +291,7 @@ FileDescriptor::GetSize() const noexcept ...@@ -292,7 +291,7 @@ FileDescriptor::GetSize() const noexcept
void void
FileDescriptor::FullRead(void *_buffer, std::size_t length) FileDescriptor::FullRead(void *_buffer, std::size_t length)
{ {
auto buffer = (uint8_t *)_buffer; auto buffer = (std::byte *)_buffer;
while (length > 0) { while (length > 0) {
ssize_t nbytes = Read(buffer, length); ssize_t nbytes = Read(buffer, length);
...@@ -310,7 +309,7 @@ FileDescriptor::FullRead(void *_buffer, std::size_t length) ...@@ -310,7 +309,7 @@ FileDescriptor::FullRead(void *_buffer, std::size_t length)
void void
FileDescriptor::FullWrite(const void *_buffer, std::size_t length) FileDescriptor::FullWrite(const void *_buffer, std::size_t length)
{ {
auto buffer = (const uint8_t *)_buffer; auto buffer = (const std::byte *)_buffer;
while (length > 0) { while (length > 0) {
ssize_t nbytes = Write(buffer, length); ssize_t nbytes = Write(buffer, length);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment