]> granicus.if.org Git - strace/commitdiff
Prepare for transition from xlookup64 to xlookup
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 14 May 2016 21:46:05 +0000 (21:46 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 14 May 2016 22:05:06 +0000 (22:05 +0000)
* fcntl.c (print_fcntl, SYS_FUNC(fcntl), SYS_FUNC(fcntl64)):
Cast 2nd argument of xlookup to unsigned long.
* prctl.c (SYS_FUNC(prctl)): Likewise.
* sched.c (SYS_FUNC(sched_getscheduler)): Likewise.
* time.c (do_adjtimex): Likewise.
* ioprio.c (sprint_ioprio): Change type of the argument
and local variables from int to unsigned int.
* keyctl.c (print_keyring_serial_number): Cast 2nd argument
of xlookup to unsigned int.
* net.c (tprint_sock_type): Change type of the argument to unsigned int.
* printmode.c (sprintmode): Likewise.
* printsiginfo.c (printsigval):  Change type of si_code argument
to unsigned int.

defs.h
fcntl.c
ioprio.c
keyctl.c
net.c
prctl.c
printmode.c
printsiginfo.c
sched.c
time.c

diff --git a/defs.h b/defs.h
index a3b1ddaa0e33d08bf373399f2dd85719d64e3f8c..04dcb83c0e8cf831409939f532b1c4b254c1eb7b 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -579,7 +579,7 @@ extern int printargs_d(struct tcb *);
 extern void addflags(const struct xlat *, uint64_t);
 extern int printflags64(const struct xlat *, uint64_t, const char *);
 extern const char *sprintflags64(const char *, const struct xlat *, uint64_t);
-extern const char *sprintmode(int);
+extern const char *sprintmode(unsigned int);
 extern const char *sprinttime(time_t);
 extern void dumpiov_in_msghdr(struct tcb *, long, unsigned long);
 extern void dumpiov_in_mmsghdr(struct tcb *, long);
diff --git a/fcntl.c b/fcntl.c
index 561c164ef14d89376c6d32d9f81e8b352d078399..b30fc17bcd0c9935ea5df3920079b0eeae199afb 100644 (file)
--- a/fcntl.c
+++ b/fcntl.c
@@ -168,7 +168,7 @@ print_fcntl(struct tcb *tcp)
        case F_GETLEASE:
                if (entering(tcp) || syserror(tcp))
                        return 0;
-               tcp->auxstr = xlookup(lockfcmds, tcp->u_rval);
+               tcp->auxstr = xlookup(lockfcmds, (unsigned long) tcp->u_rval);
                return RVAL_HEX | RVAL_STR;
        case F_GET_SEALS:
                if (entering(tcp) || syserror(tcp) || tcp->u_rval == 0)
@@ -192,7 +192,8 @@ SYS_FUNC(fcntl)
        if (entering(tcp)) {
                printfd(tcp, tcp->u_arg[0]);
                tprints(", ");
-               const char *str = xlookup(fcntlcmds, tcp->u_arg[1]);
+               const char *str =
+                       xlookup(fcntlcmds, (unsigned long) tcp->u_arg[1]);
                if (str) {
                        tprints(str);
                } else {
@@ -212,7 +213,8 @@ SYS_FUNC(fcntl64)
        if (entering(tcp)) {
                printfd(tcp, tcp->u_arg[0]);
                tprints(", ");
-               const char *str = xlookup(fcntl64cmds, tcp->u_arg[1]);
+               const char *str =
+                       xlookup(fcntl64cmds, (unsigned long) tcp->u_arg[1]);
                if (str) {
                        tprints(str);
                } else {
index 0a1a5967019d5903472f763501d1bee439358e71..0b83be7ae66644bacd30c3cbd3a93cf03c991e8d 100644 (file)
--- a/ioprio.c
+++ b/ioprio.c
@@ -51,19 +51,19 @@ enum {
 #define IOPRIO_PRIO_DATA(mask) ((mask) & IOPRIO_PRIO_MASK)
 
 static const char *
-sprint_ioprio(int ioprio)
+sprint_ioprio(unsigned int ioprio)
 {
        static char outstr[256];
        const char *str;
-       int class, data;
+       unsigned int class, data;
 
        class = IOPRIO_PRIO_CLASS(ioprio);
        data = IOPRIO_PRIO_DATA(ioprio);
        str = xlookup(ioprio_class, class);
        if (str)
-               sprintf(outstr, "IOPRIO_PRIO_VALUE(%s,%d)", str, data);
+               sprintf(outstr, "IOPRIO_PRIO_VALUE(%s, %d)", str, data);
        else
-               sprintf(outstr, "IOPRIO_PRIO_VALUE(%#x /* %s */,%d)",
+               sprintf(outstr, "IOPRIO_PRIO_VALUE(%#x /* %s */, %d)",
                        class, "IOPRIO_CLASS_???", data);
 
        return outstr;
index 81391a37f33a9fd69e16644bbe57fe9c092b496e..50d6fb482b07af976e75224be64c7d3682fcba52 100644 (file)
--- a/keyctl.c
+++ b/keyctl.c
@@ -34,7 +34,7 @@ typedef int32_t key_serial_t;
 static void
 print_keyring_serial_number(key_serial_t id)
 {
-       const char *str = xlookup(key_spec, id);
+       const char *str = xlookup(key_spec, (unsigned int) id);
 
        if (str)
                tprints(str);
diff --git a/net.c b/net.c
index c34b6aafce9059c6a2543b33f59d9cf8b1179f08..3349758e3503a250860e5c911accfc10f69ea46d 100644 (file)
--- a/net.c
+++ b/net.c
@@ -770,7 +770,7 @@ dumpiov_in_mmsghdr(struct tcb *tcp, long addr)
  * other bits are socket type flags.
  */
 static void
-tprint_sock_type(int flags)
+tprint_sock_type(unsigned int flags)
 {
        const char *str = xlookup(socktypes, flags & SOCK_TYPE_MASK);
 
diff --git a/prctl.c b/prctl.c
index da7d265ba0a536a002a4667cff307e19465d8d2f..4ddd0b9190969f120e1c7f4749de6c7381920268 100644 (file)
--- a/prctl.c
+++ b/prctl.c
@@ -292,7 +292,8 @@ SYS_FUNC(prctl)
                }
                if (syserror(tcp))
                        return 0;
-               tcp->auxstr = xlookup(pr_mce_kill_policy, tcp->u_rval);
+               tcp->auxstr = xlookup(pr_mce_kill_policy,
+                                     (unsigned long) tcp->u_rval);
                return tcp->auxstr ? RVAL_STR : RVAL_UDECIMAL;
 
        case PR_GET_NO_NEW_PRIVS:
index 8ff05fcf93e4b0eb93a204e0e78b9a0c5eafb0af..ad8750782a62aaf6dac699a8ca8d7e67a9274289 100644 (file)
@@ -37,7 +37,7 @@
 #include "xlat/modetypes.h"
 
 const char *
-sprintmode(int mode)
+sprintmode(unsigned int mode)
 {
        static char buf[sizeof("S_IFSOCK|S_ISUID|S_ISGID|S_ISVTX|%o")
                        + sizeof(int)*3
index 3e3fb501fe8a1eb337cf1bd6bd3031fff241ddb8..78508df31abdb7b5adb2e16056d428686a9ca5e2 100644 (file)
@@ -81,7 +81,7 @@ printsigval(const siginfo_t *sip)
 }
 
 static void
-print_si_code(int si_signo, int si_code)
+print_si_code(int si_signo, unsigned int si_code)
 {
        const char *code = xlookup(siginfo_codes, si_code);
 
diff --git a/sched.c b/sched.c
index e193498cb4c1586e90faebfe9920db77887335dc..bdf9707394db9347aaa03e21fa442f2052716ab3 100644 (file)
--- a/sched.c
+++ b/sched.c
@@ -39,7 +39,7 @@ SYS_FUNC(sched_getscheduler)
        if (entering(tcp)) {
                tprintf("%d", (int) tcp->u_arg[0]);
        } else if (!syserror(tcp)) {
-               tcp->auxstr = xlookup(schedulers, tcp->u_rval);
+               tcp->auxstr = xlookup(schedulers, (unsigned long) tcp->u_rval);
                if (tcp->auxstr != NULL)
                        return RVAL_STR;
        }
diff --git a/time.c b/time.c
index 4c218936ac665fb7686aa4f678b9cecadc48d501..963d0ea2a9de3097c6c321855e468a737ce1bf84 100644 (file)
--- a/time.c
+++ b/time.c
@@ -171,7 +171,7 @@ do_adjtimex(struct tcb *tcp, long addr)
 {
        if (print_timex(tcp, addr))
                return 0;
-       tcp->auxstr = xlookup(adjtimex_state, tcp->u_rval);
+       tcp->auxstr = xlookup(adjtimex_state, (unsigned long) tcp->u_rval);
        if (tcp->auxstr)
                return RVAL_STR;
        return 0;