Skip to content

Commit ca06f0f

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 12192a9 commit ca06f0f

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

chunk-format.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,6 @@ int pair_chunk(struct chunkfile *cf,
184184
return read_chunk(cf, chunk_id, pair_chunk_fn, &pcd);
185185
}
186186

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-
195187
int read_chunk(struct chunkfile *cf,
196188
uint32_t chunk_id,
197189
chunk_read_fn fn,

chunk-format.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,6 @@ int pair_chunk(struct chunkfile *cf,
5454
const unsigned char **p,
5555
size_t *size);
5656

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-
7057
typedef int (*chunk_read_fn)(const unsigned char *chunk_start,
7158
size_t chunk_size, void *data);
7259
/*

0 commit comments

Comments
 (0)