summaryrefslogtreecommitdiffstats
path: root/apps/gui/skin_engine/wps_debug.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-11-09 04:46:19 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-11-09 04:46:19 +0000
commit0621afad493800fcd5e4303c07d40cbdfe8df837 (patch)
tree3e82ccc4bd07007baa4f8171a05c5618f1efe942 /apps/gui/skin_engine/wps_debug.c
parent2a93cee8e28ad88c848b378fb10551cf5597bb81 (diff)
downloadrockbox-0621afad493800fcd5e4303c07d40cbdfe8df837.tar.gz
rockbox-0621afad493800fcd5e4303c07d40cbdfe8df837.zip
Add a bunch of markers into the tokens enum to make figuring out which token isnt in the bugout output easier. ("FIXME code(80)" is alot worse than "FIXME: TOKEN_MARKER_SOUND+5")
Also, slightly reorder the enum to group misc items together git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23573 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/skin_engine/wps_debug.c')
-rw-r--r--apps/gui/skin_engine/wps_debug.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/apps/gui/skin_engine/wps_debug.c b/apps/gui/skin_engine/wps_debug.c
index 86f929ad23..7d485f2c50 100644
--- a/apps/gui/skin_engine/wps_debug.c
+++ b/apps/gui/skin_engine/wps_debug.c
@@ -42,6 +42,29 @@ extern bool debug_wps;
extern int wps_verbose_level;
#endif
+struct debug_token_table
+{
+ enum wps_token_type start_marker;
+ char *desc;
+};
+#define X(name) name, #name
+struct debug_token_table tokens[] = {
+ { X(TOKEN_MARKER_CONTROL_TOKENS) },
+ { X(TOKEN_MARKER_BATTERY) },
+ { X(TOKEN_MARKER_SOUND) },
+ { X(TOKEN_MARKER_RTC) },
+ { X(TOKEN_MARKER_DATABASE) },
+ { X(TOKEN_MARKER_FILE) },
+ { X(TOKEN_MARKER_IMAGES) },
+ { X(TOKEN_MARKER_METADATA) },
+ { X(TOKEN_MARKER_PLAYBACK_INFO) },
+ { X(TOKEN_MARKER_PLAYLIST) },
+ { X(TOKEN_MARKER_MISC) },
+ { X(TOKEN_MARKER_RECORDING) },
+ { X(TOKEN_MARKER_END) },
+};
+#undef X
+
static char *next_str(bool next) {
return next ? "next " : "";
}
@@ -49,11 +72,11 @@ static char *next_str(bool next) {
static char *get_token_desc(struct wps_token *token, char *buf,
int bufsize, struct wps_data *data)
{
+ unsigned i;
#ifndef HAVE_LCD_BITMAP
(void)data; /* kill charcell warning */
#endif
bool next = token->next;
-
switch(token->type)
{
case WPS_NO_TOKEN:
@@ -468,8 +491,15 @@ static char *get_token_desc(struct wps_token *token, char *buf,
settings[token->value.i].cfg_name);
break;
default:
- snprintf(buf, bufsize, "FIXME (code: %d)",
- token->type);
+ for(i=1; i<sizeof(tokens)/sizeof(*token); i++)
+ {
+ if (token->type < tokens[i].start_marker)
+ {
+ snprintf(buf, bufsize, "FIXME: %s + %d\n", tokens[i-1].desc,
+ token->type - tokens[i-1].start_marker);
+ break;
+ }
+ }
break;
}