]> granicus.if.org Git - strace/commitdiff
util: simplify definitions of bit mask constants in umovestr
authorEugene Syromyatnikov <evgsyr@gmail.com>
Thu, 15 Dec 2016 15:51:26 +0000 (18:51 +0300)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 17 Dec 2016 12:06:24 +0000 (12:06 +0000)
* util.c (umovestr): Do not check for SIZEOF_LONG in definitions
of bit mask constants.

util.c

diff --git a/util.c b/util.c
index 9976c76e628afc3e3b1c7ed8cf77de4b926f76bb..289e59d323fa875fc4a8edcd4733b783d6c09c3f 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1250,15 +1250,8 @@ umoven_or_printaddr_ignore_syserror(struct tcb *tcp, const long addr,
 int
 umovestr(struct tcb *tcp, long addr, unsigned int len, char *laddr)
 {
-#if SIZEOF_LONG == 4
-       const unsigned long x01010101 = 0x01010101ul;
-       const unsigned long x80808080 = 0x80808080ul;
-#elif SIZEOF_LONG == 8
-       const unsigned long x01010101 = 0x0101010101010101ul;
-       const unsigned long x80808080 = 0x8080808080808080ul;
-#else
-# error SIZEOF_LONG > 8
-#endif
+       const unsigned long x01010101 = (unsigned long) 0x0101010101010101ULL;
+       const unsigned long x80808080 = (unsigned long) 0x8080808080808080ULL;
 
        int pid = tcp->pid;
        unsigned int n, m, nread;