diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index 3f46d686e..c3cff08cb 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -486,7 +486,7 @@ void hb_buffer_t::deallocate_var_all (void) /* Public API */ hb_buffer_t * -hb_buffer_create (unsigned int pre_alloc_size) +hb_buffer_create () { hb_buffer_t *buffer; @@ -495,11 +495,6 @@ hb_buffer_create (unsigned int pre_alloc_size) buffer->reset (); - if (pre_alloc_size && !buffer->ensure (pre_alloc_size)) { - hb_buffer_destroy (buffer); - return &_hb_buffer_nil; - } - return buffer; } diff --git a/src/hb-buffer.h b/src/hb-buffer.h index a5efce354..9582ebee4 100644 --- a/src/hb-buffer.h +++ b/src/hb-buffer.h @@ -60,7 +60,7 @@ typedef struct _hb_glyph_position_t { hb_buffer_t * -hb_buffer_create (unsigned int pre_alloc_size); +hb_buffer_create (void); hb_buffer_t * hb_buffer_get_empty (void); diff --git a/src/test.cc b/src/test.cc index d1c0fafa2..af6a45a31 100644 --- a/src/test.cc +++ b/src/test.cc @@ -97,7 +97,7 @@ main (int argc, char **argv) hb_ft_font_set_funcs (font); #endif - hb_buffer_t *buffer = hb_buffer_create (0); + hb_buffer_t *buffer = hb_buffer_create (); hb_buffer_add_utf8 (buffer, "\xe0\xa4\x95\xe0\xa5\x8d\xe0\xa4\xb0\xe0\xa5\x8d\xe0\xa4\x95", -1, 0, -1); diff --git a/test/test-buffer.c b/test/test-buffer.c index d3872849e..ec32e156e 100644 --- a/test/test-buffer.c +++ b/test/test-buffer.c @@ -62,7 +62,7 @@ fixture_init (fixture_t *fixture, gconstpointer user_data) hb_buffer_t *b; unsigned int i; - b = fixture->buffer = hb_buffer_create (0); + b = fixture->buffer = hb_buffer_create (); switch (GPOINTER_TO_INT (user_data)) { @@ -344,7 +344,7 @@ test_buffer_utf8_conversion (void) hb_glyph_info_t *glyphs; unsigned int bytes, chars, i, j, len; - b = hb_buffer_create (0); + b = hb_buffer_create (); for (i = 0; i < G_N_ELEMENTS (utf8_conversion_tests); i++) { @@ -627,7 +627,7 @@ test_buffer_utf8_validity (void) hb_buffer_t *b; unsigned int i; - b = hb_buffer_create (0); + b = hb_buffer_create (); for (i = 0; i < G_N_ELEMENTS (utf8_validity_tests); i++) { @@ -684,7 +684,7 @@ test_buffer_utf16_conversion (void) hb_buffer_t *b; unsigned int i; - b = hb_buffer_create (0); + b = hb_buffer_create (); for (i = 0; i < G_N_ELEMENTS (utf16_conversion_tests); i++) { @@ -726,7 +726,6 @@ test_buffer_empty (void) g_assert (hb_buffer_get_empty ()); g_assert (hb_buffer_get_empty () == b); - g_assert (hb_buffer_get_empty () == hb_buffer_create (-1)); g_assert (!hb_buffer_allocation_successful (b)); diff --git a/test/test-object.c b/test/test-object.c index 8878cf17e..66e8d33f1 100644 --- a/test/test-object.c +++ b/test/test-object.c @@ -44,12 +44,12 @@ create_blob_inert (void) static void * create_buffer (void) { - return hb_buffer_create (0); + return hb_buffer_create (); } static void * create_buffer_inert (void) { - return hb_buffer_create (-1); + return NULL; } static void * diff --git a/test/test-shape-complex.c b/test/test-shape-complex.c index 6416b36a7..dea12ec77 100644 --- a/test/test-shape-complex.c +++ b/test/test-shape-complex.c @@ -1038,7 +1038,7 @@ test_shape_complex (ft_fixture_t *f, gconstpointer user_data) if (data->comments[0]) g_test_message ("Test comments: %s", data->comments); - buffer = hb_buffer_create (0); + buffer = hb_buffer_create (); for (len = 0; data->characters[len]; len++) ; hb_buffer_add_utf32 (buffer, data->characters, len, 0, len); diff --git a/test/test-shape.c b/test/test-shape.c index 6d30824e3..ccf6eed75 100644 --- a/test/test-shape.c +++ b/test/test-shape.c @@ -106,7 +106,7 @@ test_shape (void) hb_font_set_funcs (font, ffuncs, NULL, NULL); hb_font_funcs_destroy (ffuncs); - buffer = hb_buffer_create (0); + buffer = hb_buffer_create (); hb_buffer_set_direction (buffer, HB_DIRECTION_LTR); hb_buffer_add_utf8 (buffer, TesT, 4, 0, 4); diff --git a/util/hb-view.cc b/util/hb-view.cc index d533dde75..cdb90b6b0 100644 --- a/util/hb-view.cc +++ b/util/hb-view.cc @@ -59,7 +59,7 @@ _hb_cr_text_glyphs (cairo_t *cr, unsigned int num_glyphs, i; hb_position_t x, y; - hb_buffer = hb_buffer_create (0); + hb_buffer = hb_buffer_create (); if (shape_opts->direction) hb_buffer_set_direction (hb_buffer, hb_direction_from_string (shape_opts->direction));