Re: [patch 02/16] const-expr.patch
- From
Erik Faye-Lund <kusmabite@googlemail.com>
- Date
- Apr 27, 2010, 14:08 UTC
- Message-ID
- <l2t40aa078e1004270708w905ae1e1lbead0f21acc70dee@mail.gmail.com>
- In-Reply-To
- <20100427135812.656626000@mlists.thewrittenword.com>
On Tue, Apr 27, 2010 at 3:57 PM, Gary V. Vaughan <git@mlists.thewrittenword.com> wrote:
Show 10 quoted lines
> Index: b/unpack-trees.c
> ===================================================================
> --- a/unpack-trees.c
> +++ b/unpack-trees.c
> @@ -287,9 +287,11 @@ static void add_same_unmerged(struct cac
> static int unpack_index_entry(struct cache_entry *ce,
> struct unpack_trees_options *o)
> {
> - struct cache_entry *src[5] = { ce, NULL, };
> + struct cache_entry *src[5] = { NULL, NULL };You don't need NULL twice when the array-size is specified, it's just confusing as the array has 5 elements.
Show 10 quoted lines
> Index: b/builtin/commit.c
> ===================================================================
> --- a/builtin/commit.c
> +++ b/builtin/commit.c
> @@ -717,7 +717,8 @@ static int prepare_to_commit(const char
>
> if (use_editor) {
> char index[PATH_MAX];
> - const char *env[2] = { index, NULL };
> + const char *env[] = { NULL, NULL };Why not "const char *env[2] = { NULL };", as it's shorter?Show 10 quoted lines
> Index: b/builtin/cat-file.c
> ===================================================================
> --- a/builtin/cat-file.c
> +++ b/builtin/cat-file.c
> @@ -118,7 +118,9 @@ static int cat_one_file(int opt, const c
>
> /* custom pretty-print here */
> if (type == OBJ_TREE) {
> - const char *ls_args[3] = {"ls-tree", obj_name, NULL};
> + const char *ls_args[3] = { NULL, NULL, NULL };Again, you don't need to repeat NULL.
-- Erik "kusma" Faye-Lund