From: Dmitry V. Levin Date: Sun, 18 Dec 2016 14:09:51 +0000 (+0000) Subject: Replace "(unsigned long) -1L" with -1UL X-Git-Tag: v4.16~344 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f0ba3723f50e749a2b634ab082ddab2a73e0859a;p=strace Replace "(unsigned long) -1L" with -1UL * defs.h (dumpiov): Replace "(unsigned long) -1L" with -1UL. * io.c (print_iovec, tprint_iov): Likewise. * msghdr.c (SYS_FUNC(sendmsg)): Likewise. * syscall.c (dumpio): Likewise. * poll.c (decode_poll_exiting): Replace "(unsigned int) -1" with -1U. --- diff --git a/defs.h b/defs.h index 0af7c888..8af37dcb 100644 --- a/defs.h +++ b/defs.h @@ -592,7 +592,7 @@ extern void dumpiov_in_msghdr(struct tcb *, long, unsigned long); extern void dumpiov_in_mmsghdr(struct tcb *, long); extern void dumpiov_upto(struct tcb *, int, long, unsigned long); #define dumpiov(tcp, len, addr) \ - dumpiov_upto((tcp), (len), (addr), (unsigned long) -1L) + dumpiov_upto((tcp), (len), (addr), -1UL) extern void dumpstr(struct tcb *, long, int); extern void printstr_ex(struct tcb *, long addr, long len, unsigned int user_style); diff --git a/io.c b/io.c index fe865a5d..45c553e0 100644 --- a/io.c +++ b/io.c @@ -85,14 +85,14 @@ print_iovec(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) case IOV_DECODE_STR: if (len > c->data_size) len = c->data_size; - if (c->data_size != (unsigned long) -1L) + if (c->data_size != -1UL) c->data_size -= len; printstr(tcp, iov[0], len); break; case IOV_DECODE_NETLINK: if (len > c->data_size) len = c->data_size; - if (c->data_size != (unsigned long) -1L) + if (c->data_size != -1UL) c->data_size -= len; decode_netlink(tcp, iov[0], iov[1]); break; @@ -126,7 +126,7 @@ void tprint_iov(struct tcb *tcp, unsigned long len, unsigned long addr, enum iov_decode decode_iov) { - tprint_iov_upto(tcp, len, addr, decode_iov, (unsigned long) -1L); + tprint_iov_upto(tcp, len, addr, decode_iov, -1UL); } SYS_FUNC(readv) diff --git a/msghdr.c b/msghdr.c index 63f51714..2f28a0a6 100644 --- a/msghdr.c +++ b/msghdr.c @@ -402,7 +402,7 @@ SYS_FUNC(sendmsg) { printfd(tcp, tcp->u_arg[0]); tprints(", "); - decode_msghdr(tcp, 0, tcp->u_arg[1], (unsigned long) -1L); + decode_msghdr(tcp, 0, tcp->u_arg[1], -1UL); /* flags */ tprints(", "); printflags(msg_flags, tcp->u_arg[2], "MSG_???"); diff --git a/poll.c b/poll.c index b66c46d8..52c46eff 100644 --- a/poll.c +++ b/poll.c @@ -68,7 +68,7 @@ decode_poll_exiting(struct tcb *tcp, const long pts) const unsigned long start = tcp->u_arg[0]; const unsigned long end = start + size; const unsigned long max_printed = - abbrev(tcp) ? max_strlen : (unsigned int) -1; + abbrev(tcp) ? max_strlen : -1U; unsigned long printed, cur; static char outstr[1024]; diff --git a/syscall.c b/syscall.c index 03dc350a..d76c4a16 100644 --- a/syscall.c +++ b/syscall.c @@ -478,8 +478,7 @@ dumpio(struct tcb *tcp) dumpiov(tcp, tcp->u_arg[2], tcp->u_arg[1]); break; case SEN_sendmsg: - dumpiov_in_msghdr(tcp, tcp->u_arg[1], - (unsigned long) -1L); + dumpiov_in_msghdr(tcp, tcp->u_arg[1], -1UL); break; case SEN_sendmmsg: dumpiov_in_mmsghdr(tcp, tcp->u_arg[1]);