de-anonymize type-specific tog view state strucures
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
diff --git a/tog/tog.c b/tog/tog.c
index aeac875..6ddb4fe 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -100,6 +100,23 @@ struct commit_queue {
struct commit_queue_head head;
};
+struct tog_diff_view_state {
+ FILE *f;
+ int first_displayed_line;
+ int last_displayed_line;
+};
+
+struct tog_log_view_state {
+ struct got_commit_graph *graph;
+ struct commit_queue commits;
+ struct commit_queue_entry *first_displayed_entry;
+ struct commit_queue_entry *last_displayed_entry;
+ struct commit_queue_entry *selected_entry;
+ int selected;
+ char *in_repo_path;
+ struct got_repository *repo;
+};
+
struct tog_view {
WINDOW *window;
PANEL *panel;
@@ -110,21 +127,8 @@ struct tog_view {
/* type-specific state */
enum tog_view_type type;
union {
- struct {
- FILE *f;
- int first_displayed_line;
- int last_displayed_line;
- } diff;
- struct {
- struct got_commit_graph *graph;
- struct commit_queue commits;
- struct commit_queue_entry *first_displayed_entry;
- struct commit_queue_entry *last_displayed_entry;
- struct commit_queue_entry *selected_entry;
- int selected;
- char *in_repo_path;
- struct got_repository *repo;
- } log;
+ struct tog_diff_view_state diff;
+ struct tog_log_view_state log;
} state;
};