From 848b3ba3ecbf110c168b4f37292bccdc6e3f2531 Mon Sep 17 00:00:00 2001 From: Ben10do Date: Fri, 9 Jun 2017 22:42:05 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20warnings=20about=20assignments=20in=20?= =?UTF-8?q?=E2=80=98if=E2=80=99=20statements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assignments in ‘if’ statements cause a warning in Clang, asking you to enclose the assignment in brackets (to show that it was intentional). --- tools/lzcomp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/lzcomp.c b/tools/lzcomp.c index 1b7b32a5d..c3fae1001 100644 --- a/tools/lzcomp.c +++ b/tools/lzcomp.c @@ -177,11 +177,11 @@ struct command find_best_copy (const unsigned char * data, unsigned short positi struct command simple = {.command = 7}; struct command flipped = simple, backwards = simple; short count, offset; - if (count = scan_forwards(data + position, length - position, data, position, &offset)) + if ((count = scan_forwards(data + position, length - position, data, position, &offset))) simple = (struct command) {.command = 4, .count = count, .value = offset}; - if (count = scan_forwards(data + position, length - position, bitflipped, position, &offset)) + if ((count = scan_forwards(data + position, length - position, bitflipped, position, &offset))) flipped = (struct command) {.command = 5, .count = count, .value = offset}; - if (count = scan_backwards(data, length - position, position, &offset)) + if ((count = scan_backwards(data, length - position, position, &offset))) backwards = (struct command) {.command = 6, .count = count, .value = offset}; struct command command; switch (flags / 24) {