We can just use memcmp here because even in the use of lookup keys with
C99 initializers, we can rely on any space between fields added by the
compiler to be zeroed. So we might as well use wider memory cmopares.
#include <graphene.h>
#include <cairo.h>
#include <epoxy/gl.h>
+#include <string.h>
/* Cache eviction strategy
*
static gboolean
glyph_cache_equal (gconstpointer v1, gconstpointer v2)
{
- const GlyphCacheKey *key1 = v1;
- const GlyphCacheKey *key2 = v2;
-
- return key1->font == key2->font &&
- key1->glyph == key2->glyph &&
- key1->xshift == key2->xshift &&
- key1->yshift == key2->yshift &&
- key1->scale == key2->scale;
+ return memcmp (v1, v2, sizeof (GlyphCacheKey)) == 0;
}
static guint