From 5918306fe2d381b4308185d22f5995c199267477 Mon Sep 17 00:00:00 2001 From: uz Date: Fri, 28 Aug 2009 21:34:28 +0000 Subject: [PATCH] Change mode constants for ParseDecl to an enum. git-svn-id: svn://svn.cc65.org/cc65/trunk@4068 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/declare.c | 6 +++--- src/cc65/declare.h | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/cc65/declare.c b/src/cc65/declare.c index d16a095a3..09a3f0020 100644 --- a/src/cc65/declare.c +++ b/src/cc65/declare.c @@ -507,7 +507,7 @@ static SymEntry* ParseStructDecl (const char* Name, TypeCode StructType) } /* Get type and name of the struct field */ - ParseDecl (&Spec, &Decl, 0); + ParseDecl (&Spec, &Decl, DM_NEED_IDENT); /* Get the offset of this field */ Offs = (StructType == T_STRUCT)? StructSize : 0; @@ -1049,7 +1049,7 @@ static FuncDesc* ParseFuncDecl (void) -static void Declarator (const DeclSpec* Spec, Declaration* D, unsigned Mode) +static void Declarator (const DeclSpec* Spec, Declaration* D, declmode_t Mode) /* Recursively process declarators. Build a type array in reverse order. */ { /* Read optional function or pointer qualifiers. These modify the @@ -1213,7 +1213,7 @@ Type* ParseType (Type* T) -void ParseDecl (const DeclSpec* Spec, Declaration* D, unsigned Mode) +void ParseDecl (const DeclSpec* Spec, Declaration* D, declmode_t Mode) /* Parse a variable, type or function declaration */ { /* Initialize the Declaration struct */ diff --git a/src/cc65/declare.h b/src/cc65/declare.h index fb510ef30..eac2897d9 100644 --- a/src/cc65/declare.h +++ b/src/cc65/declare.h @@ -75,9 +75,11 @@ struct Declaration { }; /* Modes for ParseDecl */ -#define DM_NEED_IDENT 0U /* We must have an identifier */ -#define DM_NO_IDENT 1U /* We won't read an identifier */ -#define DM_ACCEPT_IDENT 2U /* We will accept an id if there is one */ +typedef enum { + DM_NEED_IDENT, /* We must have an identifier */ + DM_NO_IDENT, /* We won't read an identifier */ + DM_ACCEPT_IDENT, /* We will accept an id if there is one */ +} declmode_t; @@ -90,7 +92,7 @@ struct Declaration { Type* ParseType (Type* Type); /* Parse a complete type specification */ -void ParseDecl (const DeclSpec* Spec, Declaration* D, unsigned Mode); +void ParseDecl (const DeclSpec* Spec, Declaration* D, declmode_t Mode); /* Parse a variable, type or function declaration */ void ParseDeclSpec (DeclSpec* D, unsigned DefStorage, long DefType); -- 2.39.5