mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-11 08:40:15 +01:00
[cairo-xlib] Remove the NULL safeguards.
No need to guarding against the pointer being NULL on internal functions as no path can call the function will a NULL pointer and no path should ever try, which in any case it would be better to crash immediately.
This commit is contained in:
parent
7b1a0eddac
commit
fcdc525dde
2 changed files with 1 additions and 12 deletions
|
|
@ -125,9 +125,6 @@ _cairo_xlib_display_discard_screens (cairo_xlib_display_t *display)
|
|||
cairo_xlib_display_t *
|
||||
_cairo_xlib_display_reference (cairo_xlib_display_t *display)
|
||||
{
|
||||
if (display == NULL)
|
||||
return NULL;
|
||||
|
||||
assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&display->ref_count));
|
||||
|
||||
_cairo_reference_count_inc (&display->ref_count);
|
||||
|
|
@ -138,9 +135,6 @@ _cairo_xlib_display_reference (cairo_xlib_display_t *display)
|
|||
void
|
||||
_cairo_xlib_display_destroy (cairo_xlib_display_t *display)
|
||||
{
|
||||
if (display == NULL)
|
||||
return;
|
||||
|
||||
assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&display->ref_count));
|
||||
|
||||
if (! _cairo_reference_count_dec_and_test (&display->ref_count))
|
||||
|
|
@ -213,6 +207,7 @@ _cairo_xlib_close_display (Display *dpy, XExtCodes *codes)
|
|||
}
|
||||
CAIRO_MUTEX_UNLOCK (_cairo_xlib_display_mutex);
|
||||
|
||||
assert (display != NULL);
|
||||
_cairo_xlib_display_destroy (display);
|
||||
|
||||
/* Return value in accordance with requirements of
|
||||
|
|
|
|||
|
|
@ -244,9 +244,6 @@ _cairo_xlib_init_screen_font_options (Display *dpy, cairo_xlib_screen_info_t *in
|
|||
cairo_xlib_screen_info_t *
|
||||
_cairo_xlib_screen_info_reference (cairo_xlib_screen_info_t *info)
|
||||
{
|
||||
if (info == NULL)
|
||||
return NULL;
|
||||
|
||||
assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&info->ref_count));
|
||||
|
||||
_cairo_reference_count_inc (&info->ref_count);
|
||||
|
|
@ -273,9 +270,6 @@ _cairo_xlib_screen_info_destroy (cairo_xlib_screen_info_t *info)
|
|||
cairo_xlib_screen_info_t **prev;
|
||||
cairo_xlib_screen_info_t *list;
|
||||
|
||||
if (info == NULL)
|
||||
return;
|
||||
|
||||
assert (CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&info->ref_count));
|
||||
|
||||
if (! _cairo_reference_count_dec_and_test (&info->ref_count))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue