]> git.donarmstrong.com Git - lilypond.git/commitdiff
Use the FT_Error type when appropriate.
authorPatrick McCarty <pnorcks@gmail.com>
Mon, 29 Mar 2010 02:02:24 +0000 (19:02 -0700)
committerPatrick McCarty <pnorcks@gmail.com>
Wed, 31 Mar 2010 08:43:10 +0000 (01:43 -0700)
lily/freetype-error.cc
lily/freetype.cc
lily/open-type-font.cc
lily/pango-font.cc

index 1f4dc468181fce0063a4a883fe511cd4696ae005..cfdab411ded42de438961193098dce85d79ca61c 100644 (file)
@@ -27,7 +27,7 @@
                                                                          
 const struct Freetype_error_message
 {                                                               
-  int          err_code;                                        
+  FT_Error     err_code;                                        
   const char*  err_msg;
 } ft_errors[] =                                                 
                                                                          
@@ -39,7 +39,7 @@ const struct Freetype_error_message
 #include <string>
 
 string
-freetype_error_string (int code)
+freetype_error_string (FT_Error code)
 {
   for (Freetype_error_message const *p = ft_errors;
        p->err_msg; p ++)
index fd43ac112d73546eec24b192d1eafe8b394dc738..1f5d834c1a192d12633d4db42b210a871e4354b8 100644 (file)
@@ -25,7 +25,7 @@ FT_Library freetype2_library;
 void
 init_freetype ()
 {
-  int errorcode = FT_Init_FreeType (&freetype2_library);
+  FT_Error errorcode = FT_Init_FreeType (&freetype2_library);
   if (errorcode)
     error ("cannot initialize FreeType");
 }
index 741f9741faefeeaa45ff2b590f6db73d01900cc6..6cf74243ebd2fa1de4a691524ecde7f24561c1b9 100644 (file)
@@ -36,7 +36,7 @@ load_table (char const *tag_str, FT_Face face, FT_ULong *length)
   *length = 0;
   FT_ULong tag = FT_MAKE_TAG (tag_str[0], tag_str[1], tag_str[2], tag_str[3]);
 
-  int error_code = FT_Load_Sfnt_Table (face, tag, 0, NULL, length);
+  FT_Error error_code = FT_Load_Sfnt_Table (face, tag, 0, NULL, length);
   if (!error_code)
     {
       FT_Byte *buffer = (FT_Byte *) malloc (*length);
@@ -105,7 +105,7 @@ FT_Face
 open_ft_face (string str, FT_Long idx)
 {
   FT_Face face;
-  int error_code = FT_New_Face (freetype2_library, str.c_str (), idx, &face);
+  FT_Error error_code = FT_New_Face (freetype2_library, str.c_str (), idx, &face);
 
   if (error_code == FT_Err_Unknown_File_Format)
     error (_f ("unsupported font format: %s", str.c_str ()));
@@ -182,7 +182,7 @@ Open_type_font::get_indexed_char_dimensions (size_t signed_idx) const
     {
       const size_t len = 256;
       char name[len];
-      size_t code = FT_Get_Glyph_Name (face_, signed_idx, name, len);
+      FT_Error code = FT_Get_Glyph_Name (face_, signed_idx, name, len);
       if (code)
        warning (_f ("FT_Get_Glyph_Name () Freetype error: %s",
                     freetype_error_string (code)));
@@ -315,7 +315,7 @@ Open_type_font::glyph_list () const
     {
       const size_t len = 256;
       char name[len];
-      size_t code = FT_Get_Glyph_Name (face_, i, name, len);
+      FT_Error code = FT_Get_Glyph_Name (face_, i, name, len);
       if (code)
        warning (_f ("FT_Get_Glyph_Name () error: %s",
                     freetype_error_string (code).c_str ()));
index ac361794e7518a1d570820d69e282e7fc2b99d07..e9fb2e8fda4b4d1f20426e4cda4a74ee5f3566da 100644 (file)
@@ -180,8 +180,8 @@ Pango_font::pango_item_string_stencil (PangoGlyphItem const *glyph_item) const
       glyph_name[0] = '\0';
       if (has_glyph_names)
        {
-         int errorcode = FT_Get_Glyph_Name (ftface, pg, glyph_name,
-                                            GLYPH_NAME_LEN);
+         FT_Error errorcode = FT_Get_Glyph_Name (ftface, pg, glyph_name,
+                                                 GLYPH_NAME_LEN);
          if (errorcode)
            programming_error (
              _f ("FT_Get_Glyph_Name () error: %s",