1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-03 06:29:36 +00:00

Change mode constants for ParseDecl to an enum.

git-svn-id: svn://svn.cc65.org/cc65/trunk@4068 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2009-08-28 21:34:28 +00:00
parent 73e2a72a2a
commit 5918306fe2
2 changed files with 9 additions and 7 deletions

View File

@ -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 */

View File

@ -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);