diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-10-17 06:53:56 +0200 |
|---|---|---|
| committer | Taylor Blau <me@ttaylorr.com> | 2024-10-17 16:59:56 -0400 |
| commit | be4c070a3c9e7c9d6836c724929ff8a365361e1a (patch) | |
| tree | 03cec9016c899456a020c06e98239963a2958238 /reftable/blocksource.c | |
| parent | 81eddda540eae43ef481b629d7f4d8023ea40c57 (diff) | |
| download | git-be4c070a3c9e7c9d6836c724929ff8a365361e1a.tar.xz | |
reftable: convert from `strbuf` to `reftable_buf`
Convert the reftable library to use the `reftable_buf` interface instead
of the `strbuf` interface. This is mostly a mechanical change via sed(1)
with some manual fixes where functions for `strbuf` and `reftable_buf`
differ. The converted code does not yet handle allocation failures. This
will be handled in subsequent commits.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 'reftable/blocksource.c')
| -rw-r--r-- | reftable/blocksource.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/reftable/blocksource.c b/reftable/blocksource.c index a2a6a196d5..d6242d6790 100644 --- a/reftable/blocksource.c +++ b/reftable/blocksource.c @@ -27,7 +27,7 @@ static void strbuf_close(void *b UNUSED) static int strbuf_read_block(void *v, struct reftable_block *dest, uint64_t off, uint32_t size) { - struct strbuf *b = v; + struct reftable_buf *b = v; assert(off + size <= b->len); REFTABLE_CALLOC_ARRAY(dest->data, size); if (!dest->data) @@ -39,7 +39,7 @@ static int strbuf_read_block(void *v, struct reftable_block *dest, uint64_t off, static uint64_t strbuf_size(void *b) { - return ((struct strbuf *)b)->len; + return ((struct reftable_buf *)b)->len; } static struct reftable_block_source_vtable strbuf_vtable = { @@ -50,7 +50,7 @@ static struct reftable_block_source_vtable strbuf_vtable = { }; void block_source_from_strbuf(struct reftable_block_source *bs, - struct strbuf *buf) + struct reftable_buf *buf) { assert(!bs->ops); bs->ops = &strbuf_vtable; |
