[Spice-devel] [PATCH spice-server 06/12] Reuse SPICE_N_ELEMENTS macro

Frediano Ziglio fziglio at redhat.com
Tue Oct 18 09:09:51 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 3784261..f3b8c4b 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