From: Dmitry V. Levin Date: Fri, 29 Apr 2016 00:03:48 +0000 (+0000) Subject: Introduce XLAT_TYPE and XLAT_TYPE_PAIR macros X-Git-Tag: v4.12~240 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f4982691eaf60f6b23e9f7d02c63ee3b9cb0460;p=strace Introduce XLAT_TYPE and XLAT_TYPE_PAIR macros * xlat.h (XLAT_TYPE): New macro, similar to XLAT but casts to the specified type instead of unsigned int. (XLAT_TYPE_PAIR): New macro, similar to XLAT_PAIR but casts to the specified type instead of unsigned int. --- diff --git a/xlat.h b/xlat.h index 2abf909d..9e68a17a 100644 --- a/xlat.h +++ b/xlat.h @@ -7,6 +7,8 @@ struct xlat { # define XLAT(val) { (unsigned)(val), #val } # define XLAT_PAIR(val, str) { (unsigned)(val), str } +# define XLAT_TYPE(type, val) { (type)(val), #val } +# define XLAT_TYPE_PAIR(val, str) { (type)(val), str } # define XLAT_END { 0, 0 } #endif