Fix warnings

This commit is contained in:
Behdad Esfahbod 2018-02-16 15:37:22 -08:00
parent 94d32d1b83
commit 7b5ce74047
3 changed files with 10 additions and 4 deletions

View File

@ -78,7 +78,7 @@ struct os2
{
hb_codepoint_t min = -1, max = 0;
for (int i = 0; i < codepoints.len; i++)
for (unsigned int i = 0; i < codepoints.len; i++)
{
hb_codepoint_t cp = codepoints[i];
if (cp < min)

View File

@ -86,6 +86,7 @@ hb_subset_test_open_font (const char *font_path)
return face;
}
g_assert (false);
return NULL; /* Shut up, compiler! */
}
static inline hb_face_t *
@ -114,7 +115,7 @@ hb_subset_test_check (hb_face_t *expected,
{
hb_blob_t *expected_blob = hb_face_reference_table (expected, table);
hb_blob_t *actual_blob = hb_face_reference_table (actual, table);
hb_test_assert_blob_eq(expected_blob, actual_blob);
hb_test_assert_blobs_equal (expected_blob, actual_blob);
hb_blob_destroy (expected_blob);
hb_blob_destroy (actual_blob);
}

View File

@ -160,8 +160,14 @@ typedef void (*hb_test_fixture_func_t) (void);
#if !GLIB_CHECK_VERSION(2,30,0)
#define g_test_fail() g_error("Test failed")
#endif
#ifndef g_assert_true
#define g_assert_true g_assert
#endif
#ifndef g_assert_cmpmem
#define g_assert_cmpmem(m1, l1, m2, l2) g_assert_true (l1 == l2 && memcmp (m1, m2, l1) == 0)
#endif
static inline void hb_test_assert_blob_eq(hb_blob_t *expected_blob, hb_blob_t *actual_blob)
static inline void hb_test_assert_blobs_equal (hb_blob_t *expected_blob, hb_blob_t *actual_blob)
{
unsigned int expected_length, actual_length;
const char *raw_expected = hb_blob_get_data (expected_blob, &expected_length);
@ -170,7 +176,6 @@ static inline void hb_test_assert_blob_eq(hb_blob_t *expected_blob, hb_blob_t *a
g_assert_cmpint(0, ==, memcmp(raw_expected, raw_actual, expected_length));
}
static inline void
hb_test_add_func (const char *test_path,
hb_test_func_t test_func)