object-file: mark unused parameters in hash_unknown functions

The 0'th entry of our hash_algos array fills out the virtual methods with a series of functions which simply BUG(). This is the right thing to do, since the point is to catch use of an invalid algo parameter, but we need to annotate them to appease -Wunused-parameters. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Oct 17, 2022 at 21:05 UTC 9eb6cdadd155f93ff25c674050f218d3f21a5e82
1 file changed +10 -5
object-file.c
+10 -5
@@ -140,27 +140,32 @@ static void git_hash_sha256_final_oid(struct object_id *oid, git_hash_ctx *ctx)
140 oid->algo = GIT_HASH_SHA256;
141 }
142
143 -static void git_hash_unknown_init(git_hash_ctx *ctx)
143 +static void git_hash_unknown_init(git_hash_ctx *ctx UNUSED)
144 {
145 BUG("trying to init unknown hash");
146 }
147
148 -static void git_hash_unknown_clone(git_hash_ctx *dst, const git_hash_ctx *src)
148 +static void git_hash_unknown_clone(git_hash_ctx *dst UNUSED,
149 + const git_hash_ctx *src UNUSED)
150 {
151 BUG("trying to clone unknown hash");
152 }
153
153 -static void git_hash_unknown_update(git_hash_ctx *ctx, const void *data, size_t len)
154 +static void git_hash_unknown_update(git_hash_ctx *ctx UNUSED,
155 + const void *data UNUSED,
156 + size_t len UNUSED)
157 {
158 BUG("trying to update unknown hash");
159 }
160
158 -static void git_hash_unknown_final(unsigned char *hash, git_hash_ctx *ctx)
161 +static void git_hash_unknown_final(unsigned char *hash UNUSED,
162 + git_hash_ctx *ctx UNUSED)
163 {
164 BUG("trying to finalize unknown hash");
165 }
166
163 -static void git_hash_unknown_final_oid(struct object_id *oid, git_hash_ctx *ctx)
167 +static void git_hash_unknown_final_oid(struct object_id *oid UNUSED,
168 + git_hash_ctx *ctx UNUSED)
169 {
170 BUG("trying to finalize unknown hash");
171 }