summaryrefslogtreecommitdiff
path: root/src/sna/sna_glyphs.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2019-03-19 17:06:41 +0200
committerVille Syrjälä <ville.syrjala@linux.intel.com>2019-09-19 19:17:24 +0300
commitd8a3db257418d5ebb99509e0bdcfa24d618e6b3d (patch)
treec3ecffc8dde7d1b0d055ef9fac7056481a1ca30b /src/sna/sna_glyphs.c
parent97ce02157035e4d8d1861f18f76c82f6d034df1b (diff)
sna: Avoid strict aliasing violations with glyphinfo
Just access the xGlyphInfo members directly to avoid the compiler getting upset about strict aliasing violations. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'src/sna/sna_glyphs.c')
-rw-r--r--src/sna/sna_glyphs.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index 6ee40336..ebc061b5 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -85,8 +85,11 @@
#define NO_ATLAS ((PicturePtr)-1)
#define GLYPH_TOLERANCE 3
-#define glyph_valid(g) *((uint32_t *)&(g)->info.width)
-#define glyph_copy_size(r, g) *(uint32_t *)&(r)->width = *(uint32_t *)&g->info.width
+#define glyph_valid(g) ((g)->info.width || (g)->info.height)
+#define glyph_copy_size(r, g) do { \
+ (r)->width = (g)->info.width; \
+ (r)->height = (g)->info.height; \
+} while (0)
#if HAS_PIXMAN_GLYPHS
static pixman_glyph_cache_t *__global_glyph_cache;