From: Dmitry V. Levin Date: Thu, 28 Apr 2016 23:58:34 +0000 (+0000) Subject: xlat: generate xlat pairs using new XLAT_PAIR macro X-Git-Tag: v4.12~241 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f25b65d63863d0bf8463757062d6d60e8e42caf;p=strace xlat: generate xlat pairs using new XLAT_PAIR macro Before this change there were two forms of xlat entries: those that use XLAT or XLAT_END macros, and others verbatim entries. This change converts the latter to use new XLAT_PAIR macro. This is necessary for the upcoming change of xlat.val type. * xlat.h (XLAT_PAIR): New macro. * xlat/gen.sh (cond_xlat, gen_header): Use it. --- diff --git a/xlat.h b/xlat.h index 95d9355f..2abf909d 100644 --- a/xlat.h +++ b/xlat.h @@ -6,6 +6,7 @@ struct xlat { }; # define XLAT(val) { (unsigned)(val), #val } +# define XLAT_PAIR(val, str) { (unsigned)(val), str } # define XLAT_END { 0, 0 } #endif diff --git a/xlat/gen.sh b/xlat/gen.sh index 6fbade9b..4d08f013 100755 --- a/xlat/gen.sh +++ b/xlat/gen.sh @@ -73,7 +73,7 @@ cond_xlat() xlat=" XLAT(${val})," else m="${m#1<<}" - xlat=" { ${val}, \"${m}\" }," + xlat=" XLAT_PAIR(${val}, \"${m}\")," fi if [ -z "${def}" ]; then @@ -177,7 +177,7 @@ gen_header() ;; '1<<'[A-Z_]*) # symbolic constants with shift if [ -n "${unconditional}" ]; then - echo " { ${line}, \"${line#1<<}\" }," + echo " XLAT_PAIR(${line}, \"${line#1<<}\")," else cond_xlat "${line}" fi