Make addflags return void

* defs.h (addflags): Change return type from int to void.
* util.c (addflags): Change return type from int to void.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This commit is contained in:
Denys Vlasenko 2011-08-19 18:06:46 +02:00
parent d9560c1080
commit 4924dbd6d7
2 changed files with 4 additions and 9 deletions

2
defs.h
View File

@ -572,7 +572,7 @@ extern int trace_syscall(struct tcb *);
extern int count_syscall(struct tcb *, struct timeval *); extern int count_syscall(struct tcb *, struct timeval *);
extern void printxval(const struct xlat *, int, const char *); extern void printxval(const struct xlat *, int, const char *);
extern int printargs(struct tcb *); extern int printargs(struct tcb *);
extern int addflags(const struct xlat *, int); extern void addflags(const struct xlat *, int);
extern int printflags(const struct xlat *, int, const char *); extern int printflags(const struct xlat *, int, const char *);
extern const char *sprintflags(const char *, const struct xlat *, int); extern const char *sprintflags(const char *, const struct xlat *, int);
extern int umoven(struct tcb *, long, int, char *); extern int umoven(struct tcb *, long, int, char *);

11
util.c
View File

@ -279,27 +279,22 @@ printllval(struct tcb *tcp, const char *format, int llarg)
* print the entries whose bits are on in `flags' * print the entries whose bits are on in `flags'
* return # of flags printed. * return # of flags printed.
*/ */
int void
addflags(const struct xlat *xlat, int flags) addflags(const struct xlat *xlat, int flags)
{ {
int n; for (; xlat->str; xlat++) {
for (n = 0; xlat->str; xlat++) {
if (xlat->val && (flags & xlat->val) == xlat->val) { if (xlat->val && (flags & xlat->val) == xlat->val) {
tprintf("|%s", xlat->str); tprintf("|%s", xlat->str);
flags &= ~xlat->val; flags &= ~xlat->val;
n++;
} }
} }
if (flags) { if (flags) {
tprintf("|%#x", flags); tprintf("|%#x", flags);
n++;
} }
return n;
} }
/* /*
* Interpret `xlat' as an array of flags/ * Interpret `xlat' as an array of flags.
* Print to static string the entries whose bits are on in `flags' * Print to static string the entries whose bits are on in `flags'
* Return static string. * Return static string.
*/ */