From 70e4c4974bf1c4f396662dd4a9adf5a6b004a269 Mon Sep 17 00:00:00 2001 From: Patrick McCarty Date: Sun, 28 Mar 2010 19:02:24 -0700 Subject: [PATCH] Use the FT_Error type when appropriate. --- lily/freetype-error.cc | 4 ++-- lily/freetype.cc | 2 +- lily/open-type-font.cc | 8 ++++---- lily/pango-font.cc | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lily/freetype-error.cc b/lily/freetype-error.cc index 1f4dc46818..cfdab411de 100644 --- a/lily/freetype-error.cc +++ b/lily/freetype-error.cc @@ -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 -freetype_error_string (int code) +freetype_error_string (FT_Error code) { for (Freetype_error_message const *p = ft_errors; p->err_msg; p ++) diff --git a/lily/freetype.cc b/lily/freetype.cc index fd43ac112d..1f5d834c1a 100644 --- a/lily/freetype.cc +++ b/lily/freetype.cc @@ -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"); } diff --git a/lily/open-type-font.cc b/lily/open-type-font.cc index 741f9741fa..6cf74243eb 100644 --- a/lily/open-type-font.cc +++ b/lily/open-type-font.cc @@ -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 ())); diff --git a/lily/pango-font.cc b/lily/pango-font.cc index ac361794e7..e9fb2e8fda 100644 --- a/lily/pango-font.cc +++ b/lily/pango-font.cc @@ -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", -- 2.39.2