Skip to content

Commit 9eb6cda

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 808e919 commit 9eb6cda

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

object-file.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,27 +140,32 @@ static void git_hash_sha256_final_oid(struct object_id *oid, git_hash_ctx *ctx)
140140
oid->algo = GIT_HASH_SHA256;
141141
}
142142

143-
static void git_hash_unknown_init(git_hash_ctx *ctx)
143+
static void git_hash_unknown_init(git_hash_ctx *ctx UNUSED)
144144
{
145145
BUG("trying to init unknown hash");
146146
}
147147

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)
149150
{
150151
BUG("trying to clone unknown hash");
151152
}
152153

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)
154157
{
155158
BUG("trying to update unknown hash");
156159
}
157160

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)
159163
{
160164
BUG("trying to finalize unknown hash");
161165
}
162166

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)
164169
{
165170
BUG("trying to finalize unknown hash");
166171
}

0 commit comments

Comments
 (0)