Merge branch 'jc/same-encoding'
[gitweb.git] / builtin / pack-redundant.c
index 41e1615a28d772d1677c172ff2f570f31de4026f..649c3aaa93ccdaae21b7884209bd4f28fb558f3e 100644 (file)
@@ -6,8 +6,7 @@
 *
 */
 
-#include "cache.h"
-#include "exec_cmd.h"
+#include "builtin.h"
 
 #define BLKSIZE 512
 
@@ -302,14 +301,14 @@ static void pll_free(struct pll *l)
  */
 static struct pll * get_permutations(struct pack_list *list, int n)
 {
-       struct pll *subset, *ret = NULL, *new_pll = NULL, *pll;
+       struct pll *subset, *ret = NULL, *new_pll = NULL;
 
        if (list == NULL || pack_list_size(list) < n || n == 0)
                return NULL;
 
        if (n == 1) {
                while (list) {
-                       new_pll = xmalloc(sizeof(pll));
+                       new_pll = xmalloc(sizeof(*new_pll));
                        new_pll->pl = NULL;
                        pack_list_insert(&new_pll->pl, list);
                        new_pll->next = ret;
@@ -322,7 +321,7 @@ static struct pll * get_permutations(struct pack_list *list, int n)
        while (list->next) {
                subset = get_permutations(list->next, n - 1);
                while (subset) {
-                       new_pll = xmalloc(sizeof(pll));
+                       new_pll = xmalloc(sizeof(*new_pll));
                        new_pll->pl = subset->pl;
                        pack_list_insert(&new_pll->pl, list);
                        new_pll->next = ret;