summary refs log tree commit diff stats
path: root/qemu-char.c
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2013-12-07 14:48:04 +0100
committerMichael Tokarev <mjt@tls.msk.ru>2013-12-23 16:02:19 +0400
commitdff7424dc09635c33b42193fbb40c90fc9a971f4 (patch)
treefda83ed12cf421bf72152cb7683fcf61e5fb2ae3 /qemu-char.c
parent2e0fc3a488ef12c4e0e3ad4e1a07efec3a19169e (diff)
downloadfocaccia-qemu-dff7424dc09635c33b42193fbb40c90fc9a971f4.tar.gz
focaccia-qemu-dff7424dc09635c33b42193fbb40c90fc9a971f4.zip
misc: Use macro ARRAY_SIZE where possible
This improves readability and simplifies the code.

Cc: Anthony Liguori <aliguori@amazon.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'qemu-char.c')
-rw-r--r--qemu-char.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/qemu-char.c b/qemu-char.c
index 418dc69d39..30c5a6afd0 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -1975,8 +1975,7 @@ static void win_stdio_wait_func(void *opaque)
     DWORD              dwSize;
     int                i;
 
-    ret = ReadConsoleInput(stdio->hStdIn, buf, sizeof(buf) / sizeof(*buf),
-                           &dwSize);
+    ret = ReadConsoleInput(stdio->hStdIn, buf, ARRAY_SIZE(buf), &dwSize);
 
     if (!ret) {
         /* Avoid error storm */