builtin/apply: avoid parameter shadowing 'p_value' global
Let's just rename the global 'state_p_value' as it will become
'state->p_value' in a following patch.
This also avoid errors when compiling with -Wshadow and makes
it safer to later move global variables into a "state" struct.
Helped-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Christian Couder9 years agocommitted byJunio C Hamano
@ -938,7 +938,7 @@ static void gitdiff_verify_name(const char *line, int isnull, char **name, int s
@@ -938,7 +938,7 @@ static void gitdiff_verify_name(const char *line, int isnull, char **name, int s
if (isnull)
die(_("git apply: bad git-diff - expected /dev/null, got %s on line %d"),
*name, linenr);
another = find_name(line, NULL, p_value, TERM_TAB);
another = find_name(line, NULL, state_p_value, TERM_TAB);
if (!another || memcmp(another, *name, len + 1))
die((side == DIFF_NEW_NAME) ?
_("git apply: bad git-diff - inconsistent new filename on line %d") :
@ -1481,8 +1481,8 @@ static int find_header(const char *line, unsigned long size, int *hdrsize, struc
@@ -1481,8 +1481,8 @@ static int find_header(const char *line, unsigned long size, int *hdrsize, struc
"%d leading pathname component (line %d)",
"git diff header lacks filename information when removing "
"%d leading pathname components (line %d)",
p_value),
p_value, linenr);
state_p_value),
state_p_value, linenr);
patch->old_name = xstrdup(patch->def_name);
patch->new_name = xstrdup(patch->def_name);
}
@ -4461,7 +4461,7 @@ static int option_parse_include(const struct option *opt,
@@ -4461,7 +4461,7 @@ static int option_parse_include(const struct option *opt,
static int option_parse_p(const struct option *opt,