From 73039dc2368f879a3d7a08852276ff0deb446411 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Fri, 18 Apr 2014 14:33:19 -0400 Subject: [PATCH] view: replace line user_flags with no_commit_refs and commit_title flags --- include/tig/view.h | 3 ++- src/diff.c | 6 ++---- src/main.c | 5 ++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/tig/view.h b/include/tig/view.h index c78a8ac..670256a 100644 --- a/include/tig/view.h +++ b/include/tig/view.h @@ -33,8 +33,9 @@ struct line { unsigned int dirty:1; unsigned int cleareol:1; unsigned int wrapped:1; + unsigned int commit_title:1; + unsigned int no_commit_refs:1; - unsigned int user_flags:6; void *data; /* User data */ }; diff --git a/src/diff.c b/src/diff.c index 48e0cff..af97988 100644 --- a/src/diff.c +++ b/src/diff.c @@ -21,8 +21,6 @@ #include "tig/diff.h" #include "tig/draw.h" -#define DIFF_LINE_COMMIT_TITLE 1 - static bool diff_open(struct view *view, enum open_flags flags) { @@ -72,7 +70,7 @@ diff_common_read(struct view *view, const char *data, struct diff_state *state) struct line *line = add_line_text(view, data, LINE_DEFAULT); if (line) - line->user_flags |= DIFF_LINE_COMMIT_TITLE; + line->commit_title = 1; state->after_commit_title = TRUE; return line != NULL; } @@ -188,7 +186,7 @@ diff_common_draw(struct view *view, struct line *line, unsigned int lineno) } } - if (line->user_flags & DIFF_LINE_COMMIT_TITLE) + if (line->commit_title) draw_commit_title(view, text, 4); else draw_text(view, type, text); diff --git a/src/main.c b/src/main.c index 689c485..9cd1477 100644 --- a/src/main.c +++ b/src/main.c @@ -221,9 +221,8 @@ main_done(struct view *view) free(state->reflog); } -#define MAIN_NO_COMMIT_REFS 1 -#define main_check_commit_refs(line) !((line)->user_flags & MAIN_NO_COMMIT_REFS) -#define main_mark_no_commit_refs(line) (((struct line *) (line))->user_flags |= MAIN_NO_COMMIT_REFS) +#define main_check_commit_refs(line) !((line)->no_commit_refs) +#define main_mark_no_commit_refs(line) (((struct line *) (line))->no_commit_refs = 1) static inline struct ref_list * main_get_commit_refs(const struct line *line, struct commit *commit) -- 2.11.4.GIT