]> git.ipfire.org Git - thirdparty/git.git/commitdiff
chunk-format: drop pair_chunk_unsafe()
authorJeff King <peff@peff.net>
Mon, 9 Oct 2023 21:06:01 +0000 (17:06 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Oct 2023 22:55:02 +0000 (15:55 -0700)
There are no callers left, and we don't want anybody to add new ones (they
should use the not-unsafe version instead). So let's drop the function.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
chunk-format.c
chunk-format.h

index 09ef86afa699b4b55cb82cb5f564635d7cc1daaf..cdc7f39b7039b94a14a42ec74b0e27917c43fe4f 100644 (file)
@@ -184,14 +184,6 @@ int pair_chunk(struct chunkfile *cf,
        return read_chunk(cf, chunk_id, pair_chunk_fn, &pcd);
 }
 
-int pair_chunk_unsafe(struct chunkfile *cf,
-                     uint32_t chunk_id,
-                     const unsigned char **p)
-{
-       size_t dummy;
-       return pair_chunk(cf, chunk_id, p, &dummy);
-}
-
 int read_chunk(struct chunkfile *cf,
               uint32_t chunk_id,
               chunk_read_fn fn,
index d608b8135ca76ecc6e3b1a3f0e44dba19b35e3e3..14b76180ef768f6b5c38aa1cda128ab87d2327ae 100644 (file)
@@ -54,19 +54,6 @@ int pair_chunk(struct chunkfile *cf,
               const unsigned char **p,
               size_t *size);
 
-/*
- * Unsafe version of pair_chunk; it does not return the size,
- * meaning that the caller cannot possibly be careful about
- * reading out of bounds from the mapped memory.
- *
- * No new callers should use this function, and old callers should
- * be audited and migrated over to using the regular pair_chunk()
- * function.
- */
-int pair_chunk_unsafe(struct chunkfile *cf,
-                     uint32_t chunk_id,
-                     const unsigned char **p);
-
 typedef int (*chunk_read_fn)(const unsigned char *chunk_start,
                             size_t chunk_size, void *data);
 /*