+2013-10-25 Vladimir Serbinenko <phcoder@gmail.com>
+
+ Make char and string width grub_size_t rather than grub_ssize_t.
+
2013-10-25 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/normal/cmdline.c (grub_history_get): Make argument into
#ifdef HAVE_UNIFONT_WIDTHSPEC
-grub_ssize_t
+grub_size_t
grub_unicode_estimate_width (const struct grub_unicode_glyph *c)
{
if (grub_unicode_get_comb_type (c->base))
bidi_line_wrap (struct grub_unicode_glyph *visual_out,
struct grub_unicode_glyph *visual,
grub_size_t visual_len,
- grub_ssize_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
+ grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
void *getcharwidth_arg,
grub_size_t maxwidth, grub_size_t startwidth,
grub_uint32_t contchar,
grub_bidi_line_logical_to_visual (const grub_uint32_t *logical,
grub_size_t logical_len,
struct grub_unicode_glyph *visual_out,
- grub_ssize_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
+ grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
void *getcharwidth_arg,
grub_size_t maxwidth, grub_size_t startwidth,
grub_uint32_t contchar,
grub_bidi_logical_to_visual (const grub_uint32_t *logical,
grub_size_t logical_len,
struct grub_unicode_glyph **visual_out,
- grub_ssize_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
+ grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
void *getcharwidth_arg,
grub_size_t max_length, grub_size_t startwidth,
grub_uint32_t contchar, struct grub_term_pos *pos, int primitive_wrap)
for (i = 0; i < screen->line; i++, linep++)
y += get_logical_num_lines (linep, term_screen);
linep = screen->lines + screen->line;
- int t = grub_getstringwidth (linep->buf, linep->buf + screen->column,
- term_screen->term);
+ grub_size_t t = grub_getstringwidth (linep->buf, linep->buf + screen->column,
+ term_screen->term);
y += t / term_screen->geo.entry_width;
if (t % term_screen->geo.entry_width == 0
&& t != 0 && screen->column == linep->len)
return (geo->first_entry_x + geo->entry_width);
}
-grub_ssize_t
+grub_size_t
grub_getstringwidth (grub_uint32_t * str, const grub_uint32_t * last_position,
struct grub_term_output *term)
{
return 0;
}
-static grub_ssize_t
+static grub_size_t
getcharwidth (const struct grub_unicode_glyph *c, void *term)
{
return grub_term_getcharwidth (term, c);
static void grub_gfxterm_refresh (struct grub_term_output *term __attribute__ ((unused)));
-static grub_ssize_t
+static grub_size_t
grub_gfxterm_getcharwidth (struct grub_term_output *term __attribute__ ((unused)),
const struct grub_unicode_glyph *c);
/ virtual_screen.normal_char_width;
}
-static grub_ssize_t
+static grub_size_t
grub_gfxterm_getcharwidth (struct grub_term_output *term __attribute__ ((unused)),
const struct grub_unicode_glyph *c)
{
const grub_uint32_t * last_position,
int margin_left, int margin_right,
struct grub_term_output *term);
-grub_ssize_t grub_getstringwidth (grub_uint32_t * str,
- const grub_uint32_t * last_position,
- struct grub_term_output *term);
+grub_size_t grub_getstringwidth (grub_uint32_t * str,
+ const grub_uint32_t * last_position,
+ struct grub_term_output *term);
void grub_print_message_indented (const char *msg, int margin_left,
int margin_right,
struct grub_term_output *term);
/* Get the number of columns occupied by a given character C. C is
encoded in Unicode. */
- grub_ssize_t (*getcharwidth) (struct grub_term_output *term,
- const struct grub_unicode_glyph *c);
+ grub_size_t (*getcharwidth) (struct grub_term_output *term,
+ const struct grub_unicode_glyph *c);
/* Get the screen size. */
struct grub_term_coordinate (*getwh) (struct grub_term_output *term);
#ifdef HAVE_UNIFONT_WIDTHSPEC
-grub_ssize_t
+grub_size_t
grub_unicode_estimate_width (const struct grub_unicode_glyph *c);
#else
#define GRUB_TERM_TAB_WIDTH 8
-static inline grub_ssize_t
+static inline grub_size_t
grub_term_getcharwidth (struct grub_term_output *term,
const struct grub_unicode_glyph *c)
{
grub_bidi_logical_to_visual (const grub_uint32_t *logical,
grub_size_t logical_len,
struct grub_unicode_glyph **visual_out,
- grub_ssize_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
+ grub_size_t (*getcharwidth) (const struct grub_unicode_glyph *visual, void *getcharwidth_arg),
void *getcharwidth_arg,
grub_size_t max_width,
grub_size_t start_width, grub_uint32_t codechar,