diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2009-11-09 04:46:19 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2009-11-09 04:46:19 +0000 |
commit | 0621afad493800fcd5e4303c07d40cbdfe8df837 (patch) | |
tree | 3e82ccc4bd07007baa4f8171a05c5618f1efe942 /apps/gui/skin_engine/wps_debug.c | |
parent | 2a93cee8e28ad88c848b378fb10551cf5597bb81 (diff) | |
download | rockbox-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.c | 36 |
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; | |||
42 | extern int wps_verbose_level; | 42 | extern int wps_verbose_level; |
43 | #endif | 43 | #endif |
44 | 44 | ||
45 | struct debug_token_table | ||
46 | { | ||
47 | enum wps_token_type start_marker; | ||
48 | char *desc; | ||
49 | }; | ||
50 | #define X(name) name, #name | ||
51 | struct debug_token_table tokens[] = { | ||
52 | { X(TOKEN_MARKER_CONTROL_TOKENS) }, | ||
53 | { X(TOKEN_MARKER_BATTERY) }, | ||
54 | { X(TOKEN_MARKER_SOUND) }, | ||
55 | { X(TOKEN_MARKER_RTC) }, | ||
56 | { X(TOKEN_MARKER_DATABASE) }, | ||
57 | { X(TOKEN_MARKER_FILE) }, | ||
58 | { X(TOKEN_MARKER_IMAGES) }, | ||
59 | { X(TOKEN_MARKER_METADATA) }, | ||
60 | { X(TOKEN_MARKER_PLAYBACK_INFO) }, | ||
61 | { X(TOKEN_MARKER_PLAYLIST) }, | ||
62 | { X(TOKEN_MARKER_MISC) }, | ||
63 | { X(TOKEN_MARKER_RECORDING) }, | ||
64 | { X(TOKEN_MARKER_END) }, | ||
65 | }; | ||
66 | #undef X | ||
67 | |||
45 | static char *next_str(bool next) { | 68 | static char *next_str(bool next) { |
46 | return next ? "next " : ""; | 69 | return next ? "next " : ""; |
47 | } | 70 | } |
@@ -49,11 +72,11 @@ static char *next_str(bool next) { | |||
49 | static char *get_token_desc(struct wps_token *token, char *buf, | 72 | static char *get_token_desc(struct wps_token *token, char *buf, |
50 | int bufsize, struct wps_data *data) | 73 | int bufsize, struct wps_data *data) |
51 | { | 74 | { |
75 | unsigned i; | ||
52 | #ifndef HAVE_LCD_BITMAP | 76 | #ifndef HAVE_LCD_BITMAP |
53 | (void)data; /* kill charcell warning */ | 77 | (void)data; /* kill charcell warning */ |
54 | #endif | 78 | #endif |
55 | bool next = token->next; | 79 | bool next = token->next; |
56 | |||
57 | switch(token->type) | 80 | switch(token->type) |
58 | { | 81 | { |
59 | case WPS_NO_TOKEN: | 82 | case WPS_NO_TOKEN: |
@@ -468,8 +491,15 @@ static char *get_token_desc(struct wps_token *token, char *buf, | |||
468 | settings[token->value.i].cfg_name); | 491 | settings[token->value.i].cfg_name); |
469 | break; | 492 | break; |
470 | default: | 493 | default: |
471 | snprintf(buf, bufsize, "FIXME (code: %d)", | 494 | for(i=1; i<sizeof(tokens)/sizeof(*token); i++) |
472 | token->type); | 495 | { |
496 | if (token->type < tokens[i].start_marker) | ||
497 | { | ||
498 | snprintf(buf, bufsize, "FIXME: %s + %d\n", tokens[i-1].desc, | ||
499 | token->type - tokens[i-1].start_marker); | ||
500 | break; | ||
501 | } | ||
502 | } | ||
473 | break; | 503 | break; |
474 | } | 504 | } |
475 | 505 | ||