Skip to content

Commit

Permalink
commit.c: rename variable named 'n' which masks previous declaration
Browse files Browse the repository at this point in the history
The variable named 'n' was initially declared to be of type int.  The name
'n' was reused inside inner blocks as a different type.  Rename the uses
within inner blocks to avoid confusion and give them a slightly more
descriptive name.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Brandon Casey authored and Junio C Hamano committed Aug 27, 2009
1 parent 1630726 commit f203d69
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,13 +564,13 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
while (interesting(list)) {
struct commit *commit;
struct commit_list *parents;
struct commit_list *n;
struct commit_list *next;
int flags;

commit = list->item;
n = list->next;
next = list->next;
free(list);
list = n;
list = next;

flags = commit->object.flags & (PARENT1 | PARENT2 | STALE);
if (flags == (PARENT1 | PARENT2)) {
Expand Down Expand Up @@ -598,11 +598,11 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
free_commit_list(list);
list = result; result = NULL;
while (list) {
struct commit_list *n = list->next;
struct commit_list *next = list->next;
if (!(list->item->object.flags & STALE))
insert_by_date(list->item, &result);
free(list);
list = n;
list = next;
}
return result;
}
Expand Down

0 comments on commit f203d69

Please sign in to comment.