From 09fb49c546d20b3613b2fe717e64dc348be28369 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 6 Jan 2010 15:18:19 -0300 Subject: [PATCH] Merge DMD r248: implement Denis Koroskin's macro suggestion --- dmd/lexer.c | 2 +- dmd/lexer.h | 8 ++++---- dmd/mars.c | 2 +- dmd/parse.c | 12 ++++++------ 4 files changed, 12 insertions(+), 12 deletions(-) --- dmd/lexer.c | 2 +- dmd/lexer.h | 8 ++++---- dmd/mars.c | 2 +- dmd/parse.c | 12 ++++++------ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dmd/lexer.c b/dmd/lexer.c index 25a5fbb1..f586c715 100644 --- a/dmd/lexer.c +++ b/dmd/lexer.c @@ -210,7 +210,7 @@ const char *Token::toChars() case TOKenum: case TOKstruct: case TOKimport: - CASE_BASIC_TYPES: + case BASIC_TYPES: p = ident->toChars(); break; diff --git a/dmd/lexer.h b/dmd/lexer.h index 7a95c22d..e32b870c 100644 --- a/dmd/lexer.h +++ b/dmd/lexer.h @@ -171,8 +171,8 @@ enum TOK TOKMAX }; -#define CASE_BASIC_TYPES \ - case TOKwchar: case TOKdchar: \ +#define BASIC_TYPES \ + TOKwchar: case TOKdchar: \ case TOKbit: case TOKbool: case TOKchar: \ case TOKint8: case TOKuns8: \ case TOKint16: case TOKuns16: \ @@ -183,8 +183,8 @@ enum TOK case TOKcomplex32: case TOKcomplex64: case TOKcomplex80: \ case TOKvoid -#define CASE_BASIC_TYPES_X(t) \ - case TOKvoid: t = Type::tvoid; goto LabelX; \ +#define BASIC_TYPES_X(t) \ + TOKvoid: t = Type::tvoid; goto LabelX; \ case TOKint8: t = Type::tint8; goto LabelX; \ case TOKuns8: t = Type::tuns8; goto LabelX; \ case TOKint16: t = Type::tint16; goto LabelX; \ diff --git a/dmd/mars.c b/dmd/mars.c index fa26bff0..8834dcc3 100644 --- a/dmd/mars.c +++ b/dmd/mars.c @@ -58,7 +58,7 @@ Global::Global() copyright = "Copyright (c) 1999-2009 by Digital Mars and Tomas Lindquist Olsen"; written = "written by Walter Bright and Tomas Lindquist Olsen"; - version = "v1.052"; + version = "v1.053"; ldc_version = LDC_REV; llvm_version = LLVM_REV_STR; global.structalign = 8; diff --git a/dmd/parse.c b/dmd/parse.c index add442e3..c658dfb5 100644 --- a/dmd/parse.c +++ b/dmd/parse.c @@ -195,7 +195,7 @@ Array *Parser::parseDeclDefs(int once) break; } - CASE_BASIC_TYPES: + case BASIC_TYPES: case TOKalias: case TOKtypedef: case TOKidentifier: @@ -1778,7 +1778,7 @@ Type *Parser::parseBasicType() //printf("parseBasicType()\n"); switch (token.value) { - CASE_BASIC_TYPES_X(t): + case BASIC_TYPES_X(t): nextToken(); break; @@ -2837,7 +2837,7 @@ Statement *Parser::parseStatement(int flags) goto Ldeclaration; } - CASE_BASIC_TYPES: + case BASIC_TYPES: case TOKtypedef: case TOKalias: case TOKconst: @@ -3630,7 +3630,7 @@ int Parser::isBasicType(Token **pt) switch (t->value) { - CASE_BASIC_TYPES: + case BASIC_TYPES: t = peek(t); break; @@ -4270,7 +4270,7 @@ Expression *Parser::parsePrimaryExp() break; } - CASE_BASIC_TYPES_X(t): + case BASIC_TYPES_X(t): nextToken(); L1: check(TOKdot, t->toChars()); @@ -4766,7 +4766,7 @@ Expression *Parser::parseUnaryExp() case TOKfile: case TOKline: #endif - CASE_BASIC_TYPES: // (type)int.size + case BASIC_TYPES: // (type)int.size { // (type) una_exp Type *t;