diff --git a/src/hb-fallback-shape.cc b/src/hb-fallback-shape.cc index 989596ee55b0f647879d72daf06df0df150ea9a7..bdc8a80c4bd0410cbd89dceaa272ef5ec97de5c5 100644 --- a/src/hb-fallback-shape.cc +++ b/src/hb-fallback-shape.cc @@ -35,13 +35,13 @@ struct hb_fallback_shaper_face_data_t {}; hb_fallback_shaper_face_data_t * -_hb_fallback_shaper_face_data_create (hb_face_t *face) +_hb_fallback_shaper_face_data_create (hb_face_t *face HB_UNUSED) { return (hb_fallback_shaper_face_data_t *) HB_SHAPER_DATA_SUCCEEDED; } void -_hb_fallback_shaper_face_data_destroy (hb_fallback_shaper_face_data_t *data) +_hb_fallback_shaper_face_data_destroy (hb_fallback_shaper_face_data_t *data HB_UNUSED) { } @@ -53,13 +53,13 @@ _hb_fallback_shaper_face_data_destroy (hb_fallback_shaper_face_data_t *data) struct hb_fallback_shaper_font_data_t {}; hb_fallback_shaper_font_data_t * -_hb_fallback_shaper_font_data_create (hb_font_t *font) +_hb_fallback_shaper_font_data_create (hb_font_t *font HB_UNUSED) { return (hb_fallback_shaper_font_data_t *) HB_SHAPER_DATA_SUCCEEDED; } void -_hb_fallback_shaper_font_data_destroy (hb_fallback_shaper_font_data_t *data) +_hb_fallback_shaper_font_data_destroy (hb_fallback_shaper_font_data_t *data HB_UNUSED) { } @@ -89,7 +89,7 @@ _hb_fallback_shaper_shape_plan_data_destroy (hb_fallback_shaper_shape_plan_data_ */ hb_bool_t -_hb_fallback_shape (hb_shape_plan_t *shape_plan, +_hb_fallback_shape (hb_shape_plan_t *shape_plan HB_UNUSED, hb_font_t *font, hb_buffer_t *buffer, const hb_feature_t *features HB_UNUSED, diff --git a/src/hb-glib.cc b/src/hb-glib.cc index 046275879890fc06bb4b7ca23ebe67e2cf3e3c31..676e6601628b0c75ce73e806d9fee4f2e6c47ef6 100644 --- a/src/hb-glib.cc +++ b/src/hb-glib.cc @@ -334,7 +334,7 @@ hb_glib_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED, } static unsigned int -hb_glib_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs, +hb_glib_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs HB_UNUSED, hb_codepoint_t u, hb_codepoint_t *decomposed, void *user_data HB_UNUSED) diff --git a/src/hb-icu-le.cc b/src/hb-icu-le.cc index 61099fedf74d6b038db8b2af6ded1c80525516a4..c05d330b9573294df8e9821145a724e8dba19c39 100644 --- a/src/hb-icu-le.cc +++ b/src/hb-icu-le.cc @@ -43,13 +43,13 @@ struct hb_icu_le_shaper_face_data_t {}; hb_icu_le_shaper_face_data_t * -_hb_icu_le_shaper_face_data_create (hb_face_t *face) +_hb_icu_le_shaper_face_data_create (hb_face_t *face HB_UNUSED) { return (hb_icu_le_shaper_face_data_t *) HB_SHAPER_DATA_SUCCEEDED; } void -_hb_icu_le_shaper_face_data_destroy (hb_icu_le_shaper_face_data_t *data) +_hb_icu_le_shaper_face_data_destroy (hb_icu_le_shaper_face_data_t *data HB_UNUSED) { } @@ -88,7 +88,7 @@ _hb_icu_le_shaper_font_data_destroy (hb_icu_le_shaper_font_data_t *data) struct hb_icu_le_shaper_shape_plan_data_t {}; hb_icu_le_shaper_shape_plan_data_t * -_hb_icu_le_shaper_shape_plan_data_create (hb_shape_plan_t *shape_plan, +_hb_icu_le_shaper_shape_plan_data_create (hb_shape_plan_t *shape_plan HB_UNUSED, const hb_feature_t *user_features, unsigned int num_user_features) { diff --git a/src/hb-old.cc b/src/hb-old.cc index 7c3e3702b4679763470594ab65524bc5b08dbaac..a7ea8ed9bbe837b83b352afcbfc50e042d240f30 100644 --- a/src/hb-old.cc +++ b/src/hb-old.cc @@ -110,7 +110,7 @@ hb_old_getGlyphAdvances (HB_Font old_font, const HB_Glyph *glyphs, hb_uint32 numGlyphs, HB_Fixed *advances, - int flags /*HB_ShaperFlag*/) + int flags /*HB_ShaperFlag*/ HB_UNUSED) { hb_font_t *font = (hb_font_t *) old_font->userData; @@ -251,15 +251,15 @@ _hb_old_shaper_font_data_destroy (hb_old_shaper_font_data_t *data) struct hb_old_shaper_shape_plan_data_t {}; hb_old_shaper_shape_plan_data_t * -_hb_old_shaper_shape_plan_data_create (hb_shape_plan_t *shape_plan, - const hb_feature_t *user_features, - unsigned int num_user_features) +_hb_old_shaper_shape_plan_data_create (hb_shape_plan_t *shape_plan HB_UNUSED, + const hb_feature_t *user_features HB_UNUSED, + unsigned int num_user_features HB_UNUSED) { return (hb_old_shaper_shape_plan_data_t *) HB_SHAPER_DATA_SUCCEEDED; } void -_hb_old_shaper_shape_plan_data_destroy (hb_old_shaper_shape_plan_data_t *data) +_hb_old_shaper_shape_plan_data_destroy (hb_old_shaper_shape_plan_data_t *data HB_UNUSED) { } @@ -269,7 +269,7 @@ _hb_old_shaper_shape_plan_data_destroy (hb_old_shaper_shape_plan_data_t *data) */ hb_bool_t -_hb_old_shape (hb_shape_plan_t *shape_plan, +_hb_old_shape (hb_shape_plan_t *shape_plan HB_UNUSED, hb_font_t *font, hb_buffer_t *buffer, const hb_feature_t *features, @@ -369,7 +369,7 @@ retry: *p = MIN (*p, buffer->info[i].cluster); } for (unsigned int i = 1; i < num_glyphs; i++) - if (vis_clusters[i] == -1) + if (vis_clusters[i] == (uint32_t) -1) vis_clusters[i] = vis_clusters[i - 1]; #undef utf16_index diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index 2372235a5ae109de363bf4b2cb932e755b11e34b..e57558ea3d6cd37cd05fce88e35e2d27eab8244e 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -180,9 +180,7 @@ struct hb_sanitize_context_t template inline return_t process (const T &obj) { return obj.sanitize (this); } static return_t default_return_value (void) { return true; } - bool stop_sublookup_iteration (const return_t r) const { return false; } - return_t recurse (unsigned int lookup_index) - { return default_return_value (); } + bool stop_sublookup_iteration (const return_t r HB_UNUSED) const { return false; } inline void init (hb_blob_t *b) { diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index d656999cde4a6a49d6ff3357a1d6affbe574e30e..87abd3b834ec0b3926dd33a020a782c3aa4f1c6f 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -62,7 +62,7 @@ struct hb_closure_context_t template inline return_t process (const T &obj) { obj.closure (this); return HB_VOID; } static return_t default_return_value (void) { return HB_VOID; } - bool stop_sublookup_iteration (const return_t r) const { return false; } + bool stop_sublookup_iteration (const return_t r HB_UNUSED) const { return false; } return_t recurse (unsigned int lookup_index) { if (unlikely (nesting_level_left == 0 || !recurse_func)) @@ -150,7 +150,7 @@ struct hb_collect_glyphs_context_t template inline return_t process (const T &obj) { obj.collect_glyphs (this); return HB_VOID; } static return_t default_return_value (void) { return HB_VOID; } - bool stop_sublookup_iteration (const return_t r) const { return false; } + bool stop_sublookup_iteration (const return_t r HB_UNUSED) const { return false; } return_t recurse (unsigned int lookup_index) { if (unlikely (nesting_level_left == 0 || !recurse_func)) @@ -549,7 +549,7 @@ static inline void collect_coverage (hb_set_t *glyphs, const USHORT &value, cons const OffsetTo &coverage = (const OffsetTo&)value; (data+coverage).add_coverage (glyphs); } -static inline void collect_array (hb_collect_glyphs_context_t *c, +static inline void collect_array (hb_collect_glyphs_context_t *c HB_UNUSED, hb_set_t *glyphs, unsigned int count, const USHORT values[], @@ -673,10 +673,10 @@ static inline bool match_input (hb_apply_context_t *c, } static inline void ligate_input (hb_apply_context_t *c, unsigned int count, /* Including the first glyph (not matched) */ - const USHORT input[], /* Array of input values--start with second glyph */ + const USHORT input[] HB_UNUSED, /* Array of input values--start with second glyph */ hb_codepoint_t lig_glyph, - match_func_t match_func, - const void *match_data, + match_func_t match_func HB_UNUSED, + const void *match_data HB_UNUSED, bool is_mark_ligature, unsigned int total_component_count) { @@ -939,8 +939,8 @@ static inline void context_collect_glyphs_lookup (hb_collect_glyphs_context_t *c static inline bool context_would_apply_lookup (hb_would_apply_context_t *c, unsigned int inputCount, /* Including the first glyph (not matched) */ const USHORT input[], /* Array of input values--start with second glyph */ - unsigned int lookupCount, - const LookupRecord lookupRecord[], + unsigned int lookupCount HB_UNUSED, + const LookupRecord lookupRecord[] HB_UNUSED, ContextApplyLookupContext &lookup_context) { return would_match_input (c, @@ -1454,13 +1454,13 @@ static inline void chain_context_collect_glyphs_lookup (hb_collect_glyphs_contex static inline bool chain_context_would_apply_lookup (hb_would_apply_context_t *c, unsigned int backtrackCount, - const USHORT backtrack[], + const USHORT backtrack[] HB_UNUSED, unsigned int inputCount, /* Including the first glyph (not matched) */ const USHORT input[], /* Array of input values--start with second glyph */ unsigned int lookaheadCount, - const USHORT lookahead[], - unsigned int lookupCount, - const LookupRecord lookupRecord[], + const USHORT lookahead[] HB_UNUSED, + unsigned int lookupCount HB_UNUSED, + const LookupRecord lookupRecord[] HB_UNUSED, ChainContextApplyLookupContext &lookup_context) { return (c->zero_context ? !backtrackCount && !lookaheadCount : true) diff --git a/src/hb-ot-shape-complex-arabic-fallback.hh b/src/hb-ot-shape-complex-arabic-fallback.hh index bf68561e16191f4a543ebffa790b7fd81efa83f9..4fcd0a2fd94e4e3f5457caef1545907b313ac8ed 100644 --- a/src/hb-ot-shape-complex-arabic-fallback.hh +++ b/src/hb-ot-shape-complex-arabic-fallback.hh @@ -53,7 +53,7 @@ enum { }; static OT::SubstLookup * -arabic_fallback_synthesize_lookup_single (const hb_ot_shape_plan_t *plan, +arabic_fallback_synthesize_lookup_single (const hb_ot_shape_plan_t *plan HB_UNUSED, hb_font_t *font, unsigned int feature_index) { @@ -103,7 +103,7 @@ arabic_fallback_synthesize_lookup_single (const hb_ot_shape_plan_t *plan, } static OT::SubstLookup * -arabic_fallback_synthesize_lookup_ligature (const hb_ot_shape_plan_t *plan, +arabic_fallback_synthesize_lookup_ligature (const hb_ot_shape_plan_t *plan HB_UNUSED, hb_font_t *font) { OT::GlyphID first_glyphs[ARRAY_LENGTH_CONST (ligature_table)]; diff --git a/src/hb-ot-shape-complex-arabic.cc b/src/hb-ot-shape-complex-arabic.cc index e9db005455fbf896ceed1b3f6d1ae6541f15ddb2..35356fe97d3cce86de2c4a21e8b78975c8c9b19e 100644 --- a/src/hb-ot-shape-complex-arabic.cc +++ b/src/hb-ot-shape-complex-arabic.cc @@ -305,7 +305,7 @@ arabic_joining (hb_buffer_t *buffer) static void setup_masks_arabic (const hb_ot_shape_plan_t *plan, hb_buffer_t *buffer, - hb_font_t *font) + hb_font_t *font HB_UNUSED) { const arabic_shape_plan_t *arabic_plan = (const arabic_shape_plan_t *) plan->data; diff --git a/src/hb-ot-shape-complex-indic-machine.hh b/src/hb-ot-shape-complex-indic-machine.hh index 1c0e7f224c1fb02acdb297b685487554100a2ba4..f97ec52e688168f13f112bbe2cd23360ee2980ec 100644 --- a/src/hb-ot-shape-complex-indic-machine.hh +++ b/src/hb-ot-shape-complex-indic-machine.hh @@ -1153,7 +1153,7 @@ static const int indic_syllable_machine_en_main = 143; static void find_syllables (hb_buffer_t *buffer) { - unsigned int p, pe, eof, ts, te, act; + unsigned int p, pe, eof, ts HB_UNUSED, te, act; int cs; hb_glyph_info_t *info = buffer->info; diff --git a/src/hb-ot-shape-complex-indic-machine.rl b/src/hb-ot-shape-complex-indic-machine.rl index a536da55cff7c6aa679505b54fa9b0dfa62889c5..5c73ebf7ea4c1f741c326cad3b467def160387a1 100644 --- a/src/hb-ot-shape-complex-indic-machine.rl +++ b/src/hb-ot-shape-complex-indic-machine.rl @@ -103,7 +103,7 @@ main := |* static void find_syllables (hb_buffer_t *buffer) { - unsigned int p, pe, eof, ts, te, act; + unsigned int p, pe, eof, ts HB_UNUSED, te, act; int cs; hb_glyph_info_t *info = buffer->info; %%{ diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index d924d1a5a9221f0f3419b2158bc65ca4216d54ba..466c18439ce1515f64b5fe69eddcc1e3e29d0c43 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -852,7 +852,7 @@ initial_reordering_syllable (const hb_ot_shape_plan_t *plan, } static inline void -insert_dotted_circles (const hb_ot_shape_plan_t *plan, +insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED, hb_font_t *font, hb_buffer_t *buffer) { @@ -1246,7 +1246,7 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan, static void final_reordering (const hb_ot_shape_plan_t *plan, - hb_font_t *font, + hb_font_t *font HB_UNUSED, hb_buffer_t *buffer) { unsigned int count = buffer->len; @@ -1273,7 +1273,7 @@ final_reordering (const hb_ot_shape_plan_t *plan, static hb_ot_shape_normalization_mode_t -normalization_preference_indic (const hb_segment_properties_t *props) +normalization_preference_indic (const hb_segment_properties_t *props HB_UNUSED) { return HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT; } diff --git a/src/hb-ot-shape-complex-thai.cc b/src/hb-ot-shape-complex-thai.cc index 07608918110204f73d8cfbb0509c4fe3244b752b..24d476a0ba305f01c6c991e8446df356a26ea08a 100644 --- a/src/hb-ot-shape-complex-thai.cc +++ b/src/hb-ot-shape-complex-thai.cc @@ -215,7 +215,7 @@ static const struct thai_below_state_machine_edge_t { static void -do_thai_pua_shaping (const hb_ot_shape_plan_t *plan, +do_thai_pua_shaping (const hb_ot_shape_plan_t *plan HB_UNUSED, hb_buffer_t *buffer, hb_font_t *font) { diff --git a/src/hb-ot-shape-fallback.cc b/src/hb-ot-shape-fallback.cc index f4463e4eeca3b87e7f30278f95ed9a8876d30433..6f3426e6b490d12de6869ecf2f5cebde0a1dd706 100644 --- a/src/hb-ot-shape-fallback.cc +++ b/src/hb-ot-shape-fallback.cc @@ -161,8 +161,8 @@ recategorize_combining_class (hb_codepoint_t u, } void -_hb_ot_shape_fallback_position_recategorize_marks (const hb_ot_shape_plan_t *plan, - hb_font_t *font, +_hb_ot_shape_fallback_position_recategorize_marks (const hb_ot_shape_plan_t *plan HB_UNUSED, + hb_font_t *font HB_UNUSED, hb_buffer_t *buffer) { unsigned int count = buffer->len; diff --git a/src/hb-private.hh b/src/hb-private.hh index 7824956e380faa744c6793ae12d8e71b23d36aa0..2fee6f8a4ac6643c63a78e44bf5090ae8024b28c 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -82,7 +82,7 @@ static inline Type MAX (const Type &a, const Type &b) { return a > b ? a : b; } #undef ARRAY_LENGTH template -static inline unsigned int ARRAY_LENGTH (const Type (&a)[n]) { return n; } +static inline unsigned int ARRAY_LENGTH (const Type (&)[n]) { return n; } /* A const version, but does not detect erratically being called on pointers. */ #define ARRAY_LENGTH_CONST(__array) ((signed int) (sizeof (__array) / sizeof (__array[0]))) @@ -680,7 +680,7 @@ struct hb_printer_t { template <> struct hb_printer_t { - const char *print (hb_void_t v) { return ""; } + const char *print (hb_void_t) { return ""; } }; @@ -696,7 +696,7 @@ static inline void _hb_warn_no_return (bool returned) } } template <> -inline void _hb_warn_no_return (bool returned) +inline void _hb_warn_no_return (bool returned HB_UNUSED) {} template @@ -755,7 +755,7 @@ struct hb_auto_trace_t<0, ret_t> { const char *message HB_UNUSED, ...) {} - inline ret_t ret (ret_t v, unsigned int line = 0) { return v; } + inline ret_t ret (ret_t v, unsigned int line HB_UNUSED = 0) { return v; } }; #define TRACE_RETURN(RET) trace.ret (RET, __LINE__) diff --git a/src/hb-ucdn.cc b/src/hb-ucdn.cc index 35063043fd6cd6b9f8fdd46808245b391685b154..61e6ad362298d076b1257de0e1b4036d954af23a 100644 --- a/src/hb-ucdn.cc +++ b/src/hb-ucdn.cc @@ -129,57 +129,60 @@ static const hb_script_t ucdn_script_translate[] = static hb_unicode_combining_class_t hb_ucdn_combining_class(hb_unicode_funcs_t *ufuncs, hb_codepoint_t unicode, - void *user_data) + void *user_data HB_UNUSED) { return (hb_unicode_combining_class_t) ucdn_get_combining_class(unicode); } static unsigned int hb_ucdn_eastasian_width(hb_unicode_funcs_t *ufuncs, hb_codepoint_t unicode, - void *user_data) + void *user_data HB_UNUSED) { int w = ucdn_get_east_asian_width(unicode); return (w == UCDN_EAST_ASIAN_F || w == UCDN_EAST_ASIAN_W) ? 2 : 1; } static hb_unicode_general_category_t -hb_ucdn_general_category(hb_unicode_funcs_t *ufuncs, - hb_codepoint_t unicode, void *user_data) +hb_ucdn_general_category(hb_unicode_funcs_t *ufuncs, hb_codepoint_t unicode, + void *user_data HB_UNUSED) { return (hb_unicode_general_category_t)ucdn_get_general_category(unicode); } static hb_codepoint_t hb_ucdn_mirroring(hb_unicode_funcs_t *ufuncs, hb_codepoint_t unicode, - void *user_data) + void *user_data HB_UNUSED) { return ucdn_mirror(unicode); } static hb_script_t hb_ucdn_script(hb_unicode_funcs_t *ufuncs, hb_codepoint_t unicode, - void *user_data) + void *user_data HB_UNUSED) { return ucdn_script_translate[ucdn_get_script(unicode)]; } static hb_bool_t -hb_ucdn_compose(hb_unicode_funcs_t *ufuncs, hb_codepoint_t a, - hb_codepoint_t b, hb_codepoint_t *ab, void *user_data) +hb_ucdn_compose(hb_unicode_funcs_t *ufuncs, + hb_codepoint_t a, hb_codepoint_t b, hb_codepoint_t *ab, + void *user_data HB_UNUSED) { return ucdn_compose(ab, a, b); } static hb_bool_t -hb_ucdn_decompose(hb_unicode_funcs_t *ufuncs, hb_codepoint_t ab, - hb_codepoint_t *a, hb_codepoint_t *b, void *user_data) +hb_ucdn_decompose(hb_unicode_funcs_t *ufuncs, + hb_codepoint_t ab, hb_codepoint_t *a, hb_codepoint_t *b, + void *user_data HB_UNUSED) { return ucdn_decompose(ab, a, b); } static unsigned int -hb_ucdn_decompose_compatibility(hb_unicode_funcs_t *ufuncs, hb_codepoint_t u, - hb_codepoint_t *decomposed, void *user_data) +hb_ucdn_decompose_compatibility(hb_unicode_funcs_t *ufuncs, + hb_codepoint_t u, hb_codepoint_t *decomposed, + void *user_data HB_UNUSED) { return ucdn_compat_decompose(u, decomposed); } diff --git a/src/hb-utf-private.hh b/src/hb-utf-private.hh index ae36ef864e69b52dc98e8e762bf042dd196a5d29..b9a6519d28e0d13b133feea8a61fdd93ebd50d8b 100644 --- a/src/hb-utf-private.hh +++ b/src/hb-utf-private.hh @@ -176,7 +176,7 @@ hb_utf_strlen (const uint16_t *text) static inline const uint32_t * hb_utf_next (const uint32_t *text, - const uint32_t *end, + const uint32_t *end HB_UNUSED, hb_codepoint_t *unicode) { *unicode = *text++; @@ -185,7 +185,7 @@ hb_utf_next (const uint32_t *text, static inline const uint32_t * hb_utf_prev (const uint32_t *text, - const uint32_t *start, + const uint32_t *start HB_UNUSED, hb_codepoint_t *unicode) { *unicode = *--text;