summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine/wps_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/skin_engine/wps_debug.c')
-rw-r--r--apps/gui/skin_engine/wps_debug.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/apps/gui/skin_engine/wps_debug.c b/apps/gui/skin_engine/wps_debug.c
index db8aa7759e..64a68b05d6 100644
--- a/apps/gui/skin_engine/wps_debug.c
+++ b/apps/gui/skin_engine/wps_debug.c
@@ -45,7 +45,8 @@ static char *next_str(bool next) {
45 return next ? "next " : ""; 45 return next ? "next " : "";
46} 46}
47 47
48static char *get_token_desc(struct wps_token *token, char *buf, int bufsize) 48static char *get_token_desc(struct wps_token *token, char *buf,
49 int bufsize, struct wps_data *data)
49{ 50{
50 bool next = token->next; 51 bool next = token->next;
51 52
@@ -116,8 +117,15 @@ static char *get_token_desc(struct wps_token *token, char *buf, int bufsize)
116 break; 117 break;
117 118
118 case WPS_TOKEN_IMAGE_PRELOAD_DISPLAY: 119 case WPS_TOKEN_IMAGE_PRELOAD_DISPLAY:
119 snprintf(buf, bufsize, "display preloaded image '%c'", 120 {
120 token->value.i&0xFF); 121 char subimage = '\0';
122 char label = token->value.i&0xFF;
123 struct gui_img *img = find_image(label, data);
124 if (img && img->num_subimages > 1)
125 subimage = 'a' + (token->value.i>>8);
126 snprintf(buf, bufsize, "display preloaded image '%c%c'",
127 label, subimage);
128 }
121 break; 129 break;
122 130
123 case WPS_TOKEN_IMAGE_DISPLAY: 131 case WPS_TOKEN_IMAGE_DISPLAY:
@@ -465,7 +473,7 @@ static void dump_wps_tokens(struct wps_data *data)
465 /* Dump parsed WPS */ 473 /* Dump parsed WPS */
466 for (i = 0, token = data->tokens; i < data->num_tokens; i++, token++) 474 for (i = 0, token = data->tokens; i < data->num_tokens; i++, token++)
467 { 475 {
468 get_token_desc(token, buf, sizeof(buf)); 476 get_token_desc(token, buf, sizeof(buf), data);
469 477
470 switch(token->type) 478 switch(token->type)
471 { 479 {
@@ -583,21 +591,21 @@ void print_debug_info(struct wps_data *data, enum wps_parse_error fail, int line
583 case PARSE_FAIL_INVALID_CHAR: 591 case PARSE_FAIL_INVALID_CHAR:
584 DEBUGF("ERR: Unexpected conditional char after token %d: \"%s\"", 592 DEBUGF("ERR: Unexpected conditional char after token %d: \"%s\"",
585 data->num_tokens-1, 593 data->num_tokens-1,
586 get_token_desc(&data->tokens[data->num_tokens-1], buf, sizeof(buf)) 594 get_token_desc(&data->tokens[data->num_tokens-1], buf, sizeof(buf), data)
587 ); 595 );
588 break; 596 break;
589 597
590 case PARSE_FAIL_COND_SYNTAX_ERROR: 598 case PARSE_FAIL_COND_SYNTAX_ERROR:
591 DEBUGF("ERR: Conditional syntax error after token %d: \"%s\"", 599 DEBUGF("ERR: Conditional syntax error after token %d: \"%s\"",
592 data->num_tokens-1, 600 data->num_tokens-1,
593 get_token_desc(&data->tokens[data->num_tokens-1], buf, sizeof(buf)) 601 get_token_desc(&data->tokens[data->num_tokens-1], buf, sizeof(buf), data)
594 ); 602 );
595 break; 603 break;
596 604
597 case PARSE_FAIL_COND_INVALID_PARAM: 605 case PARSE_FAIL_COND_INVALID_PARAM:
598 DEBUGF("ERR: Invalid parameter list for token %d: \"%s\"", 606 DEBUGF("ERR: Invalid parameter list for token %d: \"%s\"",
599 data->num_tokens, 607 data->num_tokens,
600 get_token_desc(&data->tokens[data->num_tokens], buf, sizeof(buf)) 608 get_token_desc(&data->tokens[data->num_tokens], buf, sizeof(buf), data)
601 ); 609 );
602 break; 610 break;
603 611