mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-14 04:00:31 +01:00
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:
parent
4d68059656
commit
29f480d4ea
1 changed files with 4 additions and 7 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue