Let wuffs_aux's MemoryInput take a char* ptr

This commit is contained in:
Nigel Tao committed 2020-08-17 10:00:19 +10:00
1 parent 2742a4f4be
commit ca1113620b
4 files changed
+16 -2

No files matched your search

+7
View File
@@ -8455,6 +8455,7 @@ class FileInput : public Input {
// It does not take responsibility for freeing the memory when done.
class MemoryInput : public Input {
public:
MemoryInput(const char* ptr, size_t len);
MemoryInput(const uint8_t* ptr, size_t len);
virtual IOBuffer* BringsItsOwnIOBuffer();
@@ -28999,6 +29000,12 @@ FileInput::CopyIn(IOBuffer* dst) {
// --------
MemoryInput::MemoryInput(const char* ptr, size_t len)
: m_io(wuffs_base__ptr_u8__reader(
static_cast<uint8_t*>(static_cast<void*>(const_cast<char*>(ptr))),
len,
true)) {}
MemoryInput::MemoryInput(const uint8_t* ptr, size_t len)
: m_io(wuffs_base__ptr_u8__reader(const_cast<uint8_t*>(ptr), len, true)) {}