[API] Remove hb_*_get_reference_count()

This was a bizzare piece of API that I inherited from cairo.  It has
been wrong adding them to cairo in the first place.  Remove them before
someone uses them!
This commit is contained in:
Behdad Esfahbod 2011-04-20 15:49:31 -04:00
parent 440a76b630
commit af02933739
10 changed files with 0 additions and 85 deletions

View File

@ -152,12 +152,6 @@ hb_blob_reference (hb_blob_t *blob)
HB_OBJECT_DO_REFERENCE (blob); HB_OBJECT_DO_REFERENCE (blob);
} }
unsigned int
hb_blob_get_reference_count (hb_blob_t *blob)
{
HB_OBJECT_DO_GET_REFERENCE_COUNT (blob);
}
void void
hb_blob_destroy (hb_blob_t *blob) hb_blob_destroy (hb_blob_t *blob)
{ {

View File

@ -59,9 +59,6 @@ hb_blob_create_empty (void);
hb_blob_t * hb_blob_t *
hb_blob_reference (hb_blob_t *blob); hb_blob_reference (hb_blob_t *blob);
unsigned int
hb_blob_get_reference_count (hb_blob_t *blob);
void void
hb_blob_destroy (hb_blob_t *blob); hb_blob_destroy (hb_blob_t *blob);

View File

@ -154,12 +154,6 @@ hb_buffer_reference (hb_buffer_t *buffer)
HB_OBJECT_DO_REFERENCE (buffer); HB_OBJECT_DO_REFERENCE (buffer);
} }
unsigned int
hb_buffer_get_reference_count (hb_buffer_t *buffer)
{
HB_OBJECT_DO_GET_REFERENCE_COUNT (buffer);
}
void void
hb_buffer_destroy (hb_buffer_t *buffer) hb_buffer_destroy (hb_buffer_t *buffer)
{ {

View File

@ -65,9 +65,6 @@ hb_buffer_create (unsigned int pre_alloc_size);
hb_buffer_t * hb_buffer_t *
hb_buffer_reference (hb_buffer_t *buffer); hb_buffer_reference (hb_buffer_t *buffer);
unsigned int
hb_buffer_get_reference_count (hb_buffer_t *buffer);
void void
hb_buffer_destroy (hb_buffer_t *buffer); hb_buffer_destroy (hb_buffer_t *buffer);

View File

@ -115,12 +115,6 @@ hb_font_funcs_reference (hb_font_funcs_t *ffuncs)
HB_OBJECT_DO_REFERENCE (ffuncs); HB_OBJECT_DO_REFERENCE (ffuncs);
} }
unsigned int
hb_font_funcs_get_reference_count (hb_font_funcs_t *ffuncs)
{
HB_OBJECT_DO_GET_REFERENCE_COUNT (ffuncs);
}
void void
hb_font_funcs_destroy (hb_font_funcs_t *ffuncs) hb_font_funcs_destroy (hb_font_funcs_t *ffuncs)
{ {
@ -397,12 +391,6 @@ hb_face_reference (hb_face_t *face)
HB_OBJECT_DO_REFERENCE (face); HB_OBJECT_DO_REFERENCE (face);
} }
unsigned int
hb_face_get_reference_count (hb_face_t *face)
{
HB_OBJECT_DO_GET_REFERENCE_COUNT (face);
}
void void
hb_face_destroy (hb_face_t *face) hb_face_destroy (hb_face_t *face)
{ {
@ -477,12 +465,6 @@ hb_font_reference (hb_font_t *font)
HB_OBJECT_DO_REFERENCE (font); HB_OBJECT_DO_REFERENCE (font);
} }
unsigned int
hb_font_get_reference_count (hb_font_t *font)
{
HB_OBJECT_DO_GET_REFERENCE_COUNT (font);
}
void void
hb_font_destroy (hb_font_t *font) hb_font_destroy (hb_font_t *font)
{ {

View File

@ -55,9 +55,6 @@ hb_face_create_for_tables (hb_get_table_func_t get_table,
hb_face_t * hb_face_t *
hb_face_reference (hb_face_t *face); hb_face_reference (hb_face_t *face);
unsigned int
hb_face_get_reference_count (hb_face_t *face);
void void
hb_face_destroy (hb_face_t *face); hb_face_destroy (hb_face_t *face);
@ -94,9 +91,6 @@ hb_font_funcs_create (void);
hb_font_funcs_t * hb_font_funcs_t *
hb_font_funcs_reference (hb_font_funcs_t *ffuncs); hb_font_funcs_reference (hb_font_funcs_t *ffuncs);
unsigned int
hb_font_funcs_get_reference_count (hb_font_funcs_t *ffuncs);
void void
hb_font_funcs_destroy (hb_font_funcs_t *ffuncs); hb_font_funcs_destroy (hb_font_funcs_t *ffuncs);
@ -209,9 +203,6 @@ hb_font_create (void);
hb_font_t * hb_font_t *
hb_font_reference (hb_font_t *font); hb_font_reference (hb_font_t *font);
unsigned int
hb_font_get_reference_count (hb_font_t *font);
void void
hb_font_destroy (hb_font_t *font); hb_font_destroy (hb_font_t *font);

View File

@ -116,13 +116,6 @@ _hb_trace_object (const void *obj,
return obj; \ return obj; \
} HB_STMT_END } HB_STMT_END
#define HB_OBJECT_DO_GET_REFERENCE_COUNT(obj) \
HB_STMT_START { \
if (unlikely (!(obj) || HB_OBJECT_IS_INERT (obj))) \
return 0; \
return HB_REFERENCE_COUNT_GET_VALUE (obj->ref_count); \
} HB_STMT_END
#define HB_OBJECT_DO_DESTROY(obj) \ #define HB_OBJECT_DO_DESTROY(obj) \
HB_STMT_START { \ HB_STMT_START { \
int old_count; \ int old_count; \

View File

@ -128,12 +128,6 @@ hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs)
HB_OBJECT_DO_REFERENCE (ufuncs); HB_OBJECT_DO_REFERENCE (ufuncs);
} }
unsigned int
hb_unicode_funcs_get_reference_count (hb_unicode_funcs_t *ufuncs)
{
HB_OBJECT_DO_GET_REFERENCE_COUNT (ufuncs);
}
void void
hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs) hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs)
{ {

View File

@ -46,9 +46,6 @@ hb_unicode_funcs_create (hb_unicode_funcs_t *parent_funcs);
hb_unicode_funcs_t * hb_unicode_funcs_t *
hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs); hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs);
unsigned int
hb_unicode_funcs_get_reference_count (hb_unicode_funcs_t *ufuncs);
void void
hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs); hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs);

