apply: make some names more specific

To prepare for some structs and constants being moved from builtin/apply.c to apply.h, we should give them some more specific names to avoid possible name collisions in the global namespace. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Christian Couder committed Aug 11, 2016 at 10:52 UTC 4d5acae0ca9c3a72c7ba7d82d684e7c0e57f8e92
1 file changed +10 -10
builtin/apply.c
+10 -10
@@ -21,7 +21,7 @@
21 #include "ll-merge.h"
22 #include "rerere.h"
23
24 -enum ws_error_action {
24 +enum apply_ws_error_action {
25 nowarn_ws_error,
26 warn_on_ws_error,
27 die_on_ws_error,
@@ -29,7 +29,7 @@ enum ws_error_action {
29 };
30
31
32 -enum ws_ignore {
32 +enum apply_ws_ignore {
33 ignore_ws_none,
34 ignore_ws_change
35 };
@@ -45,8 +45,8 @@ enum ws_ignore {
45 * See also "struct string_list symlink_changes" in "struct
46 * apply_state".
47 */
48 -#define SYMLINK_GOES_AWAY 01
49 -#define SYMLINK_IN_RESULT 02
48 +#define APPLY_SYMLINK_GOES_AWAY 01
49 +#define APPLY_SYMLINK_IN_RESULT 02
50
51 struct apply_state {
52 const char *prefix;
@@ -110,8 +110,8 @@ struct apply_state {
110 struct string_list fn_table;
111
112 /* These control whitespace errors */
113 - enum ws_error_action ws_error_action;
114 - enum ws_ignore ws_ignore_action;
113 + enum apply_ws_error_action ws_error_action;
114 + enum apply_ws_ignore ws_ignore_action;
115 const char *whitespace_option;
116 int whitespace_error;
117 int squelch_whitespace_errors;
@@ -3750,11 +3750,11 @@ static void prepare_symlink_changes(struct apply_state *state, struct patch *pat
3750 if ((patch->old_name && S_ISLNK(patch->old_mode)) &&
3751 (patch->is_rename || patch->is_delete))
3752 /* the symlink at patch->old_name is removed */
3753 - register_symlink_changes(state, patch->old_name, SYMLINK_GOES_AWAY);
3753 + register_symlink_changes(state, patch->old_name, APPLY_SYMLINK_GOES_AWAY);
3754
3755 if (patch->new_name && S_ISLNK(patch->new_mode))
3756 /* the symlink at patch->new_name is created or remains */
3757 - register_symlink_changes(state, patch->new_name, SYMLINK_IN_RESULT);
3757 + register_symlink_changes(state, patch->new_name, APPLY_SYMLINK_IN_RESULT);
3758 }
3759 }
3760
@@ -3769,9 +3769,9 @@ static int path_is_beyond_symlink_1(struct apply_state *state, struct strbuf *na
3769 break;
3770 name->buf[name->len] = '\0';
3771 change = check_symlink_changes(state, name->buf);
3772 - if (change & SYMLINK_IN_RESULT)
3772 + if (change & APPLY_SYMLINK_IN_RESULT)
3773 return 1;
3774 - if (change & SYMLINK_GOES_AWAY)
3774 + if (change & APPLY_SYMLINK_GOES_AWAY)
3775 /*
3776 * This cannot be "return 0", because we may
3777 * see a new one created at a higher level.