]> granicus.if.org Git - strace/commitdiff
Rename LONG_LONG to ULONG_LONG and change it to return unsigned long long
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 23 Dec 2016 19:12:38 +0000 (19:12 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 23 Dec 2016 19:26:57 +0000 (19:26 +0000)
In all places where LONG_LONG is used the destination already has type
unsigned long long, so it is quite natural to change LONG_LONG as well.

* defs.h (LONG_LONG): Rename to ULONG_LONG, change return type
from long long to unsigned long long.  All callers updated.

defs.h
lseek.c
signal.c
util.c

diff --git a/defs.h b/defs.h
index 7869f9078b31ac758e2b64a9e2ccd74fa16d84a0..2aea10409ce7618a7c51ac4dce0c12a59adab0ae 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -562,11 +562,11 @@ extern int print_quoted_string(const char *, unsigned int, unsigned int);
  * b refers to the higher numbered u_arg
  */
 #ifdef WORDS_BIGENDIAN
-# define LONG_LONG(a,b) \
-       ((long long)((unsigned long long)(unsigned)(b) | ((unsigned long long)(a)<<32)))
+# define ULONG_LONG(a,b) \
+       ((unsigned long long)(unsigned)(b) | ((unsigned long long)(a)<<32))
 #else
-# define LONG_LONG(a,b) \
-       ((long long)((unsigned long long)(unsigned)(a) | ((unsigned long long)(b)<<32)))
+# define ULONG_LONG(a,b) \
+       ((unsigned long long)(unsigned)(a) | ((unsigned long long)(b)<<32))
 #endif
 extern int getllval(struct tcb *, unsigned long long *, int);
 extern int printllval(struct tcb *, const char *, int)
diff --git a/lseek.c b/lseek.c
index 886d62046f7603af2c225d12a4fc4f4bd2df1d18..f23708e63711f9f6ce169e70a882841d9606a505 100644 (file)
--- a/lseek.c
+++ b/lseek.c
@@ -88,7 +88,7 @@ SYS_FUNC(lseek)
 #endif
 
 /* llseek syscall takes explicitly two ulong arguments hi, lo,
- * rather than one 64-bit argument for which LONG_LONG works
+ * rather than one 64-bit argument for which ULONG_LONG works
  * appropriate for the native byte order.
  *
  * See kernel's fs/read_write.c::SYSCALL_DEFINE5(llseek, ...)
index 9f51440bc4dea139f44d4690df2f102cd4e08f60..dd6fb2d343698416270e205d79fc9d6ffaf77d2c 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -526,7 +526,7 @@ decode_new_sigaction(struct tcb *tcp, long addr)
                 * For little-endian, it's the same.
                 * For big-endian, we swap 32-bit words.
                 */
-               sa.sa_mask[0] = LONG_LONG(sa32.sa_mask[0], sa32.sa_mask[1]);
+               sa.sa_mask[0] = ULONG_LONG(sa32.sa_mask[0], sa32.sa_mask[1]);
        } else
 #endif
        if (umove_or_printaddr(tcp, addr, &sa))
diff --git a/util.c b/util.c
index 4ec43da7950810fc0e5c1b9f93a4149802c36755..69180e6ffc15537c506093fe3adf2af6737c0edb 100644 (file)
--- a/util.c
+++ b/util.c
@@ -303,7 +303,7 @@ getllval(struct tcb *tcp, unsigned long long *val, int arg_no)
                /* Align arg_no to the next even number. */
                arg_no = (arg_no + 1) & 0xe;
 #  endif /* AARCH64 || POWERPC64 */
-               *val = LONG_LONG(tcp->u_arg[arg_no], tcp->u_arg[arg_no + 1]);
+               *val = ULONG_LONG(tcp->u_arg[arg_no], tcp->u_arg[arg_no + 1]);
                arg_no += 2;
        } else
 # endif /* !current_klongsize */
@@ -316,7 +316,7 @@ getllval(struct tcb *tcp, unsigned long long *val, int arg_no)
 #elif HAVE_STRUCT_TCB_EXT_ARG
 # ifndef current_klongsize
        if (current_klongsize < SIZEOF_LONG_LONG) {
-               *val = LONG_LONG(tcp->u_arg[arg_no], tcp->u_arg[arg_no + 1]);
+               *val = ULONG_LONG(tcp->u_arg[arg_no], tcp->u_arg[arg_no + 1]);
                arg_no += 2;
        } else
 # endif /* !current_klongsize */
@@ -342,7 +342,7 @@ getllval(struct tcb *tcp, unsigned long long *val, int arg_no)
        if (arg_no == 3)
                arg_no++;
 # endif /* __ARM_EABI__ || LINUX_MIPSO32 || POWERPC || XTENSA || SH */
-       *val = LONG_LONG(tcp->u_arg[arg_no], tcp->u_arg[arg_no + 1]);
+       *val = ULONG_LONG(tcp->u_arg[arg_no], tcp->u_arg[arg_no + 1]);
        arg_no += 2;
 #endif