trailer: rename 'new' variables

Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brandon Williams committed Feb 14, 2018 at 10:59 UTC 176513264bd72d909ff931c59638dac6b861dbda
1 file changed +17 -17
trailer.c
+17 -17
@@ -174,12 +174,12 @@ static void print_all(FILE *outfile, struct list_head *head,
174
175 static struct trailer_item *trailer_from_arg(struct arg_item *arg_tok)
176 {
177 - struct trailer_item *new = xcalloc(sizeof(*new), 1);
178 - new->token = arg_tok->token;
179 - new->value = arg_tok->value;
177 + struct trailer_item *new_item = xcalloc(sizeof(*new_item), 1);
178 + new_item->token = arg_tok->token;
179 + new_item->value = arg_tok->value;
180 arg_tok->token = arg_tok->value = NULL;
181 free_arg_item(arg_tok);
182 - return new;
182 + return new_item;
183 }
184
185 static void add_arg_to_input_list(struct trailer_item *on_tok,
@@ -666,30 +666,30 @@ static void parse_trailer(struct strbuf *tok, struct strbuf *val,
666 static struct trailer_item *add_trailer_item(struct list_head *head, char *tok,
667 char *val)
668 {
669 - struct trailer_item *new = xcalloc(sizeof(*new), 1);
670 - new->token = tok;
671 - new->value = val;
672 - list_add_tail(&new->list, head);
673 - return new;
669 + struct trailer_item *new_item = xcalloc(sizeof(*new_item), 1);
670 + new_item->token = tok;
671 + new_item->value = val;
672 + list_add_tail(&new_item->list, head);
673 + return new_item;
674 }
675
676 static void add_arg_item(struct list_head *arg_head, char *tok, char *val,
677 const struct conf_info *conf,
678 const struct new_trailer_item *new_trailer_item)
679 {
680 - struct arg_item *new = xcalloc(sizeof(*new), 1);
681 - new->token = tok;
682 - new->value = val;
683 - duplicate_conf(&new->conf, conf);
680 + struct arg_item *new_item = xcalloc(sizeof(*new_item), 1);
681 + new_item->token = tok;
682 + new_item->value = val;
683 + duplicate_conf(&new_item->conf, conf);
684 if (new_trailer_item) {
685 if (new_trailer_item->where != WHERE_DEFAULT)
686 - new->conf.where = new_trailer_item->where;
686 + new_item->conf.where = new_trailer_item->where;
687 if (new_trailer_item->if_exists != EXISTS_DEFAULT)
688 - new->conf.if_exists = new_trailer_item->if_exists;
688 + new_item->conf.if_exists = new_trailer_item->if_exists;
689 if (new_trailer_item->if_missing != MISSING_DEFAULT)
690 - new->conf.if_missing = new_trailer_item->if_missing;
690 + new_item->conf.if_missing = new_trailer_item->if_missing;
691 }
692 - list_add_tail(&new->list, arg_head);
692 + list_add_tail(&new_item->list, arg_head);
693 }
694
695 static void process_command_line_args(struct list_head *arg_head,