Fix compiler warnings with -pedantic

pull/1/head
Behdad Esfahbod 14 years ago
parent 970e092dc2
commit b9452bfc16
  1. 18
      src/hb-blob.cc
  2. 20
      src/hb-glib.cc
  3. 20
      src/hb-icu.cc
  4. 2
      src/hb-object-private.hh
  5. 14
      src/hb-open-type-private.hh
  6. 2
      src/hb-ot-layout-gdef-private.hh
  7. 2
      src/hb-ot-layout.cc
  8. 2
      src/hb-ot-map-private.hh
  9. 8
      src/hb-ot-shape-complex-indic.cc
  10. 2
      src/hb-ot-shape-private.hh
  11. 2
      src/hb-ot-shape.cc

@ -244,22 +244,22 @@ _try_make_writable_inplace_unix (hb_blob_t *blob)
if ((uintptr_t) -1L == pagesize) { if ((uintptr_t) -1L == pagesize) {
(void) (HB_DEBUG_BLOB && (void) (HB_DEBUG_BLOB &&
fprintf (stderr, "%p %s: failed to get pagesize: %s\n", blob, HB_FUNC, strerror (errno))); fprintf (stderr, "%p %s: failed to get pagesize: %s\n", (void *) blob, HB_FUNC, strerror (errno)));
return FALSE; return FALSE;
} }
(void) (HB_DEBUG_BLOB && (void) (HB_DEBUG_BLOB &&
fprintf (stderr, "%p %s: pagesize is %lu\n", blob, HB_FUNC, (unsigned long) pagesize)); fprintf (stderr, "%p %s: pagesize is %lu\n", (void *) blob, HB_FUNC, (unsigned long) pagesize));
mask = ~(pagesize-1); mask = ~(pagesize-1);
addr = (const char *) (((uintptr_t) blob->data) & mask); addr = (const char *) (((uintptr_t) blob->data) & mask);
length = (const char *) (((uintptr_t) blob->data + blob->length + pagesize-1) & mask) - addr; length = (const char *) (((uintptr_t) blob->data + blob->length + pagesize-1) & mask) - addr;
(void) (HB_DEBUG_BLOB && (void) (HB_DEBUG_BLOB &&
fprintf (stderr, "%p %s: calling mprotect on [%p..%p] (%lu bytes)\n", fprintf (stderr, "%p %s: calling mprotect on [%p..%p] (%lu bytes)\n",
blob, HB_FUNC, (void *) blob, HB_FUNC,
addr, addr+length, (unsigned long) length)); addr, addr+length, (unsigned long) length));
if (-1 == mprotect ((void *) addr, length, PROT_READ | PROT_WRITE)) { if (-1 == mprotect ((void *) addr, length, PROT_READ | PROT_WRITE)) {
(void) (HB_DEBUG_BLOB && (void) (HB_DEBUG_BLOB &&
fprintf (stderr, "%p %s: %s\n", blob, HB_FUNC, strerror (errno))); fprintf (stderr, "%p %s: %s\n", (void *) blob, HB_FUNC, strerror (errno)));
return FALSE; return FALSE;
} }
@ -267,7 +267,7 @@ _try_make_writable_inplace_unix (hb_blob_t *blob)
(void) (HB_DEBUG_BLOB && (void) (HB_DEBUG_BLOB &&
fprintf (stderr, "%p %s: successfully made [%p..%p] (%lu bytes) writable\n", fprintf (stderr, "%p %s: successfully made [%p..%p] (%lu bytes) writable\n",
blob, HB_FUNC, (void *) blob, HB_FUNC,
addr, addr+length, (unsigned long) length)); addr, addr+length, (unsigned long) length));
return TRUE; return TRUE;
#else #else
@ -279,13 +279,13 @@ static bool
_try_writable_inplace (hb_blob_t *blob) _try_writable_inplace (hb_blob_t *blob)
{ {
(void) (HB_DEBUG_BLOB && (void) (HB_DEBUG_BLOB &&
fprintf (stderr, "%p %s: making writable inplace\n", blob, HB_FUNC)); fprintf (stderr, "%p %s: making writable inplace\n", (void *) blob, HB_FUNC));
if (_try_make_writable_inplace_unix (blob)) if (_try_make_writable_inplace_unix (blob))
return TRUE; return TRUE;
(void) (HB_DEBUG_BLOB && (void) (HB_DEBUG_BLOB &&
fprintf (stderr, "%p %s: making writable -> FAILED\n", blob, HB_FUNC)); fprintf (stderr, "%p %s: making writable -> FAILED\n", (void *) blob, HB_FUNC));
/* Failed to make writable inplace, mark that */ /* Failed to make writable inplace, mark that */
blob->mode = HB_MEMORY_MODE_READONLY; blob->mode = HB_MEMORY_MODE_READONLY;
@ -309,7 +309,7 @@ _try_writable (hb_blob_t *blob)
(void) (HB_DEBUG_BLOB && (void) (HB_DEBUG_BLOB &&
fprintf (stderr, "%p %s -> %p\n", blob, HB_FUNC, blob->data)); fprintf (stderr, "%p %s -> %p\n", (void *) blob, HB_FUNC, blob->data));
char *new_data; char *new_data;
@ -318,7 +318,7 @@ _try_writable (hb_blob_t *blob)
return FALSE; return FALSE;
(void) (HB_DEBUG_BLOB && (void) (HB_DEBUG_BLOB &&
fprintf (stderr, "%p %s: dupped successfully -> %p\n", blob, HB_FUNC, blob->data)); fprintf (stderr, "%p %s: dupped successfully -> %p\n", (void *) blob, HB_FUNC, blob->data));
memcpy (new_data, blob->data, blob->length); memcpy (new_data, blob->data, blob->length);
_hb_blob_destroy_user_data (blob); _hb_blob_destroy_user_data (blob);

@ -177,26 +177,26 @@ hb_glib_script_from_script (hb_script_t script)
static unsigned int static unsigned int
hb_glib_get_combining_class (hb_unicode_funcs_t *ufuncs, hb_glib_get_combining_class (hb_unicode_funcs_t *ufuncs HB_UNUSED,
hb_codepoint_t unicode, hb_codepoint_t unicode,
void *user_data) void *user_data HB_UNUSED)
{ {
return g_unichar_combining_class (unicode); return g_unichar_combining_class (unicode);
} }
static unsigned int static unsigned int
hb_glib_get_eastasian_width (hb_unicode_funcs_t *ufuncs, hb_glib_get_eastasian_width (hb_unicode_funcs_t *ufuncs HB_UNUSED,
hb_codepoint_t unicode, hb_codepoint_t unicode,
void *user_data) void *user_data HB_UNUSED)
{ {
return g_unichar_iswide (unicode) ? 2 : 1; return g_unichar_iswide (unicode) ? 2 : 1;
} }
static hb_unicode_general_category_t static hb_unicode_general_category_t
hb_glib_get_general_category (hb_unicode_funcs_t *ufuncs, hb_glib_get_general_category (hb_unicode_funcs_t *ufuncs HB_UNUSED,
hb_codepoint_t unicode, hb_codepoint_t unicode,
void *user_data) void *user_data HB_UNUSED)
{ {
/* hb_unicode_general_category_t and GUnicodeType are identical */ /* hb_unicode_general_category_t and GUnicodeType are identical */
@ -204,18 +204,18 @@ hb_glib_get_general_category (hb_unicode_funcs_t *ufuncs,
} }
static hb_codepoint_t static hb_codepoint_t
hb_glib_get_mirroring (hb_unicode_funcs_t *ufuncs, hb_glib_get_mirroring (hb_unicode_funcs_t *ufuncs HB_UNUSED,
hb_codepoint_t unicode, hb_codepoint_t unicode,
void *user_data) void *user_data HB_UNUSED)
{ {
g_unichar_get_mirror_char (unicode, &unicode); g_unichar_get_mirror_char (unicode, &unicode);
return unicode; return unicode;
} }
static hb_script_t static hb_script_t
hb_glib_get_script (hb_unicode_funcs_t *ufuncs, hb_glib_get_script (hb_unicode_funcs_t *ufuncs HB_UNUSED,
hb_codepoint_t unicode, hb_codepoint_t unicode,
void *user_data) void *user_data HB_UNUSED)
{ {
return hb_glib_script_to_script (g_unichar_get_script (unicode)); return hb_glib_script_to_script (g_unichar_get_script (unicode));
} }

@ -63,18 +63,18 @@ hb_icu_script_from_script (hb_script_t script)
static unsigned int static unsigned int
hb_icu_get_combining_class (hb_unicode_funcs_t *ufuncs, hb_icu_get_combining_class (hb_unicode_funcs_t *ufuncs HB_UNUSED,
hb_codepoint_t unicode, hb_codepoint_t unicode,
void *user_data) void *user_data HB_UNUSED)
{ {
return u_getCombiningClass (unicode); return u_getCombiningClass (unicode);
} }
static unsigned int static unsigned int
hb_icu_get_eastasian_width (hb_unicode_funcs_t *ufuncs, hb_icu_get_eastasian_width (hb_unicode_funcs_t *ufuncs HB_UNUSED,
hb_codepoint_t unicode, hb_codepoint_t unicode,
void *user_data) void *user_data HB_UNUSED)
{ {
switch (u_getIntPropertyValue(unicode, UCHAR_EAST_ASIAN_WIDTH)) switch (u_getIntPropertyValue(unicode, UCHAR_EAST_ASIAN_WIDTH))
{ {
@ -91,9 +91,9 @@ hb_icu_get_eastasian_width (hb_unicode_funcs_t *ufuncs,
} }
static hb_unicode_general_category_t static hb_unicode_general_category_t
hb_icu_get_general_category (hb_unicode_funcs_t *ufuncs, hb_icu_get_general_category (hb_unicode_funcs_t *ufuncs HB_UNUSED,
hb_codepoint_t unicode, hb_codepoint_t unicode,
void *user_data) void *user_data HB_UNUSED)
{ {
switch (u_getIntPropertyValue(unicode, UCHAR_GENERAL_CATEGORY)) switch (u_getIntPropertyValue(unicode, UCHAR_GENERAL_CATEGORY))
{ {
@ -142,17 +142,17 @@ hb_icu_get_general_category (hb_unicode_funcs_t *ufuncs,
} }
static hb_codepoint_t static hb_codepoint_t
hb_icu_get_mirroring (hb_unicode_funcs_t *ufuncs, hb_icu_get_mirroring (hb_unicode_funcs_t *ufuncs HB_UNUSED,
hb_codepoint_t unicode, hb_codepoint_t unicode,
void *user_data) void *user_data HB_UNUSED)
{ {
return u_charMirror(unicode); return u_charMirror(unicode);
} }
static hb_script_t static hb_script_t
hb_icu_get_script (hb_unicode_funcs_t *ufuncs, hb_icu_get_script (hb_unicode_funcs_t *ufuncs HB_UNUSED,
hb_codepoint_t unicode, hb_codepoint_t unicode,
void *user_data) void *user_data HB_UNUSED)
{ {
UErrorCode status = U_ZERO_ERROR; UErrorCode status = U_ZERO_ERROR;
UScriptCode scriptCode = uscript_getScript(unicode, &status); UScriptCode scriptCode = uscript_getScript(unicode, &status);

@ -193,7 +193,7 @@ struct _hb_object_header_t {
inline void trace (const char *function) const { inline void trace (const char *function) const {
(void) (HB_DEBUG_OBJECT && (void) (HB_DEBUG_OBJECT &&
fprintf (stderr, "OBJECT(%p) refcount=%d %s\n", fprintf (stderr, "OBJECT(%p) refcount=%d %s\n",
this, (void *) this,
this ? ref_count.get () : 0, this ? ref_count.get () : 0,
function)); function));
} }

@ -198,7 +198,7 @@ struct hb_sanitize_context_t
(void) (HB_DEBUG_SANITIZE && (void) (HB_DEBUG_SANITIZE &&
fprintf (stderr, "sanitize %p init [%p..%p] (%lu bytes)\n", fprintf (stderr, "sanitize %p init [%p..%p] (%lu bytes)\n",
this->blob, this->start, this->end, (void *) this->blob, this->start, this->end,
(unsigned long) (this->end - this->start))); (unsigned long) (this->end - this->start)));
} }
@ -206,7 +206,7 @@ struct hb_sanitize_context_t
{ {
(void) (HB_DEBUG_SANITIZE && (void) (HB_DEBUG_SANITIZE &&
fprintf (stderr, "sanitize %p fini [%p..%p] %u edit requests\n", fprintf (stderr, "sanitize %p fini [%p..%p] %u edit requests\n",
this->blob, this->start, this->end, this->edit_count)); (void *) this->blob, this->start, this->end, this->edit_count));
hb_blob_destroy (this->blob); hb_blob_destroy (this->blob);
this->blob = NULL; this->blob = NULL;
@ -293,7 +293,7 @@ struct Sanitizer
retry: retry:
(void) (HB_DEBUG_SANITIZE && (void) (HB_DEBUG_SANITIZE &&
fprintf (stderr, "Sanitizer %p start %s\n", blob, HB_FUNC)); fprintf (stderr, "Sanitizer %p start %s\n", (void *) blob, HB_FUNC));
c->setup (); c->setup ();
@ -309,7 +309,7 @@ struct Sanitizer
if (c->edit_count) { if (c->edit_count) {
(void) (HB_DEBUG_SANITIZE && (void) (HB_DEBUG_SANITIZE &&
fprintf (stderr, "Sanitizer %p passed first round with %d edits; doing a second round %s\n", fprintf (stderr, "Sanitizer %p passed first round with %d edits; doing a second round %s\n",
blob, c->edit_count, HB_FUNC)); (void *) blob, c->edit_count, HB_FUNC));
/* sanitize again to ensure no toe-stepping */ /* sanitize again to ensure no toe-stepping */
c->edit_count = 0; c->edit_count = 0;
@ -317,7 +317,7 @@ struct Sanitizer
if (c->edit_count) { if (c->edit_count) {
(void) (HB_DEBUG_SANITIZE && (void) (HB_DEBUG_SANITIZE &&
fprintf (stderr, "Sanitizer %p requested %d edits in second round; FAILLING %s\n", fprintf (stderr, "Sanitizer %p requested %d edits in second round; FAILLING %s\n",
blob, c->edit_count, HB_FUNC)); (void *) blob, c->edit_count, HB_FUNC));
sane = false; sane = false;
} }
} }
@ -331,7 +331,7 @@ struct Sanitizer
c->writable = true; c->writable = true;
/* ok, we made it writable by relocating. try again */ /* ok, we made it writable by relocating. try again */
(void) (HB_DEBUG_SANITIZE && (void) (HB_DEBUG_SANITIZE &&
fprintf (stderr, "Sanitizer %p retry %s\n", blob, HB_FUNC)); fprintf (stderr, "Sanitizer %p retry %s\n", (void *) blob, HB_FUNC));
goto retry; goto retry;
} }
} }
@ -340,7 +340,7 @@ struct Sanitizer
c->finish (); c->finish ();
(void) (HB_DEBUG_SANITIZE && (void) (HB_DEBUG_SANITIZE &&
fprintf (stderr, "Sanitizer %p %s %s\n", blob, sane ? "passed" : "FAILED", HB_FUNC)); fprintf (stderr, "Sanitizer %p %s %s\n", (void *) blob, sane ? "passed" : "FAILED", HB_FUNC));
if (sane) if (sane)
return blob; return blob;
else { else {

@ -143,7 +143,7 @@ struct CaretValueFormat3
{ {
friend struct CaretValue; friend struct CaretValue;
inline hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph_id) const inline hb_position_t get_caret_value (hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph_id HB_UNUSED) const
{ {
return HB_DIRECTION_IS_HORIZONTAL (direction) ? return HB_DIRECTION_IS_HORIZONTAL (direction) ?
font->em_scale_x (coordinate) + (this+deviceTable).get_x_delta (font) : font->em_scale_x (coordinate) + (this+deviceTable).get_x_delta (font) :

@ -458,7 +458,7 @@ hb_ot_layout_substitute_lookup (hb_face_t *face,
} }
void void
hb_ot_layout_substitute_finish (hb_buffer_t *buffer) hb_ot_layout_substitute_finish (hb_buffer_t *buffer HB_UNUSED)
{ {
} }

@ -96,7 +96,7 @@ struct hb_ot_map_t
hb_ot_layout_substitute_lookup (face, buffer, lookups[0][i].index, lookups[0][i].mask); hb_ot_layout_substitute_lookup (face, buffer, lookups[0][i].index, lookups[0][i].mask);
} }
inline void position (hb_font_t *font, hb_face_t *face, hb_buffer_t *buffer) const { inline void position (hb_font_t *font, hb_buffer_t *buffer) const {
for (unsigned int i = 0; i < lookups[1].len; i++) for (unsigned int i = 0; i < lookups[1].len; i++)
hb_ot_layout_position_lookup (font, buffer, lookups[1][i].index, lookups[1][i].mask); hb_ot_layout_position_lookup (font, buffer, lookups[1][i].index, lookups[1][i].mask);
} }

@ -49,7 +49,7 @@ enum {
OT_SM, OT_SM,
OT_VD, OT_VD,
OT_A, OT_A,
OT_NBSP, OT_NBSP
}; };
/* Categories used in IndicSyllabicCategory.txt from UCD */ /* Categories used in IndicSyllabicCategory.txt from UCD */
@ -76,7 +76,7 @@ enum indic_syllabic_category_t {
INDIC_SYLLABIC_CATEGORY_VISARGA = OT_SM, INDIC_SYLLABIC_CATEGORY_VISARGA = OT_SM,
INDIC_SYLLABIC_CATEGORY_VOWEL = OT_V, INDIC_SYLLABIC_CATEGORY_VOWEL = OT_V,
INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT = OT_M, INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT = OT_M,
INDIC_SYLLABIC_CATEGORY_VOWEL_INDEPENDENT = OT_V, INDIC_SYLLABIC_CATEGORY_VOWEL_INDEPENDENT = OT_V
}; };
/* Categories used in IndicSMatraCategory.txt from UCD */ /* Categories used in IndicSMatraCategory.txt from UCD */
@ -96,7 +96,7 @@ enum indic_matra_category_t {
INDIC_MATRA_CATEGORY_TOP_AND_LEFT, INDIC_MATRA_CATEGORY_TOP_AND_LEFT,
INDIC_MATRA_CATEGORY_TOP_AND_LEFT_AND_RIGHT, INDIC_MATRA_CATEGORY_TOP_AND_LEFT_AND_RIGHT,
INDIC_MATRA_CATEGORY_TOP_AND_RIGHT, INDIC_MATRA_CATEGORY_TOP_AND_RIGHT,
INDIC_MATRA_CATEGORY_VISUAL_ORDER_LEFT, INDIC_MATRA_CATEGORY_VISUAL_ORDER_LEFT
}; };
#define INDIC_COMBINE_CATEGORIES(S,M) \ #define INDIC_COMBINE_CATEGORIES(S,M) \
@ -136,7 +136,7 @@ static const hb_tag_t indic_other_features[] =
void void
_hb_ot_shape_complex_collect_features_indic (hb_ot_shape_planner_t *planner, const hb_segment_properties_t *props) _hb_ot_shape_complex_collect_features_indic (hb_ot_shape_planner_t *planner, const hb_segment_properties_t *props HB_UNUSED)
{ {
for (unsigned int i = 0; i < ARRAY_LENGTH (indic_basic_features); i++) for (unsigned int i = 0; i < ARRAY_LENGTH (indic_basic_features); i++)
planner->map.add_bool_feature (indic_basic_features[i], false); planner->map.add_bool_feature (indic_basic_features[i], false);

@ -44,7 +44,7 @@ HB_BEGIN_DECLS
enum hb_ot_complex_shaper_t { enum hb_ot_complex_shaper_t {
hb_ot_complex_shaper_none, hb_ot_complex_shaper_none,
hb_ot_complex_shaper_arabic, hb_ot_complex_shaper_arabic,
hb_ot_complex_shaper_indic, hb_ot_complex_shaper_indic
}; };

@ -161,7 +161,7 @@ hb_ot_position_complex (hb_ot_shape_context_t *c)
&c->buffer->pos[i].y_offset); &c->buffer->pos[i].y_offset);
} }
c->plan->map.position (c->font, c->face, c->buffer); c->plan->map.position (c->font, c->buffer);
for (unsigned int i = 0; i < count; i++) { for (unsigned int i = 0; i < count; i++) {
hb_font_subtract_glyph_origin_for_direction (c->font, c->buffer->info[i].codepoint, hb_font_subtract_glyph_origin_for_direction (c->font, c->buffer->info[i].codepoint,

Loading…
Cancel
Save