diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2007-03-06 20:44:19 -0500 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-03-07 11:02:33 -0800 |
commit | 326bf396778bc9ab8f9e253bb514e7f41ef1502b (patch) | |
tree | 41a09c2642dbd03db6b6b6cf3394e048b7661800 /cache.h | |
parent | 3a55602eeca4ac8670e8698a7187e18b95683344 (diff) | |
download | git-326bf396778bc9ab8f9e253bb514e7f41ef1502b.tar.gz |
Use uint32_t for all packed object counts.
As we permit up to 2^32-1 objects in a single packfile we cannot
use a signed int to represent the object offset within a packfile,
after 2^31-1 objects we will start seeing negative indexes and
error out or compute bad addresses within the mmap'd index.
This is a minor cleanup that does not introduce any significant
logic changes. It is roach free.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -425,8 +425,8 @@ extern void pack_report(void); extern unsigned char* use_pack(struct packed_git *, struct pack_window **, unsigned long, unsigned int *); extern void unuse_pack(struct pack_window **); extern struct packed_git *add_packed_git(char *, int, int); -extern int num_packed_objects(const struct packed_git *p); -extern int nth_packed_object_sha1(const struct packed_git *, int, unsigned char*); +extern uint32_t num_packed_objects(const struct packed_git *p); +extern int nth_packed_object_sha1(const struct packed_git *, uint32_t, unsigned char*); extern unsigned long find_pack_entry_one(const unsigned char *, struct packed_git *); extern void *unpack_entry(struct packed_git *, unsigned long, enum object_type *, unsigned long *); extern unsigned long unpack_object_header_gently(const unsigned char *buf, unsigned long len, enum object_type *type, unsigned long *sizep); |