AK: Make ByteBuffer's copy() and wrap() take void*.

This way we don't have to cast whatever we're passing to copy()/wrap().
This commit is contained in:
Andreas Kling 2019-03-17 00:36:41 +01:00
commit 1c6dfc3282
Notes: sideshowbarker 2024-07-19 15:01:29 +09:00
4 changed files with 11 additions and 11 deletions

View file

@ -163,9 +163,9 @@ bool Font::write_to_file(const String& path)
auto buffer = ByteBuffer::create_uninitialized(sizeof(FontFileHeader) + (256 * bytes_per_glyph) + 256);
BufferStream stream(buffer);
stream << ByteBuffer::wrap((byte*)&header, sizeof(FontFileHeader));
stream << ByteBuffer::wrap((byte*)m_rows, (256 * bytes_per_glyph));
stream << ByteBuffer::wrap((byte*)m_glyph_widths, 256);
stream << ByteBuffer::wrap(&header, sizeof(FontFileHeader));
stream << ByteBuffer::wrap(m_rows, (256 * bytes_per_glyph));
stream << ByteBuffer::wrap(m_glyph_widths, 256);
ASSERT(stream.at_end());
ssize_t nwritten = write(fd, buffer.pointer(), buffer.size());