diff options
author | Brian Gianforcaro <b.gianfo@gmail.com> | 2009-09-01 01:35:10 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-08-31 23:26:28 -0700 |
commit | eeefa7c90e1b754a2b01d73fd93aaf90afdc4914 (patch) | |
tree | fa561a4acef6f4c1cb8bd0b75a194e3644b99d3e /pack-redundant.c | |
parent | 554555ac7da0b9b78bd97cff05daa60498eb1bba (diff) | |
download | git-eeefa7c90e1b754a2b01d73fd93aaf90afdc4914.tar.gz |
Style fixes, add a space after if/for/while.
The majority of code in core git appears to use a single
space after if/for/while. This is an attempt to bring more
code to this standard. These are entirely cosmetic changes.
Signed-off-by: Brian Gianforcaro <b.gianfo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-redundant.c')
-rw-r--r-- | pack-redundant.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/pack-redundant.c b/pack-redundant.c index 48a12bc135..69a7ab2e27 100644 --- a/pack-redundant.c +++ b/pack-redundant.c @@ -55,16 +55,15 @@ static inline struct llist_item *llist_item_get(void) } else { int i = 1; new = xmalloc(sizeof(struct llist_item) * BLKSIZE); - for(;i < BLKSIZE; i++) { + for (; i < BLKSIZE; i++) llist_item_put(&new[i]); - } } return new; } static void llist_free(struct llist *list) { - while((list->back = list->front)) { + while ((list->back = list->front)) { list->front = list->front->next; llist_item_put(list->back); } @@ -146,7 +145,7 @@ static inline struct llist_item *llist_insert_sorted_unique(struct llist *list, if (cmp > 0) { /* we insert before this entry */ return llist_insert(list, prev, sha1); } - if(!cmp) { /* already exists */ + if (!cmp) { /* already exists */ return l; } prev = l; @@ -168,7 +167,7 @@ redo_from_start: int cmp = hashcmp(l->sha1, sha1); if (cmp > 0) /* not in list, since sorted */ return prev; - if(!cmp) { /* found */ + if (!cmp) { /* found */ if (prev == NULL) { if (hint != NULL && hint != list->front) { /* we don't know the previous element */ @@ -218,7 +217,7 @@ static inline struct pack_list * pack_list_insert(struct pack_list **pl, static inline size_t pack_list_size(struct pack_list *pl) { size_t ret = 0; - while(pl) { + while (pl) { ret++; pl = pl->next; } @@ -396,7 +395,7 @@ static size_t get_pack_redundancy(struct pack_list *pl) return 0; while ((subset = pl->next)) { - while(subset) { + while (subset) { ret += sizeof_union(pl->pack, subset->pack); subset = subset->next; } @@ -427,7 +426,7 @@ static void minimize(struct pack_list **min) pl = local_packs; while (pl) { - if(pl->unique_objects->size) + if (pl->unique_objects->size) pack_list_insert(&unique, pl); else pack_list_insert(&non_unique, pl); @@ -479,7 +478,7 @@ static void minimize(struct pack_list **min) *min = min_perm; /* add the unique packs to the list */ pl = unique; - while(pl) { + while (pl) { pack_list_insert(min, pl); pl = pl->next; } @@ -516,7 +515,7 @@ static void cmp_local_packs(void) struct pack_list *subset, *pl = local_packs; while ((subset = pl)) { - while((subset = subset->next)) + while ((subset = subset->next)) cmp_two_packs(pl, subset); pl = pl->next; } @@ -608,23 +607,23 @@ int main(int argc, char **argv) for (i = 1; i < argc; i++) { const char *arg = argv[i]; - if(!strcmp(arg, "--")) { + if (!strcmp(arg, "--")) { i++; break; } - if(!strcmp(arg, "--all")) { + if (!strcmp(arg, "--all")) { load_all_packs = 1; continue; } - if(!strcmp(arg, "--verbose")) { + if (!strcmp(arg, "--verbose")) { verbose = 1; continue; } - if(!strcmp(arg, "--alt-odb")) { + if (!strcmp(arg, "--alt-odb")) { alt_odb = 1; continue; } - if(*arg == '-') + if (*arg == '-') usage(pack_redundant_usage); else break; |