summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2014-01-12 01:50:21 +0100
committerThomas Martitz <kugel@rockbox.org>2014-01-12 01:50:21 +0100
commit0a0d61e777c47d742be195dd9c661065be0eb7da (patch)
treefdb9660885991731d0122f74395a8b7a677c8123 /firmware
parent488a1b983e1c2fac14de25aa781caf12628e53c8 (diff)
downloadrockbox-0a0d61e777c47d742be195dd9c661065be0eb7da.tar.gz
rockbox-0a0d61e777c47d742be195dd9c661065be0eb7da.zip
Fix remote warnings and charcell reds, and remove minor left-over tuff.
Change-Id: I10987ea9fcad94d502afd4ae4a80ab9022c75d2e
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/lcd-charcell.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/firmware/drivers/lcd-charcell.c b/firmware/drivers/lcd-charcell.c
index 6a6e57e992..46c48bb726 100644
--- a/firmware/drivers/lcd-charcell.c
+++ b/firmware/drivers/lcd-charcell.c
@@ -511,7 +511,7 @@ void lcd_putsf(int x, int y, const unsigned char *fmt, ...)
511 511
512/** scrolling **/ 512/** scrolling **/
513 513
514void lcd_puts_scroll_worker(int x, int y, const unsigned char *string, 514bool lcd_puts_scroll_worker(int x, int y, const unsigned char *string,
515 int offset, 515 int offset,
516 void (*scroll_func)(struct scrollinfo *), void *data) 516 void (*scroll_func)(struct scrollinfo *), void *data)
517{ 517{
@@ -519,12 +519,13 @@ void lcd_puts_scroll_worker(int x, int y, const unsigned char *string,
519 int len; 519 int len;
520 520
521 if ((unsigned)y >= (unsigned)current_vp->height) 521 if ((unsigned)y >= (unsigned)current_vp->height)
522 return; 522 return false;
523 523
524 /* remove any previously scrolling line at the same location */ 524 /* remove any previously scrolling line at the same location */
525 lcd_scroll_stop_viewport_rect(current_vp, x, y, current_vp->width - x, 1); 525 lcd_scroll_stop_viewport_rect(current_vp, x, y, current_vp->width - x, 1);
526 526
527 if (lcd_scroll_info.lines >= LCD_SCROLLABLE_LINES) return; 527 if (lcd_scroll_info.lines >= LCD_SCROLLABLE_LINES)
528 return false;
528 529
529 s = &lcd_scroll_info.scroll[lcd_scroll_info.lines]; 530 s = &lcd_scroll_info.scroll[lcd_scroll_info.lines];
530 531
@@ -534,7 +535,7 @@ void lcd_puts_scroll_worker(int x, int y, const unsigned char *string,
534 len = utf8length(string); 535 len = utf8length(string);
535 536
536 if (current_vp->width - x >= len) 537 if (current_vp->width - x >= len)
537 return; 538 return false;
538 /* prepare scroll line */ 539 /* prepare scroll line */
539 strlcpy(s->linebuffer, string, sizeof s->linebuffer); 540 strlcpy(s->linebuffer, string, sizeof s->linebuffer);
540 541
@@ -558,19 +559,24 @@ void lcd_puts_scroll_worker(int x, int y, const unsigned char *string,
558 s->offset = offset; 559 s->offset = offset;
559 s->backward = false; 560 s->backward = false;
560 lcd_scroll_info.lines++; 561 lcd_scroll_info.lines++;
562
563 return true;
561} 564}
562 565
563void lcd_putsxy_scroll_func(int x, int y, const unsigned char *string, 566bool lcd_putsxy_scroll_func(int x, int y, const unsigned char *string,
564 void (*scroll_func)(struct scrollinfo *), 567 void (*scroll_func)(struct scrollinfo *),
565 void *data, int x_offset) 568 void *data, int x_offset)
566{ 569{
570 bool retval = false;
567 if (!scroll_func) 571 if (!scroll_func)
568 lcd_putsxyofs(x, y, x_offset, string); 572 lcd_putsxyofs(x, y, x_offset, string);
569 else 573 else
570 lcd_puts_scroll_worker(x, y, string, x_offset, scroll_func, data); 574 retval = lcd_puts_scroll_worker(x, y, string, x_offset, scroll_func, data);
575
576 return retval;
571} 577}
572 578
573void lcd_scroll_fn(struct scrollinfo* s) 579static void lcd_scroll_fn(struct scrollinfo* s)
574{ 580{
575 lcd_putsxyofs(s->x, s->y, s->offset, s->line); 581 lcd_putsxyofs(s->x, s->y, s->offset, s->line);
576 if (lcd_cursor.enabled) 582 if (lcd_cursor.enabled)
@@ -583,7 +589,7 @@ void lcd_scroll_fn(struct scrollinfo* s)
583 } 589 }
584} 590}
585 591
586void lcd_puts_scroll(int x, int y, const unsigned char *string) 592bool lcd_puts_scroll(int x, int y, const unsigned char *string)
587{ 593{
588 lcd_puts_scroll_worker(x, y, string, 0, lcd_scroll_fn, NULL); 594 return lcd_puts_scroll_worker(x, y, string, 0, lcd_scroll_fn, NULL);
589} 595}