ref: 848b3ba3ecbf110c168b4f37292bccdc6e3f2531
parent: cf390243b24724311bb0c4ebedb3c0d493e54c9c
author: Ben10do <Ben10do@users.noreply.github.com>
date: Fri Jun 9 18:42:05 EDT 2017
Fix warnings about assignments in ‘if’ statements Assignments in ‘if’ statements cause a warning in Clang, asking you to enclose the assignment in brackets (to show that it was intentional).
--- a/tools/lzcomp.c
+++ b/tools/lzcomp.c
@@ -177,11 +177,11 @@
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) {