Prepare for transition from xlookup64 to xlookup

* 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.
This commit is contained in:
Дмитрий Левин 2016-05-14 21:46:05 +00:00
parent a8443f8695
commit 9134aab407
10 changed files with 18 additions and 15 deletions

2
defs.h
View File

@ -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);

View File

@ -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 {

View File

@ -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;

View File

@ -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);

2
net.c
View File

@ -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);

View File

@ -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:

View 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

View 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);

View File

@ -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;
}

2
time.c
View File

@ -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;