Revision 1229e46d3cfe61ee0b11f08fbbc7530af1578637 authored by Peter Maydell on 16 October 2018, 17:09:38 UTC, committed by Kevin Wolf on 05 November 2018, 14:09:54 UTC
Taking the address of a field in a packed struct is a bad idea, because
it might not be actually aligned enough for that pointer type (and
thus cause a crash on dereference on some host architectures). Newer
versions of clang warn about this. Avoid the bug by not using the
"modify in place" byte swapping functions.

There are a few places where the in-place swap function is
used on something other than a packed struct field; we convert
those anyway, for consistency.

Patch produced with scripts/coccinelle/inplace-byteswaps.cocci.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
1 parent c317b64
History
File Mode Size
keycodemapdb @ 6b3d716
shader
Makefile.objs -rw-r--r-- 1.9 KB
cocoa.m -rw-r--r-- 60.4 KB
console-gl.c -rw-r--r-- 4.6 KB
console.c -rw-r--r-- 66.3 KB
curses.c -rw-r--r-- 12.9 KB
curses_keys.h -rw-r--r-- 13.9 KB
cursor.c -rw-r--r-- 6.7 KB
cursor_hidden.xpm -rw-r--r-- 1.3 KB
cursor_left_ptr.xpm -rw-r--r-- 1.4 KB
egl-context.c -rw-r--r-- 1.3 KB
egl-headless.c -rw-r--r-- 6.1 KB
egl-helpers.c -rw-r--r-- 13.5 KB
gtk-egl.c -rw-r--r-- 8.2 KB
gtk-gl-area.c -rw-r--r-- 6.0 KB
gtk.c -rw-r--r-- 70.0 KB
input-keymap.c -rw-r--r-- 2.6 KB
input-legacy.c -rw-r--r-- 8.0 KB
input-linux.c -rw-r--r-- 12.2 KB
input.c -rw-r--r-- 17.2 KB
keymaps.c -rw-r--r-- 7.4 KB
keymaps.h -rw-r--r-- 2.2 KB
qemu-pixman.c -rw-r--r-- 7.5 KB
qemu-x509.h -rw-r--r-- 239 bytes
sdl.c -rw-r--r-- 29.9 KB
sdl2-2d.c -rw-r--r-- 5.3 KB
sdl2-gl.c -rw-r--r-- 7.7 KB
sdl2-input.c -rw-r--r-- 3.2 KB
sdl2.c -rw-r--r-- 25.5 KB
sdl_keysym.h -rw-r--r-- 8.6 KB
sdl_zoom.c -rw-r--r-- 2.8 KB
sdl_zoom.h -rw-r--r-- 578 bytes
sdl_zoom_template.h -rw-r--r-- 6.9 KB
shader.c -rw-r--r-- 5.2 KB
spice-core.c -rw-r--r-- 27.2 KB
spice-display.c -rw-r--r-- 37.5 KB
spice-input.c -rw-r--r-- 7.6 KB
trace-events -rw-r--r-- 7.6 KB
vgafont.h -rw-r--r-- 93.3 KB
vnc-auth-sasl.c -rw-r--r-- 19.5 KB
vnc-auth-sasl.h -rw-r--r-- 2.3 KB
vnc-auth-vencrypt.c -rw-r--r-- 5.2 KB
vnc-auth-vencrypt.h -rw-r--r-- 1.4 KB
vnc-enc-hextile-template.h -rw-r--r-- 4.5 KB
vnc-enc-hextile.c -rw-r--r-- 2.7 KB
vnc-enc-tight.c -rw-r--r-- 61.6 KB
vnc-enc-tight.h -rw-r--r-- 8.3 KB
vnc-enc-zlib.c -rw-r--r-- 4.4 KB
vnc-enc-zrle.c -rw-r--r-- 10.3 KB
vnc-enc-zrle.h -rw-r--r-- 1.6 KB
vnc-enc-zrle.inc.c -rw-r--r-- 7.0 KB
vnc-enc-zywrle-template.c -rw-r--r-- 5.8 KB
vnc-enc-zywrle.h -rw-r--r-- 25.3 KB
vnc-jobs.c -rw-r--r-- 9.5 KB
vnc-jobs.h -rw-r--r-- 2.2 KB
vnc-palette.c -rw-r--r-- 4.3 KB
vnc-palette.h -rw-r--r-- 2.5 KB
vnc-stubs.c -rw-r--r-- 494 bytes
vnc-ws.c -rw-r--r-- 3.9 KB
vnc-ws.h -rw-r--r-- 1.1 KB
vnc.c -rw-r--r-- 120.4 KB
vnc.h -rw-r--r-- 18.8 KB
vnc_keysym.h -rw-r--r-- 40.1 KB
x_keymap.c -rw-r--r-- 3.4 KB
x_keymap.h -rw-r--r-- 1.3 KB

back to top