renamed a confusingly named function in cairo-font-face.c

I noticed a function called __put in cairo-font-face.c, and upon
reading the commit message (337ab1f8d9)
learned that the purpose of the function was to decrement the refcount,
checking if the decrement was the last one.

This commit just renames the function to something more
self-explanatory and removes code that's been commented out for 8
years.
This commit is contained in:
Ayman El Didi 2022-02-17 23:26:27 -07:00
parent 4d68059656
commit 29f480d4ea

View file

@ -136,7 +136,7 @@ cairo_font_face_reference (cairo_font_face_t *font_face)
slim_hidden_def (cairo_font_face_reference);
static inline cairo_bool_t
__put(cairo_reference_count_t *v)
_cairo_decrement_refcount_return_was_last (cairo_reference_count_t *v)
{
int c, old;
@ -150,10 +150,7 @@ __put(cairo_reference_count_t *v)
cairo_bool_t
_cairo_font_face_destroy (void *abstract_face)
{
#if 0 /* Nothing needs to be done, we can just drop the last reference */
cairo_font_face_t *font_face = abstract_face;
return _cairo_reference_count_dec_and_test (&font_face->ref_count);
#endif
(void)abstract_face;
return TRUE;
}
@ -180,7 +177,7 @@ cairo_font_face_destroy (cairo_font_face_t *font_face)
* FreeType backend where cairo_ft_font_face_t and cairo_ft_unscaled_font_t
* need to effectively mutually reference each other
*/
if (__put (&font_face->ref_count))
if (_cairo_decrement_refcount_return_was_last (&font_face->ref_count))
return;
if (! font_face->backend->destroy (font_face))
@ -335,7 +332,7 @@ _cairo_unscaled_font_destroy (cairo_unscaled_font_t *unscaled_font)
assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&unscaled_font->ref_count));
if (__put (&unscaled_font->ref_count))
if (_cairo_decrement_refcount_return_was_last (&unscaled_font->ref_count))
return;
if (! unscaled_font->backend->destroy (unscaled_font))