Introduce printflags64 function
This is necessary for the upcoming change of xlat.val type.
* defs.h (printflags): Rename to printflags64, change type of integer
argument to uint64_t.
(printflags): New static inline function.
* util.c (printflags): Rename to printflags64, change type of integer
argument to uint64_t. Print it using PRIx64 format.
Based on patch by Jeff Mahoney <jeffm@suse.com>.
diff --git a/defs.h b/defs.h
index 33de96f..eec0228 100644
--- a/defs.h
+++ b/defs.h
@@ -556,7 +556,7 @@
extern int printargs_d(struct tcb *);
extern void addflags(const struct xlat *, uint64_t);
-extern int printflags(const struct xlat *, int, const char *);
+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 *sprinttime(time_t);
@@ -672,6 +672,12 @@
return sprintflags64(prefix, x, flags);
}
+static inline int
+printflags(const struct xlat *x, unsigned int flags, const char *dflt)
+{
+ return printflags64(x, flags, dflt);
+}
+
static inline void
printxval64(const struct xlat *x, const uint64_t val, const char *dflt)
{
diff --git a/util.c b/util.c
index 671f475..a9bce99 100644
--- a/util.c
+++ b/util.c
@@ -356,7 +356,7 @@
}
int
-printflags(const struct xlat *xlat, int flags, const char *dflt)
+printflags64(const struct xlat *xlat, uint64_t flags, const char *dflt)
{
int n;
const char *sep;
@@ -378,12 +378,12 @@
if (n) {
if (flags) {
- tprintf("%s%#x", sep, flags);
+ tprintf("%s%#" PRIx64, sep, flags);
n++;
}
} else {
if (flags) {
- tprintf("%#x", flags);
+ tprintf("%#" PRIx64, flags);
if (dflt)
tprintf(" /* %s */", dflt);
} else {