From 1d720192b193f48b44be0385eda3c2c5d5cd28ad Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 23 Apr 2010 14:39:10 -0400 Subject: [PATCH] Fix compile warnings (HB_GNUC_UNUSED) --- src/hb-buffer.c | 6 +++--- src/hb-font.cc | 31 ++++++++++++++++++++++--------- src/hb-ft.c | 29 +++++++++++++++++++++-------- src/hb-open-type-private.hh | 2 +- src/hb-unicode.c | 8 ++++---- 5 files changed, 51 insertions(+), 25 deletions(-) diff --git a/src/hb-buffer.c b/src/hb-buffer.c index ac6b47d..777ee7f 100644 --- a/src/hb-buffer.c +++ b/src/hb-buffer.c @@ -594,7 +594,7 @@ hb_utf8_next (const uint8_t *text, void hb_buffer_add_utf8 (hb_buffer_t *buffer, const char *text, - unsigned int text_length, + unsigned int text_length HB_GNUC_UNUSED, unsigned int item_offset, unsigned int item_length) { @@ -628,7 +628,7 @@ hb_utf16_next (const uint16_t *text, void hb_buffer_add_utf16 (hb_buffer_t *buffer, const uint16_t *text, - unsigned int text_length, + unsigned int text_length HB_GNUC_UNUSED, unsigned int item_offset, unsigned int item_length) { @@ -640,7 +640,7 @@ hb_buffer_add_utf16 (hb_buffer_t *buffer, void hb_buffer_add_utf32 (hb_buffer_t *buffer, const uint32_t *text, - unsigned int text_length, + unsigned int text_length HB_GNUC_UNUSED, unsigned int item_offset, unsigned int item_length) { diff --git a/src/hb-font.cc b/src/hb-font.cc index e1b0b87..9c33d97 100644 --- a/src/hb-font.cc +++ b/src/hb-font.cc @@ -40,24 +40,37 @@ */ static hb_codepoint_t -hb_font_get_glyph_nil (hb_font_t *font, hb_face_t *face, const void *user_data, - hb_codepoint_t unicode, hb_codepoint_t variation_selector) +hb_font_get_glyph_nil (hb_font_t *font HB_GNUC_UNUSED, + hb_face_t *face HB_GNUC_UNUSED, + const void *user_data HB_GNUC_UNUSED, + hb_codepoint_t unicode HB_GNUC_UNUSED, + hb_codepoint_t variation_selector HB_GNUC_UNUSED) { return 0; } static hb_bool_t -hb_font_get_contour_point_nil (hb_font_t *font, hb_face_t *face, const void *user_data, - unsigned int point_index, - hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y) +hb_font_get_contour_point_nil (hb_font_t *font HB_GNUC_UNUSED, + hb_face_t *face HB_GNUC_UNUSED, + const void *user_data HB_GNUC_UNUSED, + unsigned int point_index HB_GNUC_UNUSED, + hb_codepoint_t glyph HB_GNUC_UNUSED, + hb_position_t *x HB_GNUC_UNUSED, + hb_position_t *y HB_GNUC_UNUSED) { return false; } static void -hb_font_get_glyph_metrics_nil (hb_font_t *font, hb_face_t *face, const void *user_data, - hb_codepoint_t glyph, hb_glyph_metrics_t *metrics) +hb_font_get_glyph_metrics_nil (hb_font_t *font HB_GNUC_UNUSED, + hb_face_t *face HB_GNUC_UNUSED, + const void *user_data HB_GNUC_UNUSED, + hb_codepoint_t glyph HB_GNUC_UNUSED, + hb_glyph_metrics_t *metrics) { memset (metrics, 0, sizeof (*metrics)); } static hb_position_t -hb_font_get_kerning_nil (hb_font_t *font, hb_face_t *face, const void *user_data, - hb_codepoint_t first_glyph, hb_codepoint_t second_glyph) +hb_font_get_kerning_nil (hb_font_t *font HB_GNUC_UNUSED, + hb_face_t *face HB_GNUC_UNUSED, + const void *user_data HB_GNUC_UNUSED, + hb_codepoint_t first_glyph HB_GNUC_UNUSED, + hb_codepoint_t second_glyph HB_GNUC_UNUSED) { return 0; } hb_font_funcs_t _hb_font_funcs_nil = { diff --git a/src/hb-ft.c b/src/hb-ft.c index 18b6e0b..79e1084 100644 --- a/src/hb-ft.c +++ b/src/hb-ft.c @@ -34,8 +34,11 @@ #include FT_TRUETYPE_TABLES_H static hb_codepoint_t -hb_ft_get_glyph (hb_font_t *font, hb_face_t *face, const void *user_data, - hb_codepoint_t unicode, hb_codepoint_t variation_selector) +hb_ft_get_glyph (hb_font_t *font HB_GNUC_UNUSED, + hb_face_t *face HB_GNUC_UNUSED, + const void *user_data, + hb_codepoint_t unicode, + hb_codepoint_t variation_selector) { FT_Face ft_face = (FT_Face) user_data; @@ -51,9 +54,13 @@ hb_ft_get_glyph (hb_font_t *font, hb_face_t *face, const void *user_data, } static hb_bool_t -hb_ft_get_contour_point (hb_font_t *font, hb_face_t *face, const void *user_data, +hb_ft_get_contour_point (hb_font_t *font HB_GNUC_UNUSED, + hb_face_t *face HB_GNUC_UNUSED, + const void *user_data, unsigned int point_index, - hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y) + hb_codepoint_t glyph, + hb_position_t *x, + hb_position_t *y) { FT_Face ft_face = (FT_Face) user_data; int load_flags = FT_LOAD_DEFAULT; @@ -76,8 +83,11 @@ hb_ft_get_contour_point (hb_font_t *font, hb_face_t *face, const void *user_data } static void -hb_ft_get_glyph_metrics (hb_font_t *font, hb_face_t *face, const void *user_data, - hb_codepoint_t glyph, hb_glyph_metrics_t *metrics) +hb_ft_get_glyph_metrics (hb_font_t *font HB_GNUC_UNUSED, + hb_face_t *face HB_GNUC_UNUSED, + const void *user_data, + hb_codepoint_t glyph, + hb_glyph_metrics_t *metrics) { FT_Face ft_face = (FT_Face) user_data; int load_flags = FT_LOAD_DEFAULT; @@ -100,8 +110,11 @@ hb_ft_get_glyph_metrics (hb_font_t *font, hb_face_t *face, const void *user_data } static hb_position_t -hb_ft_get_kerning (hb_font_t *font, hb_face_t *face, const void *user_data, - hb_codepoint_t first_glyph, hb_codepoint_t second_glyph) +hb_ft_get_kerning (hb_font_t *font HB_GNUC_UNUSED, + hb_face_t *face HB_GNUC_UNUSED, + const void *user_data, + hb_codepoint_t first_glyph, + hb_codepoint_t second_glyph) { FT_Face ft_face = (FT_Face) user_data; FT_Vector kerning; diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index 6ec22f5..d7354be 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -186,7 +186,7 @@ _hb_sanitize_init (hb_sanitize_context_t *context, } static HB_GNUC_UNUSED void -_hb_sanitize_fini (hb_sanitize_context_t *context, +_hb_sanitize_fini (hb_sanitize_context_t *context HB_GNUC_UNUSED, hb_blob_t *blob) { #if HB_DEBUG_SANITIZE diff --git a/src/hb-unicode.c b/src/hb-unicode.c index e155d6d..b6bd4ba 100644 --- a/src/hb-unicode.c +++ b/src/hb-unicode.c @@ -33,10 +33,10 @@ */ static hb_codepoint_t hb_unicode_get_mirroring_nil (hb_codepoint_t unicode) { return unicode; } -static hb_category_t hb_unicode_get_general_category_nil (hb_codepoint_t unicode) { return HB_CATEGORY_OTHER_LETTER; } -static hb_script_t hb_unicode_get_script_nil (hb_codepoint_t unicode) { return HB_SCRIPT_UNKNOWN; } -static unsigned int hb_unicode_get_combining_class_nil (hb_codepoint_t unicode) { return 0; } -static unsigned int hb_unicode_get_eastasian_width_nil (hb_codepoint_t unicode) { return 1; } +static hb_category_t hb_unicode_get_general_category_nil (hb_codepoint_t unicode HB_GNUC_UNUSED) { return HB_CATEGORY_OTHER_LETTER; } +static hb_script_t hb_unicode_get_script_nil (hb_codepoint_t unicode HB_GNUC_UNUSED) { return HB_SCRIPT_UNKNOWN; } +static unsigned int hb_unicode_get_combining_class_nil (hb_codepoint_t unicode HB_GNUC_UNUSED) { return 0; } +static unsigned int hb_unicode_get_eastasian_width_nil (hb_codepoint_t unicode HB_GNUC_UNUSED) { return 1; } hb_unicode_funcs_t _hb_unicode_funcs_nil = { HB_REFERENCE_COUNT_INVALID, /* ref_count */ -- 2.7.4