Re: [PATCH v4 0/8] cat-file: add --batch-command remote-object-info command
Style and coccinelle fixes; please squash in when you reroll.
* var = xcalloc(count, sizeof(*var)) --> CALLOC_ARRAY(var, count)
for count != 1
* sizeof (type) --> sizeof(type)
Thanks.
builtin/cat-file.c | 2 +-
transport.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index 57c090f249..4afe82322f 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -515,7 +515,7 @@ static int get_remote_info(struct batch_options *opt, int argc, const char **arg
size_t j;
int include_size = 0, include_type = 0;
- remote_object_info = xcalloc(object_info_oids.nr, sizeof(struct object_info));
+ CALLOC_ARRAY(remote_object_info, object_info_oids.nr);
gtransport->smart_options->object_info = 1;
gtransport->smart_options->object_info_oids = &object_info_oids;
/**
diff --git a/transport.c b/transport.c
index 64bcc311ff..87197f0ec7 100644
--- a/transport.c
+++ b/transport.c
@@ -442,7 +442,7 @@ static int fetch_refs_via_pack(struct transport *transport,
struct ref *refs = NULL;
struct fetch_pack_args args;
struct ref *refs_tmp = NULL;
- struct ref *object_info_refs = xcalloc(1, sizeof (struct ref));
+ struct ref *object_info_refs = xcalloc(1, sizeof(struct ref));
memset(&args, 0, sizeof(args));
args.uploadpack = data->options.uploadpack;
@@ -479,7 +479,7 @@ static int fetch_refs_via_pack(struct transport *transport,
args.quiet = 1;
args.no_progress = 1;
for (i = 0; i < transport->smart_options->object_info_oids->nr; i++) {
- struct ref *temp_ref = xcalloc(1, sizeof (struct ref));
+ struct ref *temp_ref = xcalloc(1, sizeof(struct ref));
temp_ref->old_oid = *(transport->smart_options->object_info_oids->oid + i);
temp_ref->exact_oid = 1;
ref->next = temp_ref;
--
2.37.2-479-gedbcd27e9d