]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Make char and string width grub_size_t rather than grub_ssize_t.
authorVladimir Serbinenko <phcoder@gmail.com>
Fri, 25 Oct 2013 21:58:24 +0000 (23:58 +0200)
committerVladimir Serbinenko <phcoder@gmail.com>
Fri, 25 Oct 2013 21:58:24 +0000 (23:58 +0200)
ChangeLog
grub-core/normal/charset.c
grub-core/normal/menu_entry.c
grub-core/normal/menu_text.c
grub-core/normal/term.c
grub-core/term/gfxterm.c
include/grub/normal.h
include/grub/term.h
include/grub/unicode.h

index b4b30ef73c215ebc0ba360088842e9dae4c64c09..c942cc66812cb97b783abc6d03da28730f0dd030 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+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
index 54e9d8b6e633fb34bacb049c8d54587de0d1a2c9..f025890eb06c03d3ff98e5e90efc22847b5246e0 100644 (file)
@@ -389,7 +389,7 @@ grub_unicode_get_comb_type (grub_uint32_t c)
 
 #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))
@@ -527,7 +527,7 @@ static grub_ssize_t
 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,
@@ -767,7 +767,7 @@ static grub_ssize_t
 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,
@@ -1125,7 +1125,7 @@ grub_ssize_t
 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)
index cc85ad9ea1a5268c4f90bf88beb70f580630b196..58042404b7d01b209b35a2ee2d8186cea508d330 100644 (file)
@@ -228,8 +228,8 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen,
   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)
index 450fb508b814160404e443a9f0ba6abcb165794a..90f63f0da5718bb34911238d420fcb5cddccdea4 100644 (file)
@@ -51,7 +51,7 @@ grub_term_cursor_x (const struct grub_term_screen_geometry *geo)
   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)
 {
index bf970e91cc5aae3027ace33185392c9d5d9d8d1f..7b2b7bd330cc329ff75391aceab1305c03b2ca9b 100644 (file)
@@ -866,7 +866,7 @@ print_backlog (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);
index de5479a51acfb7a3cf47d75cd44b59b21d1d2031..dc0669b354d81d099c03fa9b8813a50f65c34aef 100644 (file)
@@ -138,7 +138,7 @@ static unsigned char calculate_character_width (struct grub_font_glyph *glyph);
 
 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);
 
@@ -956,7 +956,7 @@ calculate_character_width (struct grub_font_glyph *glyph)
          / 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)
 {
index d753fc184f032d09e3bf63446657c31b59fea6ff..c4ab193b3f44edb62ba2c07813ea73af9f49da40 100644 (file)
@@ -104,9 +104,9 @@ grub_ucs4_count_lines (const grub_uint32_t * str,
                       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);
index 9d755a965c0b99357281b6f7993fb811eb9ae058..e2110f39065b151094aafe13cf3221148c7cc870 100644 (file)
@@ -187,8 +187,8 @@ struct grub_term_output
 
   /* 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);
@@ -400,7 +400,7 @@ grub_term_cls (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
@@ -417,7 +417,7 @@ grub_unicode_estimate_width (const struct grub_unicode_glyph *c __attribute__ ((
 
 #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)
 {
index 07a2dec25f359ba863b77c373234e24dc73930af..17b6ca684155e4ea84c833006cf6bd0bd4990f8d 100644 (file)
@@ -253,7 +253,7 @@ grub_ssize_t
 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,