[Spice-devel] [PATCH spice-server v2 6/8] Reuse SPICE_N_ELEMENTS macro
Frediano Ziglio
fziglio at redhat.com
Fri Oct 14 13:01:11 UTC 2016
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
server/red-worker.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/server/red-worker.c b/server/red-worker.c
index 1469f4a..2c9b697 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -407,11 +407,11 @@ static void guest_set_client_capabilities(RedWorker *worker)
red_qxl_set_client_capabilities(worker->qxl, FALSE, caps);
} else {
// Take least common denominator
- for (i = 0 ; i < sizeof(caps_available) / sizeof(caps_available[0]); ++i) {
+ for (i = 0 ; i < SPICE_N_ELEMENTS(caps_available); ++i) {
SET_CAP(caps, caps_available[i]);
}
FOREACH_CLIENT(worker->display_channel, iter, rcc) {
- for (i = 0 ; i < sizeof(caps_available) / sizeof(caps_available[0]); ++i) {
+ for (i = 0 ; i < SPICE_N_ELEMENTS(caps_available); ++i) {
if (!red_channel_client_test_remote_cap(rcc, caps_available[i]))
CLEAR_CAP(caps, caps_available[i]);
}
--
2.7.4
More information about the Spice-devel
mailing list