chunk-format: drop pair_chunk_unsafe()
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>
Jeff King committed
Oct 9, 2023 at 17:06 UTC
ca06f0fe5d8f3e93da1486b880f0e94f1c11238a
2 files changed
-21
chunk-format.c
-8
@@ -184,14 +184,6 @@ int pair_chunk(struct chunkfile *cf,
184
return read_chunk(cf, chunk_id, pair_chunk_fn, &pcd);
185
}
186
187
-int pair_chunk_unsafe(struct chunkfile *cf,
188
- uint32_t chunk_id,
189
- const unsigned char **p)
190
-{
191
- size_t dummy;
192
- return pair_chunk(cf, chunk_id, p, &dummy);
193
-}
194
-
187
int read_chunk(struct chunkfile *cf,
188
uint32_t chunk_id,
189
chunk_read_fn fn,
chunk-format.h
-13
@@ -54,19 +54,6 @@ int pair_chunk(struct chunkfile *cf,
54
const unsigned char **p,
55
size_t *size);
56
57
-/*
58
- * Unsafe version of pair_chunk; it does not return the size,
59
- * meaning that the caller cannot possibly be careful about
60
- * reading out of bounds from the mapped memory.
61
- *
62
- * No new callers should use this function, and old callers should
63
- * be audited and migrated over to using the regular pair_chunk()
64
- * function.
65
- */
66
-int pair_chunk_unsafe(struct chunkfile *cf,
67
- uint32_t chunk_id,
68
- const unsigned char **p);
69
-
57
typedef int (*chunk_read_fn)(const unsigned char *chunk_start,
58
size_t chunk_size, void *data);
59
/*