From: Dmitry V. Levin Date: Fri, 23 Dec 2016 19:12:38 +0000 (+0000) Subject: Rename LONG_LONG to ULONG_LONG and change it to return unsigned long long X-Git-Tag: v4.16~288 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c239ebc31b30aaee1b00c134e74ac427d9a54153;p=strace Rename LONG_LONG to ULONG_LONG and change it to return unsigned long long 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. --- diff --git a/defs.h b/defs.h index 7869f907..2aea1040 100644 --- 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 886d6204..f23708e6 100644 --- 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, ...) diff --git a/signal.c b/signal.c index 9f51440b..dd6fb2d3 100644 --- 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 4ec43da7..69180e6f 100644 --- 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