summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2016-04-03 16:12:16 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-04-04 09:11:18 +0200
commit3b237c82da5620289481e4cea9751d40a25c1ff7 (patch)
treeb21b1b9b7dfd708f057905f3c0c3175c3b8e144f
parent2fdebbcabc5416c8b4e895c4a439748050ff1259 (diff)
Fix use of stringize in lexxer.l
The fields instr and outstr should be set to a string and not to the stringified number represented by the string. This improves the readability of mig stubs code that creates mach_msg_type_t values for messages. * lexxer.l: Inline stringize in TPRETURN and TRETURN.
-rw-r--r--lexxer.l16
1 files changed, 11 insertions, 5 deletions
diff --git a/lexxer.l b/lexxer.l
index bd7a718..9579522 100644
--- a/lexxer.l
+++ b/lexxer.l
@@ -53,8 +53,6 @@ FileName ({QString}|{AString})
/* We do not need the input function. */
#define YY_NO_INPUT
-#define stringize(x) #x
-
#ifdef LDEBUG
#define RETURN(sym) \
{ \
@@ -68,14 +66,22 @@ FileName ({QString}|{AString})
#define TPRETURN(intype, outtype, tsize) \
{ \
yylval.symtype.innumber = (intype); \
- yylval.symtype.instr = stringize(intype); \
+ yylval.symtype.instr = #intype; \
yylval.symtype.outnumber = (outtype); \
- yylval.symtype.outstr = stringize(outtype); \
+ yylval.symtype.outstr = #outtype; \
yylval.symtype.size = (tsize); \
RETURN(sySymbolicType); \
}
-#define TRETURN(type, tsize) TPRETURN(type,type,tsize)
+#define TRETURN(type, tsize) \
+{ \
+ yylval.symtype.innumber = (type); \
+ yylval.symtype.instr = #type; \
+ yylval.symtype.outnumber = (type); \
+ yylval.symtype.outstr = #type; \
+ yylval.symtype.size = (tsize); \
+ RETURN(sySymbolicType); \
+}
#define FRETURN(val) \
{ \