[PATCH xf86-video-intel 12/21] sna: Use memcmp() to avoid strict aliasing warns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

../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@xxxxxxxxxxxxxxx>
---
 src/sna/sna_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 5c522011e056..5c377cf2d86d 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;
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux