Skip to content

Commit

Permalink
pack-objects: use unsigned int for counter and offset values
Browse files Browse the repository at this point in the history
This is done in some of the new pack layout code introduced in commit
1b4bb16. 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>
  • Loading branch information
Dan McGee authored and Junio C Hamano committed Oct 18, 2011
1 parent be12681 commit 92bef1a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions builtin/pack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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));

Expand All @@ -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 */
Expand Down

0 comments on commit 92bef1a

Please sign in to comment.