From 3ddef475d008b8a705a53e6bb1405bb773ffdc50 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Tue, 6 Feb 2024 07:35:59 +0100 Subject: reftable/record: improve semantics when initializing records According to our usual coding style, the `reftable_new_record()` function would indicate that it is allocating a new record. This is not the case though as the function merely initializes records without allocating any memory. Replace `reftable_new_record()` with a new `reftable_record_init()` function that takes a record pointer as input and initializes it accordingly. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- reftable/record_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'reftable/record_test.c') diff --git a/reftable/record_test.c b/reftable/record_test.c index 999366ad46..a86cff5526 100644 --- a/reftable/record_test.c +++ b/reftable/record_test.c @@ -16,11 +16,11 @@ static void test_copy(struct reftable_record *rec) { - struct reftable_record copy = { 0 }; + struct reftable_record copy; uint8_t typ; typ = reftable_record_type(rec); - copy = reftable_new_record(typ); + reftable_record_init(©, typ); reftable_record_copy_from(©, rec, GIT_SHA1_RAWSZ); /* do it twice to catch memory leaks */ reftable_record_copy_from(©, rec, GIT_SHA1_RAWSZ); -- cgit v1.3