summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-06-22 13:04:16 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2017-08-31 12:29:07 +0200
commit5a3804db616634779be8e5ebcc6409c2bd9b58b5 (patch)
tree458812e563dc6557d97f9884bf0cd8025f7b7ced /ui
parent17fc7e93fd0c819d6ffd0a872930b0d2653ca170 (diff)
vnc: use QEMU_ALIGN_DOWN
I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'ui')
-rw-r--r--ui/vnc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/vnc.c b/ui/vnc.c
index 651cbb8606..2c1c0cb5ed 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -2624,8 +2624,8 @@ static int vnc_refresh_lossy_rect(VncDisplay *vd, int x, int y)
int stx = x / VNC_STAT_RECT;
int has_dirty = 0;
- y = y / VNC_STAT_RECT * VNC_STAT_RECT;
- x = x / VNC_STAT_RECT * VNC_STAT_RECT;
+ y = QEMU_ALIGN_DOWN(y, VNC_STAT_RECT);
+ x = QEMU_ALIGN_DOWN(x, VNC_STAT_RECT);
QTAILQ_FOREACH(vs, &vd->clients, next) {
int j;
@@ -2714,8 +2714,8 @@ double vnc_update_freq(VncState *vs, int x, int y, int w, int h)
double total = 0;
int num = 0;
- x = (x / VNC_STAT_RECT) * VNC_STAT_RECT;
- y = (y / VNC_STAT_RECT) * VNC_STAT_RECT;
+ x = QEMU_ALIGN_DOWN(x, VNC_STAT_RECT);
+ y = QEMU_ALIGN_DOWN(y, VNC_STAT_RECT);
for (j = y; j <= y + h; j += VNC_STAT_RECT) {
for (i = x; i <= x + w; i += VNC_STAT_RECT) {