]> granicus.if.org Git - strace/commitdiff
defs.h: add shorthands for printing xval with XLAT_STYLE_FMT_U
authorEugene Syromyatnikov <evgsyr@gmail.com>
Wed, 4 Apr 2018 11:22:52 +0000 (13:22 +0200)
committerEugene Syromyatnikov <evgsyr@gmail.com>
Thu, 12 Apr 2018 23:00:10 +0000 (01:00 +0200)
* defs.h (printxval_u, printxval64_u): New function, a shorthand for
printxvals_ex with a single xlat and XLAT_STYLE_FMT_U as a style.

defs.h

diff --git a/defs.h b/defs.h
index b53910a5f2908a8ef99e32df21902de4bc46ea89..22ccd3dde4255447424073b6d08e1d84561eab75 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -854,6 +854,18 @@ printxval(const struct xlat *x, const unsigned int val, const char *dflt)
        return printxvals(val, dflt, x, NULL);
 }
 
+static inline int
+printxval64_u(const struct xlat *x, const uint64_t val, const char *dflt)
+{
+       return printxvals_ex(val, dflt, XLAT_STYLE_FMT_U, x, NULL);
+}
+
+static inline int
+printxval_u(const struct xlat *x, const unsigned int val, const char *dflt)
+{
+       return printxvals_ex(val, dflt, XLAT_STYLE_FMT_U, x, NULL);
+}
+
 static inline void
 tprint_iov(struct tcb *tcp, kernel_ulong_t len, kernel_ulong_t addr,
           enum iov_decode decode_iov)