提交 0beb66e3 编写于 作者: B Behdad Esfahbod

Fix warnings

上级 c6408a10
......@@ -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,
......
......@@ -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)
......
......@@ -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)
{
......
......@@ -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
......
......@@ -180,9 +180,7 @@ struct hb_sanitize_context_t
template <typename T>
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)
{
......
......@@ -62,7 +62,7 @@ struct hb_closure_context_t
template <typename T>
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 <typename T>
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> &coverage = (const OffsetTo<Coverage>&)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)
......
......@@ -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)];
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
%%{
......
......@@ -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;
}
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -82,7 +82,7 @@ static inline Type MAX (const Type &a, const Type &b) { return a > b ? a : b; }
#undef ARRAY_LENGTH
template <typename Type, unsigned int n>
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<bool> {
template <>
struct hb_printer_t<hb_void_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<hb_void_t> (bool returned)
inline void _hb_warn_no_return<hb_void_t> (bool returned HB_UNUSED)
{}
template <int max_level, typename ret_t>
......@@ -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__)
......
......@@ -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);
}
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册