]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/grub-mkfont.c (write_font_pf2): Use appropriate type for data
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 12 Jan 2011 11:49:16 +0000 (12:49 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 12 Jan 2011 11:49:16 +0000 (12:49 +0100)
variable. Fixes problem on big endian platforms.

ChangeLog
util/grub-mkfont.c

index 915fd2619183672811e75bbffc403731168de215..254fc2c6f1eb53b0e901a93364e78a699c0a8a61 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-12  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * util/grub-mkfont.c (write_font_pf2): Use appropriate type for data
+       variable. Fixes problem on big endian platforms.
+
 2011-01-12  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/Makefile.core.def (ieee1275_fb): Disable on sparc.
index 983ac7065d38f61b13319b63e23544f766d31987..3108d4694462156cd411a61af4195d3ed5d057fb 100644 (file)
@@ -859,7 +859,7 @@ void
 write_font_pf2 (struct grub_font_info *font_info, char *output_file)
 {
   FILE *file;
-  grub_uint32_t leng, data;
+  grub_uint32_t leng;
   char style_name[20], *font_name;
   int offset;
   struct grub_glyph_info *cur;
@@ -959,12 +959,14 @@ write_font_pf2 (struct grub_font_info *font_info, char *output_file)
   for (cur = font_info->glyphs_sorted;
        cur < font_info->glyphs_sorted + font_info->num_glyphs; cur++)
     {
-      data = grub_cpu_to_be32 (cur->char_code);
-      grub_util_write_image ((char *) &data, 4, file);
-      data = 0;
-      grub_util_write_image ((char *) &data, 1, file);
-      data = grub_cpu_to_be32 (offset);
-      grub_util_write_image ((char *) &data, 4, file);
+      grub_uint32_t data32;
+      grub_uint8_t data8;
+      data32 = grub_cpu_to_be32 (cur->char_code);
+      grub_util_write_image ((char *) &data32, 4, file);
+      data8 = 0;
+      grub_util_write_image ((char *) &data8, 1, file);
+      data32 = grub_cpu_to_be32 (offset);
+      grub_util_write_image ((char *) &data32, 4, file);
       offset += 10 + cur->bitmap_size;
     }
 
@@ -976,6 +978,7 @@ write_font_pf2 (struct grub_font_info *font_info, char *output_file)
   for (cur = font_info->glyphs_sorted;
        cur < font_info->glyphs_sorted + font_info->num_glyphs; cur++)
     {
+      grub_uint16_t data;
       data = grub_cpu_to_be16 (cur->width);
       grub_util_write_image ((char *) &data, 2, file);
       data = grub_cpu_to_be16 (cur->height);