Commit e4a8d533 authored by Ville Syrjälä's avatar Ville Syrjälä

sna/fb: Use memcpy() to avoid strict aliasing violations

Replace the cast+deref with memcpy() so that we don't upset
the compiler's strict aliasing rules.
Signed-off-by: Ville Syrjälä's avatarVille Syrjälä <ville.syrjala@linux.intel.com>
parent d8a3db25
......@@ -39,12 +39,13 @@ fbFillSpans(DrawablePtr drawable, GCPtr gc,
while (n--) {
BoxRec box;
*(DDXPointPtr)&box = *pt++;
memcpy(&box, pt, sizeof(box));
box.x2 = box.x1 + *width++;
box.y2 = box.y1 + 1;
/* XXX fSorted */
fbDrawableRun(drawable, gc, &box, fbFillSpan, NULL);
pt++;
}
}
......@@ -91,7 +92,8 @@ fbSetSpans(DrawablePtr drawable, GCPtr gc,
while (n--) {
BoxRec box;
*(DDXPointPtr)&box = data.pt = *pt;
memcpy(&box, pt, sizeof(box));
data.pt = *pt;
box.x2 = box.x1 + *width;
box.y2 = box.y1 + 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment