]> granicus.if.org Git - strace/commitdiff
Replace "(unsigned long) -1L" with -1UL
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 18 Dec 2016 14:09:51 +0000 (14:09 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 18 Dec 2016 14:09:51 +0000 (14:09 +0000)
* 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.

defs.h
io.c
msghdr.c
poll.c
syscall.c

diff --git a/defs.h b/defs.h
index 0af7c888b2862ecde1b2ee5f7540c1376096fb67..8af37dcb02c3cd92d69e26abf7722f97bd9ff299 100644 (file)
--- 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 fe865a5dfe12dc88a6c8d0d045628bb881220e3f..45c553e0828a2408da0b3e3035ca01c012fd6d78 100644 (file)
--- 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)
index 63f5171457e50d744f66b470ab65af029e357139..2f28a0a6dac2a5edd0b39243261eb0c7b6cb18f9 100644 (file)
--- 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 b66c46d8a0019a7d854166c15a741fef1b4ed6ac..52c46eff41fc96315d92df76fcde66e2948862e1 100644 (file)
--- 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];
index 03dc350ab0df9340202c1777f4a7d9855edc59d9..d76c4a167c3545e74def5181b2cb10f896faee9a 100644 (file)
--- 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]);