Re: [PATCH v7 00/16] Reftable coverity fixes
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Jan 24, 2022, 19:48 UTC
- Message-ID
- <220124.86ee4whpt5.gmgdl@evledraar.gmail.com>
- In-Reply-To
- <pull.1152.v7.git.git.1643051624.gitgitgadget@gmail.com>
On Mon, Jan 24 2022, Han-Wen Nienhuys via GitGitGadget wrote:
Show 7 quoted lines
> This series was targeted to 'master'. > > This addresses some complaints from Coverity that Peff reported. > > v7: > > * address avarab's comments.
Thanks. I just had time to skim it now but this overall LGTM. I noted a compilation error on xlc in another reply that I'm sorry I didn't test before, but provided a hopefully easy fix for.
Show 9 quoted lines
> @@ reftable/record.c: static int reftable_ref_record_equal_void(const void *a,
> +static void reftable_ref_record_print_void(const void *rec,
> + int hash_size)
> +{
> -+ reftable_ref_record_print_sz((struct reftable_ref_record *) rec, hash_size);
> ++ reftable_ref_record_print_sz(
> ++ (struct reftable_ref_record *) rec, hash_size);
> +}
> +Just a nit, and only noting this since you seemed to be adjusting your
clang-format settings (or so I recall), but I think the more usual
wrapping in the codebase is:
diff --git a/reftable/record.c b/reftable/record.c
index 8330b7a2589..ee42897460d 100644
--- a/reftable/record.c
+++ b/reftable/record.c
@@ -464,8 +464,8 @@ static int reftable_ref_record_equal_void(const void *a,
static void reftable_ref_record_print_void(const void *rec,
int hash_size)
{
- reftable_ref_record_print_sz(
- (struct reftable_ref_record *) rec, hash_size);
+ reftable_ref_record_print_sz((struct reftable_ref_record *)rec,
+ hash_size);
}
static struct reftable_record_vtable reftable_ref_record_vtable = {
I.e. to "keep going" with the initial line until we hit 79 characters, and then wrap it. Then for casts "(x *)y" rather than "(x *) y".