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 /apps | |
| parent | 7b374b43b5023cbc2b5f3b043f95ce3fa9a39b61 (diff) | |
| download | rockbox-19d08c2664582bb37be960de16905b0444eac4c9.zip rockbox-19d08c2664582bb37be960de16905b0444eac4c9.tar.gz rockbox-19d08c2664582bb37be960de16905b0444eac4c9.tar.bz2 rockbox-19d08c2664582bb37be960de16905b0444eac4c9.tar.xz | |
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
Diffstat (limited to 'apps')
| -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 9451387..0d690ce 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c @@ -132,20 +132,18 @@ struct display_format { static struct display_format *formats[TAGMENU_MAX_FMTS]; static int format_count; -struct search_instruction { - char name[64]; - int tagorder[MAX_TAGS]; - int tagorder_count; - struct tagcache_search_clause *clause[MAX_TAGS][TAGCACHE_MAX_CLAUSES]; - int format_id[MAX_TAGS]; - int clause_count[MAX_TAGS]; - int result_seek[MAX_TAGS]; -}; - struct menu_entry { char name[64]; int type; - struct search_instruction *si; + struct search_instruction { + char name[64]; + int tagorder[MAX_TAGS]; + int tagorder_count; + struct tagcache_search_clause *clause[MAX_TAGS][TAGCACHE_MAX_CLAUSES]; + int format_id[MAX_TAGS]; + int clause_count[MAX_TAGS]; + int result_seek[MAX_TAGS]; + } si; int link; }; @@ -590,7 +588,7 @@ static bool parse_search(struct menu_entry *entry, const char *str) { int ret; int type; - struct search_instruction *inst = entry->si; + struct search_instruction *inst = &entry->si; char buf[MAX_PATH]; int i; struct menu_root *new_menu; @@ -975,10 +973,8 @@ static int parse_line(int n, const char *buf, void *parameters) { menu->items[menu->itemcount] = buffer_alloc(sizeof(struct menu_entry)); memset(menu->items[menu->itemcount], 0, sizeof(struct menu_entry)); - menu->items[menu->itemcount]->si = buffer_alloc(sizeof(struct search_instruction)); } - - memset(menu->items[menu->itemcount]->si, 0, sizeof(struct search_instruction)); + if (!parse_search(menu->items[menu->itemcount], buf)) return 0; @@ -1528,7 +1524,7 @@ int tagtree_enter(struct tree_context* c) { int i, j; - csi = menu->items[seek]->si; + csi = &menu->items[seek]->si; c->currextra = 0; strlcpy(current_title[c->currextra], dptr->name, |