View File

@ -35,7 +35,6 @@ test_nil (void)
g_assert_cmpint (hb_unicode_get_script (uf, 'd'), ==, HB_SCRIPT_UNKNOWN); g_assert_cmpint (hb_unicode_get_script (uf, 'd'), ==, HB_SCRIPT_UNKNOWN);
g_assert_cmpint (hb_unicode_funcs_get_reference_count (uf), ==, 1);
hb_unicode_funcs_destroy (uf); hb_unicode_funcs_destroy (uf);
} }
@ -45,10 +44,6 @@ test_glib (void)
hb_unicode_funcs_t *uf = hb_glib_get_unicode_funcs (); hb_unicode_funcs_t *uf = hb_glib_get_unicode_funcs ();
g_assert_cmpint (hb_unicode_get_script (uf, 'd'), ==, HB_SCRIPT_LATIN); g_assert_cmpint (hb_unicode_get_script (uf, 'd'), ==, HB_SCRIPT_LATIN);
g_assert_cmpint (hb_unicode_funcs_get_reference_count (uf), ==, 0);
hb_unicode_funcs_destroy (uf);
g_assert_cmpint (hb_unicode_funcs_get_reference_count (uf), ==, 0);
} }
static gboolean freed0, freed1; static gboolean freed0, freed1;
@ -92,7 +87,6 @@ test_custom (void)
g_assert_cmpint (hb_unicode_get_script (uf, 'a'), ==, HB_SCRIPT_LATIN); g_assert_cmpint (hb_unicode_get_script (uf, 'a'), ==, HB_SCRIPT_LATIN);
g_assert_cmpint (hb_unicode_get_script (uf, '0'), ==, HB_SCRIPT_UNKNOWN); g_assert_cmpint (hb_unicode_get_script (uf, '0'), ==, HB_SCRIPT_UNKNOWN);
g_assert_cmpint (hb_unicode_funcs_get_reference_count (uf), ==, 1);
g_assert (!freed0 && !freed1); g_assert (!freed0 && !freed1);
hb_unicode_funcs_destroy (uf); hb_unicode_funcs_destroy (uf);
g_assert (freed0 && !freed1); g_assert (freed0 && !freed1);
@ -123,13 +117,10 @@ test_subclassing_nil (void)
hb_unicode_funcs_t *uf, *aa; hb_unicode_funcs_t *uf, *aa;
uf = hb_unicode_funcs_create (NULL); uf = hb_unicode_funcs_create (NULL);
g_assert_cmpint (hb_unicode_funcs_get_reference_count (uf), ==, 1);
aa = hb_unicode_funcs_create (uf); aa = hb_unicode_funcs_create (uf);
g_assert_cmpint (hb_unicode_funcs_get_reference_count (uf), ==, 2);
hb_unicode_funcs_destroy (uf); hb_unicode_funcs_destroy (uf);
g_assert_cmpint (hb_unicode_funcs_get_reference_count (uf), ==, 1);
hb_unicode_funcs_set_script_func (aa, a_is_for_arabic_get_script, hb_unicode_funcs_set_script_func (aa, a_is_for_arabic_get_script,
unique_pointer1, free_up); unique_pointer1, free_up);
@ -137,8 +128,6 @@ test_subclassing_nil (void)
g_assert_cmpint (hb_unicode_get_script (aa, 'a'), ==, HB_SCRIPT_ARABIC); g_assert_cmpint (hb_unicode_get_script (aa, 'a'), ==, HB_SCRIPT_ARABIC);
g_assert_cmpint (hb_unicode_get_script (aa, 'b'), ==, HB_SCRIPT_UNKNOWN); g_assert_cmpint (hb_unicode_get_script (aa, 'b'), ==, HB_SCRIPT_UNKNOWN);
g_assert_cmpint (hb_unicode_funcs_get_reference_count (aa), ==, 1);
g_assert_cmpint (hb_unicode_funcs_get_reference_count (uf), ==, 1);
g_assert (!freed0 && !freed1); g_assert (!freed0 && !freed1);
hb_unicode_funcs_destroy (aa); hb_unicode_funcs_destroy (aa);
g_assert (!freed0 && freed1); g_assert (!freed0 && freed1);
@ -151,13 +140,7 @@ test_subclassing_glib (void)
hb_unicode_funcs_t *uf, *aa; hb_unicode_funcs_t *uf, *aa;
uf = hb_glib_get_unicode_funcs (); uf = hb_glib_get_unicode_funcs ();
g_assert_cmpint (hb_unicode_funcs_get_reference_count (uf), ==, 0);
aa = hb_unicode_funcs_create (uf); aa = hb_unicode_funcs_create (uf);
g_assert_cmpint (hb_unicode_funcs_get_reference_count (uf), ==, 0);
hb_unicode_funcs_destroy (uf);
g_assert_cmpint (hb_unicode_funcs_get_reference_count (uf), ==, 0);
hb_unicode_funcs_set_script_func (aa, a_is_for_arabic_get_script, hb_unicode_funcs_set_script_func (aa, a_is_for_arabic_get_script,
unique_pointer1, free_up); unique_pointer1, free_up);
@ -165,7 +148,6 @@ test_subclassing_glib (void)
g_assert_cmpint (hb_unicode_get_script (aa, 'a'), ==, HB_SCRIPT_ARABIC); g_assert_cmpint (hb_unicode_get_script (aa, 'a'), ==, HB_SCRIPT_ARABIC);
g_assert_cmpint (hb_unicode_get_script (aa, 'b'), ==, HB_SCRIPT_LATIN); g_assert_cmpint (hb_unicode_get_script (aa, 'b'), ==, HB_SCRIPT_LATIN);
g_assert_cmpint (hb_unicode_funcs_get_reference_count (aa), ==, 1);
g_assert (!freed0 && !freed1); g_assert (!freed0 && !freed1);
hb_unicode_funcs_destroy (aa); hb_unicode_funcs_destroy (aa);
g_assert (!freed0 && freed1); g_assert (!freed0 && freed1);
@ -178,17 +160,13 @@ test_subclassing_deep (void)
hb_unicode_funcs_t *uf, *aa; hb_unicode_funcs_t *uf, *aa;
uf = hb_unicode_funcs_create (NULL); uf = hb_unicode_funcs_create (NULL);
g_assert_cmpint (hb_unicode_funcs_get_reference_count (uf), ==, 1);
hb_unicode_funcs_set_script_func (uf, simple_get_script, hb_unicode_funcs_set_script_func (uf, simple_get_script,
unique_pointer0, free_up); unique_pointer0, free_up);
aa = hb_unicode_funcs_create (uf); aa = hb_unicode_funcs_create (uf);
g_assert_cmpint (hb_unicode_funcs_get_reference_count (aa), ==, 1);
g_assert_cmpint (hb_unicode_funcs_get_reference_count (uf), ==, 2);
hb_unicode_funcs_destroy (uf); hb_unicode_funcs_destroy (uf);
g_assert_cmpint (hb_unicode_funcs_get_reference_count (uf), ==, 1);
/* make sure the 'uf' didn't get freed, since 'aa' holds a ref */ /* make sure the 'uf' didn't get freed, since 'aa' holds a ref */
g_assert (!freed0); g_assert (!freed0);
@ -200,8 +178,6 @@ test_subclassing_deep (void)
g_assert_cmpint (hb_unicode_get_script (aa, 'b'), ==, HB_SCRIPT_LATIN); g_assert_cmpint (hb_unicode_get_script (aa, 'b'), ==, HB_SCRIPT_LATIN);
g_assert_cmpint (hb_unicode_get_script (aa, '0'), ==, HB_SCRIPT_UNKNOWN); g_assert_cmpint (hb_unicode_get_script (aa, '0'), ==, HB_SCRIPT_UNKNOWN);
g_assert_cmpint (hb_unicode_funcs_get_reference_count (aa), ==, 1);
g_assert_cmpint (hb_unicode_funcs_get_reference_count (uf), ==, 1);
g_assert (!freed0 && !freed1); g_assert (!freed0 && !freed1);
hb_unicode_funcs_destroy (aa); hb_unicode_funcs_destroy (aa);
g_assert (freed0 && freed1); g_assert (freed0 && freed1);