From 0621afad493800fcd5e4303c07d40cbdfe8df837 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Mon, 9 Nov 2009 04:46:19 +0000 Subject: 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 --- apps/gui/skin_engine/wps_debug.c | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'apps/gui/skin_engine/wps_debug.c') 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; itype < tokens[i].start_marker) + { + snprintf(buf, bufsize, "FIXME: %s + %d\n", tokens[i-1].desc, + token->type - tokens[i-1].start_marker); + break; + } + } break; } -- cgit v1.2.3