summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2019-03-19 16:53:35 +0200
committerVille Syrjälä <ville.syrjala@linux.intel.com>2019-09-19 19:17:03 +0300
commit97ce02157035e4d8d1861f18f76c82f6d034df1b (patch)
tree62631efa01783b0315bbe2ec78fc3f09101ac7da
parent17ecd906f3b07c232d3a18fa3cc858b168123215 (diff)
downloadxorg-driver-xf86-video-intel-97ce02157035e4d8d1861f18f76c82f6d034df1b.tar.gz
sna: Use memcmp() to avoid strict aliasing warns
../src/sna/sna_display.c: In function ‘sna_covering_crtc’: ../src/sna/sna_display.c:8235:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] if (*(const uint64_t *)box == *(uint64_t *)&crtc->bounds) { Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
-rw-r--r--src/sna/sna_display.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 5c522011..5c377cf2 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -8232,7 +8232,7 @@ sna_covering_crtc(struct sna *sna, const BoxRec *box, xf86CrtcPtr desired)
__FUNCTION__, c,
crtc->bounds.x1, crtc->bounds.y1,
crtc->bounds.x2, crtc->bounds.y2));
- if (*(const uint64_t *)box == *(uint64_t *)&crtc->bounds) {
+ if (!memcmp(box, &crtc->bounds, sizeof(*box))) {
DBG(("%s: box exactly matches crtc [%d]\n",
__FUNCTION__, c));
return crtc;