Git fork

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>

authored by

Jeff King and committed by
Junio C Hamano
ca06f0fe 12192a9d

-21
-8
chunk-format.c
··· 184 184 return read_chunk(cf, chunk_id, pair_chunk_fn, &pcd); 185 185 } 186 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 - 195 187 int read_chunk(struct chunkfile *cf, 196 188 uint32_t chunk_id, 197 189 chunk_read_fn fn,
-13
chunk-format.h
··· 54 54 const unsigned char **p, 55 55 size_t *size); 56 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 - 70 57 typedef int (*chunk_read_fn)(const unsigned char *chunk_start, 71 58 size_t chunk_size, void *data); 72 59 /*