]> git.ipfire.org Git - thirdparty/git.git/blobdiff - add-interactive.c
Merge branch 'en/ort-perf-batch-9'
[thirdparty/git.git] / add-interactive.c
index 9b8cdb4a31a6ab69e7bb4e698782b11764c094c7..36ebdbdf7e2c8d6a5598e3e773b44d53b290ada7 100644 (file)
@@ -413,7 +413,7 @@ struct file_item {
 
 static void add_file_item(struct string_list *files, const char *name)
 {
-       struct file_item *item = xcalloc(sizeof(*item), 1);
+       struct file_item *item = xcalloc(1, sizeof(*item));
 
        string_list_append(files, name)->util = item;
 }
@@ -476,7 +476,7 @@ static void collect_changes_cb(struct diff_queue_struct *q,
 
                        add_file_item(s->files, name);
 
-                       entry = xcalloc(sizeof(*entry), 1);
+                       CALLOC_ARRAY(entry, 1);
                        hashmap_entry_init(&entry->ent, hash);
                        entry->name = s->files->items[s->files->nr - 1].string;
                        entry->item = s->files->items[s->files->nr - 1].util;
@@ -1120,7 +1120,7 @@ int run_add_i(struct repository *r, const struct pathspec *ps)
        int res = 0;
 
        for (i = 0; i < ARRAY_SIZE(command_list); i++) {
-               struct command_item *util = xcalloc(sizeof(*util), 1);
+               struct command_item *util = xcalloc(1, sizeof(*util));
                util->command = command_list[i].command;
                string_list_append(&commands.items, command_list[i].string)
                        ->util = util;