notes.c: rearrange xcalloc arguments
xcalloc() takes two arguments: the number of elements and their size. notes.c includes several calls to xcalloc() that pass the arguments in reverse order. Rearrange them so they are in the correct order. Signed-off-by: Brian Gesiak <modocache@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
3345c0f5b9
commit
65bbf082c2
6
notes.c
6
notes.c
@ -303,7 +303,7 @@ static int note_tree_insert(struct notes_tree *t, struct int_node *tree,
|
|||||||
free(entry);
|
free(entry);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
new_node = (struct int_node *) xcalloc(sizeof(struct int_node), 1);
|
new_node = (struct int_node *) xcalloc(1, sizeof(struct int_node));
|
||||||
ret = note_tree_insert(t, new_node, n + 1, l, GET_PTR_TYPE(*p),
|
ret = note_tree_insert(t, new_node, n + 1, l, GET_PTR_TYPE(*p),
|
||||||
combine_notes);
|
combine_notes);
|
||||||
if (ret)
|
if (ret)
|
||||||
@ -443,7 +443,7 @@ static void load_subtree(struct notes_tree *t, struct leaf_node *subtree,
|
|||||||
if (len <= 20) {
|
if (len <= 20) {
|
||||||
type = PTR_TYPE_NOTE;
|
type = PTR_TYPE_NOTE;
|
||||||
l = (struct leaf_node *)
|
l = (struct leaf_node *)
|
||||||
xcalloc(sizeof(struct leaf_node), 1);
|
xcalloc(1, sizeof(struct leaf_node));
|
||||||
hashcpy(l->key_sha1, object_sha1);
|
hashcpy(l->key_sha1, object_sha1);
|
||||||
hashcpy(l->val_sha1, entry.sha1);
|
hashcpy(l->val_sha1, entry.sha1);
|
||||||
if (len < 20) {
|
if (len < 20) {
|
||||||
@ -1003,7 +1003,7 @@ void init_notes(struct notes_tree *t, const char *notes_ref,
|
|||||||
if (!combine_notes)
|
if (!combine_notes)
|
||||||
combine_notes = combine_notes_concatenate;
|
combine_notes = combine_notes_concatenate;
|
||||||
|
|
||||||
t->root = (struct int_node *) xcalloc(sizeof(struct int_node), 1);
|
t->root = (struct int_node *) xcalloc(1, sizeof(struct int_node));
|
||||||
t->first_non_note = NULL;
|
t->first_non_note = NULL;
|
||||||
t->prev_non_note = NULL;
|
t->prev_non_note = NULL;
|
||||||
t->ref = notes_ref ? xstrdup(notes_ref) : NULL;
|
t->ref = notes_ref ? xstrdup(notes_ref) : NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user