input/async: use std::byte instead of uint8_t
This commit is contained in:
parent
73dc8ff6bd
commit
ce13d82657
@ -181,7 +181,7 @@ AsyncInputStream::Read(std::unique_lock<Mutex> &lock,
|
|||||||
CondInputStreamHandler cond_handler;
|
CondInputStreamHandler cond_handler;
|
||||||
|
|
||||||
/* wait for data */
|
/* wait for data */
|
||||||
CircularBuffer<uint8_t>::Range r;
|
CircularBuffer<std::byte>::Range r;
|
||||||
while (true) {
|
while (true) {
|
||||||
Check();
|
Check();
|
||||||
|
|
||||||
@ -232,7 +232,7 @@ AsyncInputStream::AppendToBuffer(const void *data, size_t append_size) noexcept
|
|||||||
assert(!w.empty());
|
assert(!w.empty());
|
||||||
assert(w.size() >= remaining);
|
assert(w.size() >= remaining);
|
||||||
|
|
||||||
memcpy(w.data(), (const uint8_t *)data + nbytes, remaining);
|
memcpy(w.data(), (const std::byte *)data + nbytes, remaining);
|
||||||
buffer.Append(remaining);
|
buffer.Append(remaining);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "util/HugeAllocator.hxx"
|
#include "util/HugeAllocator.hxx"
|
||||||
#include "util/CircularBuffer.hxx"
|
#include "util/CircularBuffer.hxx"
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -41,9 +42,9 @@ class AsyncInputStream : public InputStream {
|
|||||||
InjectEvent deferred_resume;
|
InjectEvent deferred_resume;
|
||||||
InjectEvent deferred_seek;
|
InjectEvent deferred_seek;
|
||||||
|
|
||||||
HugeArray<uint8_t> allocation;
|
HugeArray<std::byte> allocation;
|
||||||
|
|
||||||
CircularBuffer<uint8_t> buffer;
|
CircularBuffer<std::byte> buffer;
|
||||||
const size_t resume_at;
|
const size_t resume_at;
|
||||||
|
|
||||||
bool open = true;
|
bool open = true;
|
||||||
@ -128,7 +129,7 @@ protected:
|
|||||||
return buffer.GetSpace();
|
return buffer.GetSpace();
|
||||||
}
|
}
|
||||||
|
|
||||||
CircularBuffer<uint8_t>::Range PrepareWriteBuffer() noexcept {
|
auto PrepareWriteBuffer() noexcept {
|
||||||
return buffer.Write();
|
return buffer.Write();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user