hash.h: drop unsafe_ function variants

Now that all callers have been converted from: the_hash_algo->unsafe_init_fn(); to unsafe_hash_algo(the_hash_algo)->init_fn(); and similar, we can remove the scaffolding for the unsafe_ function variants and force callers to use the new unsafe_hash_algo() mechanic instead. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Taylor Blau committed Jan 23, 2025 at 12:34 UTC 04292c3796bb92664f6111326215d9c060ef71c8
2 files changed -30
hash.h
-15
@@ -282,21 +282,6 @@ struct git_hash_algo {
282 /* The hash finalization function for object IDs. */
283 git_hash_final_oid_fn final_oid_fn;
284
285 - /* The non-cryptographic hash initialization function. */
286 - git_hash_init_fn unsafe_init_fn;
287 -
288 - /* The non-cryptographic hash context cloning function. */
289 - git_hash_clone_fn unsafe_clone_fn;
290 -
291 - /* The non-cryptographic hash update function. */
292 - git_hash_update_fn unsafe_update_fn;
293 -
294 - /* The non-cryptographic hash finalization function. */
295 - git_hash_final_fn unsafe_final_fn;
296 -
297 - /* The non-cryptographic hash finalization function. */
298 - git_hash_final_oid_fn unsafe_final_oid_fn;
299 -
285 /* The OID of the empty tree. */
286 const struct object_id *empty_tree;
287
object-file.c
-15
@@ -230,11 +230,6 @@ const struct git_hash_algo hash_algos[GIT_HASH_NALGOS] = {
230 .update_fn = git_hash_unknown_update,
231 .final_fn = git_hash_unknown_final,
232 .final_oid_fn = git_hash_unknown_final_oid,
233 - .unsafe_init_fn = git_hash_unknown_init,
234 - .unsafe_clone_fn = git_hash_unknown_clone,
235 - .unsafe_update_fn = git_hash_unknown_update,
236 - .unsafe_final_fn = git_hash_unknown_final,
237 - .unsafe_final_oid_fn = git_hash_unknown_final_oid,
233 .empty_tree = NULL,
234 .empty_blob = NULL,
235 .null_oid = NULL,
@@ -250,11 +245,6 @@ const struct git_hash_algo hash_algos[GIT_HASH_NALGOS] = {
245 .update_fn = git_hash_sha1_update,
246 .final_fn = git_hash_sha1_final,
247 .final_oid_fn = git_hash_sha1_final_oid,
253 - .unsafe_init_fn = git_hash_sha1_init_unsafe,
254 - .unsafe_clone_fn = git_hash_sha1_clone_unsafe,
255 - .unsafe_update_fn = git_hash_sha1_update_unsafe,
256 - .unsafe_final_fn = git_hash_sha1_final_unsafe,
257 - .unsafe_final_oid_fn = git_hash_sha1_final_oid_unsafe,
248 .unsafe = &sha1_unsafe_algo,
249 .empty_tree = &empty_tree_oid,
250 .empty_blob = &empty_blob_oid,
@@ -271,11 +261,6 @@ const struct git_hash_algo hash_algos[GIT_HASH_NALGOS] = {
261 .update_fn = git_hash_sha256_update,
262 .final_fn = git_hash_sha256_final,
263 .final_oid_fn = git_hash_sha256_final_oid,
274 - .unsafe_init_fn = git_hash_sha256_init,
275 - .unsafe_clone_fn = git_hash_sha256_clone,
276 - .unsafe_update_fn = git_hash_sha256_update,
277 - .unsafe_final_fn = git_hash_sha256_final,
278 - .unsafe_final_oid_fn = git_hash_sha256_final_oid,
264 .empty_tree = &empty_tree_oid_sha256,
265 .empty_blob = &empty_blob_oid_sha256,
266 .null_oid = &null_oid_sha256,