diff options
author | Thomas Martitz <kugel@rockbox.org> | 2011-06-20 19:32:52 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2011-06-20 19:32:52 +0000 |
commit | 19d08c2664582bb37be960de16905b0444eac4c9 (patch) | |
tree | 356a842255ccf5e6e9d53afd77f1398c5738cbd3 | |
parent | 7b374b43b5023cbc2b5f3b043f95ce3fa9a39b61 (diff) | |
download | rockbox-19d08c2664582bb37be960de16905b0444eac4c9.tar.gz rockbox-19d08c2664582bb37be960de16905b0444eac4c9.zip |
Move struct search_instruction into struct menu root, as they're not allocated or used independently.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30028 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/tagtree.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/apps/tagtree.c b/apps/tagtree.c index 9451387a66..0d690cea26 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c | |||
@@ -132,20 +132,18 @@ struct display_format { | |||
132 | static struct display_format *formats[TAGMENU_MAX_FMTS]; | 132 | static struct display_format *formats[TAGMENU_MAX_FMTS]; |
133 | static int format_count; | 133 | static int format_count; |
134 | 134 | ||
135 | struct search_instruction { | ||
136 | char name[64]; | ||
137 | int tagorder[MAX_TAGS]; | ||
138 | int tagorder_count; | ||
139 | struct tagcache_search_clause *clause[MAX_TAGS][TAGCACHE_MAX_CLAUSES]; | ||
140 | int format_id[MAX_TAGS]; | ||
141 | int clause_count[MAX_TAGS]; | ||
142 | int result_seek[MAX_TAGS]; | ||
143 | }; | ||
144 | |||
145 | struct menu_entry { | 135 | struct menu_entry { |
146 | char name[64]; | 136 | char name[64]; |
147 | int type; | 137 | int type; |
148 | struct search_instruction *si; | 138 | struct search_instruction { |
139 | char name[64]; | ||
140 | int tagorder[MAX_TAGS]; | ||
141 | int tagorder_count; | ||
142 | struct tagcache_search_clause *clause[MAX_TAGS][TAGCACHE_MAX_CLAUSES]; | ||
143 | int format_id[MAX_TAGS]; | ||
144 | int clause_count[MAX_TAGS]; | ||
145 | int result_seek[MAX_TAGS]; | ||
146 | } si; | ||
149 | int link; | 147 | int link; |
150 | }; | 148 | }; |
151 | 149 | ||
@@ -590,7 +588,7 @@ static bool parse_search(struct menu_entry *entry, const char *str) | |||
590 | { | 588 | { |
591 | int ret; | 589 | int ret; |
592 | int type; | 590 | int type; |
593 | struct search_instruction *inst = entry->si; | 591 | struct search_instruction *inst = &entry->si; |
594 | char buf[MAX_PATH]; | 592 | char buf[MAX_PATH]; |
595 | int i; | 593 | int i; |
596 | struct menu_root *new_menu; | 594 | struct menu_root *new_menu; |
@@ -975,10 +973,8 @@ static int parse_line(int n, const char *buf, void *parameters) | |||
975 | { | 973 | { |
976 | menu->items[menu->itemcount] = buffer_alloc(sizeof(struct menu_entry)); | 974 | menu->items[menu->itemcount] = buffer_alloc(sizeof(struct menu_entry)); |
977 | memset(menu->items[menu->itemcount], 0, sizeof(struct menu_entry)); | 975 | memset(menu->items[menu->itemcount], 0, sizeof(struct menu_entry)); |
978 | menu->items[menu->itemcount]->si = buffer_alloc(sizeof(struct search_instruction)); | ||
979 | } | 976 | } |
980 | 977 | ||
981 | memset(menu->items[menu->itemcount]->si, 0, sizeof(struct search_instruction)); | ||
982 | if (!parse_search(menu->items[menu->itemcount], buf)) | 978 | if (!parse_search(menu->items[menu->itemcount], buf)) |
983 | return 0; | 979 | return 0; |
984 | 980 | ||
@@ -1528,7 +1524,7 @@ int tagtree_enter(struct tree_context* c) | |||
1528 | { | 1524 | { |
1529 | int i, j; | 1525 | int i, j; |
1530 | 1526 | ||
1531 | csi = menu->items[seek]->si; | 1527 | csi = &menu->items[seek]->si; |
1532 | c->currextra = 0; | 1528 | c->currextra = 0; |
1533 | 1529 | ||
1534 | strlcpy(current_title[c->currextra], dptr->name, | 1530 | strlcpy(current_title[c->currextra], dptr->name, |