diff-lib, read-tree, unpack-trees: mark cache_entry array paramters const
commit5828e8352c07753a1f751322800524bf9dff8679
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>
Sun, 2 Jun 2013 15:46:56 +0000 (2 17:46 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 2 Jun 2013 22:31:14 +0000 (2 15:31 -0700)
tree267b32e002843b0f77172d62c9057c92ba1b5b47
parenteb9ae4b505bfacc4974a9ef4f4e6996c78d04a4c
diff-lib, read-tree, unpack-trees: mark cache_entry array paramters const

Change the type merge_fn_t to accept the array of cache_entry pointers
as const pointers to const pointers.  This documents the fact that the
merge functions don't modify the cache_entry contents or replace any of
the pointers in the array.

Only a single cast is necessary in unpack_nondirectories because adding
two const modifiers at once is not allowed in C.  The cast is safe in
that it doesn't mask any modfication; call_unpack_fn only needs the
array for reading.

Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/read-tree.c
diff-lib.c
unpack-trees.c
unpack-trees.h