1
0
mirror of https://github.com/cc65/cc65.git synced 2024-09-28 10:55:43 +00:00

Allow type qualifiers before a storage class spec.

git-svn-id: svn://svn.cc65.org/cc65/trunk@3705 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2006-02-17 19:42:40 +00:00
parent cfca3473b8
commit 32164ea8e5

View File

@ -68,7 +68,7 @@
static void ParseTypeSpec (DeclSpec* D, int Default);
static void ParseTypeSpec (DeclSpec* D, int Default, type Qualifiers);
/* Parse a type specificier */
static unsigned ParseInitInternal (type* T, int AllowFlexibleMembers);
@ -331,7 +331,7 @@ static SymEntry* ParseStructDecl (const char* Name, type StructType)
/* Get the type of the entry */
DeclSpec Spec;
InitDeclSpec (&Spec);
ParseTypeSpec (&Spec, -1);
ParseTypeSpec (&Spec, -1, T_QUAL_NONE);
/* Read fields with this type */
while (1) {
@ -403,19 +403,18 @@ static SymEntry* ParseStructDecl (const char* Name, type StructType)
static void ParseTypeSpec (DeclSpec* D, int Default)
static void ParseTypeSpec (DeclSpec* D, int Default, type Qualifiers)
/* Parse a type specificier */
{
ident Ident;
SymEntry* Entry;
type StructType;
type Qualifiers; /* Type qualifiers */
/* Assume we have an explicit type */
D->Flags &= ~DS_DEF_TYPE;
/* Read type qualifiers if we have any */
Qualifiers = OptionalQualifiers (T_QUAL_NONE);
Qualifiers = OptionalQualifiers (Qualifiers);
/* Look at the data type */
switch (CurTok.Tok) {
@ -1088,7 +1087,7 @@ type* ParseType (type* Type)
/* Get a type without a default */
InitDeclSpec (&Spec);
ParseTypeSpec (&Spec, -1);
ParseTypeSpec (&Spec, -1, T_QUAL_NONE);
/* Parse additional declarators */
ParseDecl (&Spec, &Decl, DM_NO_IDENT);
@ -1133,14 +1132,19 @@ void ParseDecl (const DeclSpec* Spec, Declaration* D, unsigned Mode)
void ParseDeclSpec (DeclSpec* D, unsigned DefStorage, int DefType)
/* Parse a declaration specification */
{
type Qualifiers;
/* Initialize the DeclSpec struct */
InitDeclSpec (D);
/* First, get the storage class specifier for this declaration */
/* There may be qualifiers *before* the storage class specifier */
Qualifiers = OptionalQualifiers (T_QUAL_NONE);
/* Now get the storage class specifier for this declaration */
ParseStorageClass (D, DefStorage);
/* Parse the type specifiers */
ParseTypeSpec (D, DefType);
/* Parse the type specifiers passing any initial type qualifiers */
ParseTypeSpec (D, DefType, Qualifiers);
}