From 60614838a44591c1449f939236f396bb7164b5ef Mon Sep 17 00:00:00 2001 From: Toon Claes Date: Tue, 3 Feb 2026 11:29:03 +0100 Subject: cocci: extend MEMZERO_ARRAY() rules Recently the MEMZERO_ARRAY() macro was introduced. In that commit also coccinelle rules were added to capture cases that can be converted to use that macro. Later a few more cases were manually converted to use the macro, but coccinelle didn't capture those. Extend the rules to capture those as well. In various cases the code could be further beautified by removing parentheses which are no longer needed. Modify the coccinelle rules to optimize those as well and fix them. During conversion indentation also used spaces where tabs should be used, fix that in one go. Signed-off-by: Toon Claes Signed-off-by: Junio C Hamano --- diffcore-delta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'diffcore-delta.c') diff --git a/diffcore-delta.c b/diffcore-delta.c index 2de9e9ccff..2b7db39983 100644 --- a/diffcore-delta.c +++ b/diffcore-delta.c @@ -135,7 +135,7 @@ static struct spanhash_top *hash_chars(struct repository *r, st_mult(sizeof(struct spanhash), (size_t)1 << i))); hash->alloc_log2 = i; hash->free = INITIAL_FREE(i); - MEMZERO_ARRAY(hash->data, ((size_t)1 << i)); + MEMZERO_ARRAY(hash->data, (size_t)1 << i); n = 0; accum1 = accum2 = 0; -- cgit v1.3