]> granicus.if.org Git - strace/commitdiff
xlat: generate xlat pairs using new XLAT_PAIR macro
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 28 Apr 2016 23:58:34 +0000 (23:58 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 29 Apr 2016 00:15:01 +0000 (00:15 +0000)
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.

xlat.h
xlat/gen.sh

diff --git a/xlat.h b/xlat.h
index 95d9355f68c9b12a68ebd052d70a09cd94275080..2abf909d051ae077bf0144bc57454a86594f833a 100644 (file)
--- 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
index 6fbade9b7a3ea53fd00d83451c26791d91ed3667..4d08f013e9c912c7318909aa23f18b4d4e17f419 100755 (executable)
@@ -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