summaryrefslogtreecommitdiff
path: root/reflog-walk.c
diff options
context:
space:
mode:
authorBrian Gesiak <modocache@gmail.com>2014-05-26 15:33:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-05-27 21:02:45 (GMT)
commit8e1aa2f792b78f2528157428c7932ffa9adcbea6 (patch)
tree8fa7c10255628a6c570a028e22798ff58c040c9f /reflog-walk.c
parent48d547fb381b311fd327f84f1dff11228303c872 (diff)
downloadgit-8e1aa2f792b78f2528157428c7932ffa9adcbea6.zip
git-8e1aa2f792b78f2528157428c7932ffa9adcbea6.tar.gz
git-8e1aa2f792b78f2528157428c7932ffa9adcbea6.tar.bz2
reflog-walk.c: rearrange xcalloc arguments
xcalloc() takes two arguments: the number of elements and their size. reflog-walk.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>
Diffstat (limited to 'reflog-walk.c')
-rw-r--r--reflog-walk.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/reflog-walk.c b/reflog-walk.c
index 0dd5084..9ce8b53 100644
--- a/reflog-walk.c
+++ b/reflog-walk.c
@@ -41,7 +41,7 @@ static int read_one_reflog(unsigned char *osha1, unsigned char *nsha1,
static struct complete_reflogs *read_complete_reflog(const char *ref)
{
struct complete_reflogs *reflogs =
- xcalloc(sizeof(struct complete_reflogs), 1);
+ xcalloc(1, sizeof(struct complete_reflogs));
reflogs->ref = xstrdup(ref);
for_each_reflog_ent(ref, read_one_reflog, reflogs);
if (reflogs->nr == 0) {
@@ -135,7 +135,7 @@ struct reflog_walk_info {
void init_reflog_walk(struct reflog_walk_info** info)
{
- *info = xcalloc(sizeof(struct reflog_walk_info), 1);
+ *info = xcalloc(1, sizeof(struct reflog_walk_info));
}
int add_reflog_for_walk(struct reflog_walk_info *info,
@@ -199,7 +199,7 @@ int add_reflog_for_walk(struct reflog_walk_info *info,
= reflogs;
}
- commit_reflog = xcalloc(sizeof(struct commit_reflog), 1);
+ commit_reflog = xcalloc(1, sizeof(struct commit_reflog));
if (recno < 0) {
commit_reflog->recno = get_reflog_recno_by_time(reflogs, timestamp);
if (commit_reflog->recno < 0) {
@@ -242,7 +242,7 @@ void fake_reflog_parent(struct reflog_walk_info *info, struct commit *commit)
return;
}
- commit->parents = xcalloc(sizeof(struct commit_list), 1);
+ commit->parents = xcalloc(1, sizeof(struct commit_list));
commit->parents->item = commit_info->commit;
}