1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:47:45 +00:00

Do a pass of compiler warning fixes.

This is really making me question not using 64-bit integers more.
This commit is contained in:
Andreas Kling 2019-04-23 13:00:53 +02:00
parent 243e1d8462
commit 58240fdb33
21 changed files with 89 additions and 84 deletions

View file

@ -14,6 +14,7 @@ public:
static Retained<ByteBufferImpl> create_zeroed(int);
static Retained<ByteBufferImpl> copy(const void*, int);
static Retained<ByteBufferImpl> wrap(void*, int);
static Retained<ByteBufferImpl> wrap(const void*, int);
static Retained<ByteBufferImpl> adopt(void*, int);
~ByteBufferImpl() { clear(); }
@ -89,6 +90,7 @@ public:
static ByteBuffer create_uninitialized(ssize_t size) { return ByteBuffer(ByteBufferImpl::create_uninitialized(size)); }
static ByteBuffer create_zeroed(ssize_t size) { return ByteBuffer(ByteBufferImpl::create_zeroed(size)); }
static ByteBuffer copy(const void* data, ssize_t size) { return ByteBuffer(ByteBufferImpl::copy(data, size)); }
static ByteBuffer wrap(const void* data, ssize_t size) { return ByteBuffer(ByteBufferImpl::wrap(data, size)); }
static ByteBuffer wrap(void* data, ssize_t size) { return ByteBuffer(ByteBufferImpl::wrap(data, size)); }
static ByteBuffer adopt(void* data, ssize_t size) { return ByteBuffer(ByteBufferImpl::adopt(data, size)); }
@ -219,6 +221,11 @@ inline Retained<ByteBufferImpl> ByteBufferImpl::wrap(void* data, int size)
return ::adopt(*new ByteBufferImpl(data, size, Wrap));
}
inline Retained<ByteBufferImpl> ByteBufferImpl::wrap(const void* data, int size)
{
return ::adopt(*new ByteBufferImpl(const_cast<void*>(data), size, Wrap));
}
inline Retained<ByteBufferImpl> ByteBufferImpl::adopt(void* data, int size)
{
return ::adopt(*new ByteBufferImpl(data, size, Adopt));