* grub-core/normal/menu_entry.c (get_logical_num_lines): Use unsigned
division as the one making more sense. (update_screen): Likewise. (complete): Likewise.
This commit is contained in:
parent
5f4028d4a5
commit
b1c6d03760
2 changed files with 11 additions and 4 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2013-10-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/normal/menu_entry.c (get_logical_num_lines): Use unsigned
|
||||||
|
division as the one making more sense.
|
||||||
|
(update_screen): Likewise.
|
||||||
|
(complete): Likewise.
|
||||||
|
|
||||||
2013-10-25 Vladimir Serbinenko <phcoder@gmail.com>
|
2013-10-25 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/normal/menu_entry.c (complete): Make sure that width is >0.
|
* grub-core/normal/menu_entry.c (complete): Make sure that width is >0.
|
||||||
|
|
|
@ -128,7 +128,7 @@ get_logical_num_lines (struct line *linep, struct per_term_screen *term_screen)
|
||||||
{
|
{
|
||||||
return (grub_getstringwidth (linep->buf, linep->buf + linep->len,
|
return (grub_getstringwidth (linep->buf, linep->buf + linep->len,
|
||||||
term_screen->term)
|
term_screen->term)
|
||||||
/ term_screen->geo.entry_width) + 1;
|
/ (unsigned) term_screen->geo.entry_width) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -230,8 +230,8 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen,
|
||||||
linep = screen->lines + screen->line;
|
linep = screen->lines + screen->line;
|
||||||
grub_size_t t = grub_getstringwidth (linep->buf, linep->buf + screen->column,
|
grub_size_t t = grub_getstringwidth (linep->buf, linep->buf + screen->column,
|
||||||
term_screen->term);
|
term_screen->term);
|
||||||
y += t / term_screen->geo.entry_width;
|
y += t / (unsigned) term_screen->geo.entry_width;
|
||||||
if (t % term_screen->geo.entry_width == 0
|
if (t % (unsigned) term_screen->geo.entry_width == 0
|
||||||
&& t != 0 && screen->column == linep->len)
|
&& t != 0 && screen->column == linep->len)
|
||||||
y--;
|
y--;
|
||||||
/* Check if scrolling is necessary. */
|
/* Check if scrolling is necessary. */
|
||||||
|
@ -1082,7 +1082,7 @@ complete (struct screen *screen, int continuous, int update)
|
||||||
grub_puts_terminal ("\n ", screen->terms[i].term);
|
grub_puts_terminal ("\n ", screen->terms[i].term);
|
||||||
}
|
}
|
||||||
|
|
||||||
p += (count % num_sections) * width;
|
p += ((unsigned) count % num_sections) * width;
|
||||||
endp = p + width;
|
endp = p + width;
|
||||||
|
|
||||||
if (p != ucs4)
|
if (p != ucs4)
|
||||||
|
|
Loading…
Reference in a new issue