status = _cairo_cache_lookup (&g->base, &key, (void **) (&entries[i]));
status = _cairo_cache_lookup (&g->base, &key, (void **) (&entries[i]), NULL);
_cairo_xlib_surface_show_glyphs (cairo_unscaled_font_t  *font,				 cairo_font_scale_t	*scale,				 cairo_operator_t       operator,				 cairo_surface_t        *source,				 void		        *abstract_surface,				 int                    source_x,				 int                    source_y,				 const cairo_glyph_t    *glyphs,				 int                    num_glyphs){    unsigned int elt_size;    cairo_xlib_surface_t *self = abstract_surface;    cairo_image_surface_t *tmp = NULL;    cairo_xlib_surface_t *src = NULL;    glyphset_cache_t *g;    cairo_status_t status;    cairo_glyph_cache_key_t key;    glyphset_cache_entry_t **entries;    glyphset_cache_entry_t *stack_entries [N_STACK_BUF];    int i;    /* Acquire an entry array of suitable size. */    if (num_glyphs < N_STACK_BUF) {	entries = stack_entries;    } else {	entries = malloc (num_glyphs * sizeof (glyphset_cache_entry_t *));	if (entries == NULL)	    goto FAIL;    }    /* prep the source surface. */    if (source->backend == self->base.backend) {	src = (cairo_xlib_surface_t *) source;    } else {	tmp = _cairo_surface_get_image (source);	if (tmp == NULL)	    goto FREE_ENTRIES;	src = (cairo_xlib_surface_t *) 	    _cairo_surface_create_similar_scratch (&self->base, self->format, 1,						   tmp->width, tmp->height);	if (src == NULL)	    goto FREE_TMP;	if (_cairo_surface_set_image (&(src->base), tmp) != CAIRO_STATUS_SUCCESS)	    goto FREE_SRC;	        }    _lock_xlib_glyphset_caches ();    g = _get_glyphset_cache (self->dpy);    if (g == NULL)	goto UNLOCK;    /* Work out the index size to use. */    elt_size = 8;    key.scale = *scale;    key.unscaled = font;    for (i = 0; i < num_glyphs; ++i) {	key.index = glyphs[i].index;	status = _cairo_cache_lookup (&g->base, &key, (void **) (&entries[i]));	if (status != CAIRO_STATUS_SUCCESS || entries[i] == NULL) 	    goto UNLOCK;	if (elt_size == 8 && entries[i]->glyph > 0xff)	    elt_size = 16;	if (elt_size == 16 && entries[i]->glyph > 0xffff) {	    elt_size = 32;	    break;	}    }    /* Call the appropriate sub-function. */    if (elt_size == 8)	status = _cairo_xlib_surface_show_glyphs8 (font, scale, operator, g, &key, src, self,						    source_x, source_y, 						   glyphs, entries, num_glyphs);    else if (elt_size == 16)	status = _cairo_xlib_surface_show_glyphs16 (font, scale, operator, g, &key, src, self,						    source_x, source_y, 						    glyphs, entries, num_glyphs);    else 	status = _cairo_xlib_surface_show_glyphs32 (font, scale, operator, g, &key, src, self,						    source_x, source_y, 						    glyphs, entries, num_glyphs);    _unlock_xlib_glyphset_caches ();    if (tmp != NULL) {	cairo_surface_destroy (&(src->base));	cairo_surface_destroy (&(tmp->base));    }    if (num_glyphs >= N_STACK_BUF)	free (entries);     return status; UNLOCK:    _unlock_xlib_glyphset_caches (); FREE_SRC:    cairo_surface_destroy (&(src->base)); FREE_TMP:    cairo_surface_destroy (&(tmp->base)); FREE_ENTRIES:    if (num_glyphs >= N_STACK_BUF)	free (entries);  FAIL:    return CAIRO_STATUS_NO_MEMORY;}