Improve code readability by avoiding assignments inside if()
* desc.c (decode_select): Move assignment out of if() condition.
* file.c (sprinttime): Likewise.
(sys_getdirentries): Likewise.
* io.c (sys_ioctl): Likewise.
* strace.c (test_ptrace_setoptions_followfork): Likewise.
(main): Likewise.
(proc_open): Likewise.
(detach): Likewise.
(proc_poll): Likewise.
(trace): Likewise.
* syscall.c (qualify): Likewise.
(sys_indir): Likewise.
* test/procpollable.c (main): Likewise.
* test/sfd.c (main): Likewise.
* time.c (printtv_bitness): Likewise.
(sprinttv): Likewise.
(print_timespec): Likewise.
(void sprint_timespec): Likewise.
(printitv_bitness): Likewise.
* util.c (dumpstr): Likewise.
(umovestr): Likewise.
(fixvfork): Likewise.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
diff --git a/io.c b/io.c
index 7f2f243..e3cad66 100644
--- a/io.c
+++ b/io.c
@@ -434,8 +434,8 @@
ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]);
}
else {
- int ret;
- if (!(ret = ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2])))
+ int ret = ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ if (!ret)
tprintf(", %#lx", tcp->u_arg[2]);
else
return ret - 1;