[Spice-devel] [PATCH spice-streaming-agent] Make evaluation order more readable

Frediano Ziglio fziglio at redhat.com
Mon Feb 19 13:26:01 UTC 2018


As a first sight the XXX = YYY != 0 syntax can be confusing,
add parenthesis to make clear the order.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 src/spice-streaming-agent.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp
index 4ec5e42..e01de6c 100644
--- a/src/spice-streaming-agent.cpp
+++ b/src/spice-streaming-agent.cpp
@@ -112,7 +112,7 @@ static int read_command_from_device(void)
                n, hdr.size);
         return -1;
     }
-    streaming_requested = msg[0] != 0; /* num_codecs */
+    streaming_requested = (msg[0] != 0); /* num_codecs */
     syslog(LOG_INFO, "GOT START_STOP message -- request to %s streaming\n",
            streaming_requested ? "START" : "STOP");
     client_codecs.clear();
-- 
2.14.3



More information about the Spice-devel mailing list