summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorDan McGee <dpmcgee@gmail.com>2011-10-18 05:21:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-10-18 07:16:32 (GMT)
commit92bef1a14a6755ce1407a0e180cdc9e14a5c56b9 (patch)
treec2ede8ae927001e87bf1e74592126cf521e5b779 /builtin
parentbe12681896fab9455eb65ea124df423b462e0072 (diff)
downloadgit-92bef1a14a6755ce1407a0e180cdc9e14a5c56b9.zip
git-92bef1a14a6755ce1407a0e180cdc9e14a5c56b9.tar.gz
git-92bef1a14a6755ce1407a0e180cdc9e14a5c56b9.tar.bz2
pack-objects: use unsigned int for counter and offset values
This is done in some of the new pack layout code introduced in commit 1b4bb16b9ec331c. This more closely matches the nr_objects global that is unsigned that these variables are based off of and bounded by. Signed-off-by: Dan McGee <dpmcgee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/pack-objects.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 70b757e..865a7d4 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -455,7 +455,7 @@ static int mark_tagged(const char *path, const unsigned char *sha1, int flag,
}
static inline void add_to_write_order(struct object_entry **wo,
- int *endp,
+ unsigned int *endp,
struct object_entry *e)
{
if (e->filled)
@@ -465,7 +465,7 @@ static inline void add_to_write_order(struct object_entry **wo,
}
static void add_descendants_to_write_order(struct object_entry **wo,
- int *endp,
+ unsigned int *endp,
struct object_entry *e)
{
struct object_entry *child;
@@ -477,7 +477,7 @@ static void add_descendants_to_write_order(struct object_entry **wo,
}
static void add_family_to_write_order(struct object_entry **wo,
- int *endp,
+ unsigned int *endp,
struct object_entry *e)
{
struct object_entry *root;
@@ -490,7 +490,7 @@ static void add_family_to_write_order(struct object_entry **wo,
static struct object_entry **compute_write_order(void)
{
- int i, wo_end;
+ unsigned int i, wo_end;
struct object_entry **wo = xmalloc(nr_objects * sizeof(*wo));
@@ -506,8 +506,8 @@ static struct object_entry **compute_write_order(void)
* Make sure delta_sibling is sorted in the original
* recency order.
*/
- for (i = nr_objects - 1; 0 <= i; i--) {
- struct object_entry *e = &objects[i];
+ for (i = nr_objects; i > 0;) {
+ struct object_entry *e = &objects[--i];
if (!e->delta)
continue;
/* Mark me as the first child */