aboutsummaryrefslogtreecommitdiff
path: root/ui/vnc-enc-tight.c
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
commit659c90eed8f2667febc1fd1f6473799ab6a45fb6 (patch)
tree7846a24bc1bf4d1204a59cc96915750151f6dcc6 /ui/vnc-enc-tight.c
parent78ee96de6486ab9ff5c38145b55d5fc7de43dd77 (diff)
downloadqemu-659c90eed8f2667febc1fd1f6473799ab6a45fb6.zip
qemu-659c90eed8f2667febc1fd1f6473799ab6a45fb6.tar.gz
qemu-659c90eed8f2667febc1fd1f6473799ab6a45fb6.tar.bz2
vnc: use DIV_ROUND_UP
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/vnc-enc-tight.c')
-rw-r--r--ui/vnc-enc-tight.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c
index 89ab12c..f38aceb 100644
--- a/ui/vnc-enc-tight.c
+++ b/ui/vnc-enc-tight.c
@@ -979,7 +979,7 @@ static int send_mono_rect(VncState *vs, int x, int y,
}
#endif
- bytes = ((w + 7) / 8) * h;
+ bytes = (DIV_ROUND_UP(w, 8)) * h;
vnc_write_u8(vs, (stream | VNC_TIGHT_EXPLICIT_FILTER) << 4);
vnc_write_u8(vs, VNC_TIGHT_FILTER_PALETTE);