]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/font/font.c, include/grub/font.h: Inline simple font
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 30 May 2013 19:58:24 +0000 (21:58 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 30 May 2013 19:58:24 +0000 (21:58 +0200)
functions.

ChangeLog
grub-core/font/font.c
include/grub/font.h

index fae4b6c197c706bc1c57dfb9cfcfe57b1cfc3e88..e3bbe35fa66d67951d3c17ae25ee25f59375f15d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-05-30  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/font/font.c, include/grub/font.h: Inline simple font
+       functions.
+
 2013-05-30  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/Makefile.am: Fix compilation problem with some
index 3a380b9a9038b2a7f199c3857ff63eef65db7060..481c958ef6d36e5d5c44d9903a84ddb7822e162a 100644 (file)
@@ -55,23 +55,6 @@ struct char_index_entry
 #define FONT_WEIGHT_BOLD 200
 #define ASCII_BITMAP_SIZE 16
 
-struct grub_font
-{
-  char *name;
-  grub_file_t file;
-  char *family;
-  short point_size;
-  short weight;
-  short max_char_width;
-  short max_char_height;
-  short ascent;
-  short descent;
-  short leading;
-  grub_uint32_t num_chars;
-  struct char_index_entry *char_index;
-  grub_uint16_t *bmp_idx;
-};
-
 /* Definition of font registry.  */
 struct grub_font_node *grub_font_list;
 
@@ -909,20 +892,6 @@ grub_font_get_max_char_width (grub_font_t font)
   return font->max_char_width;
 }
 
-/* Get the maximum height of any character in the font in pixels.  */
-int
-grub_font_get_max_char_height (grub_font_t font)
-{
-  return font->max_char_height;
-}
-
-/* Get the distance in pixels from the top of characters to the baseline.  */
-int
-grub_font_get_ascent (grub_font_t font)
-{
-  return font->ascent;
-}
-
 /* Get the distance in pixels from the baseline to the lowest descenders
    (for instance, in a lowercase 'y', 'g', etc.).  */
 int
index aed7e1c2beb4bfa7c8b8363c6218f176b08d70c5..708fa42aca942d376e0ca7ef430e125d23094289 100644 (file)
 /* Forward declaration of opaque structure grub_font.
    Users only pass struct grub_font pointers to the font module functions,
    and do not have knowledge of the structure contents.  */
-struct grub_font;
+/* Full structure was moved here for inline function but still
+   shouldn't be used directly.
+ */
+struct grub_font
+{
+  char *name;
+  grub_file_t file;
+  char *family;
+  short point_size;
+  short weight;
+  short max_char_width;
+  short max_char_height;
+  short ascent;
+  short descent;
+  short leading;
+  grub_uint32_t num_chars;
+  struct char_index_entry *char_index;
+  grub_uint16_t *bmp_idx;
+};
 
 /* Font type used to access font functions.  */
 typedef struct grub_font *grub_font_t;
@@ -93,9 +111,19 @@ const char *EXPORT_FUNC (grub_font_get_name) (grub_font_t font);
 
 int EXPORT_FUNC (grub_font_get_max_char_width) (grub_font_t font);
 
-int EXPORT_FUNC (grub_font_get_max_char_height) (grub_font_t font);
+/* Get the maximum height of any character in the font in pixels.  */
+static inline int
+grub_font_get_max_char_height (grub_font_t font)
+{
+  return font->max_char_height;
+}
 
-int EXPORT_FUNC (grub_font_get_ascent) (grub_font_t font);
+/* Get the distance in pixels from the top of characters to the baseline.  */
+static inline int
+grub_font_get_ascent (grub_font_t font)
+{
+  return font->ascent;
+}
 
 int EXPORT_FUNC (grub_font_get_descent) (grub_font_t font);