util/blob: Add overwrite function for uint8

Overwrite function for this type  was missing and I needed it for my project.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Mark Menzynski <mmenzyns@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3903>
This commit is contained in:
Mark Menzynski
2019-12-10 11:28:11 +01:00
committed by mmenzyns
parent 1b49534df2
commit 24e82e4533
2 changed files with 24 additions and 0 deletions

View File

@@ -214,6 +214,15 @@ BLOB_WRITE_TYPE(blob_write_intptr, intptr_t)
#define ASSERT_ALIGNED(_offset, _align) \
assert(ALIGN((_offset), (_align)) == (_offset))
bool
blob_overwrite_uint8 (struct blob *blob,
size_t offset,
uint8_t value)
{
ASSERT_ALIGNED(offset, sizeof(value));
return blob_overwrite_bytes(blob, offset, &value, sizeof(value));
}
bool
blob_overwrite_uint32 (struct blob *blob,
size_t offset,