1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-05 06:28:57 +00:00

Fixed two errors, skip to end of line in case of an error

git-svn-id: svn://svn.cc65.org/cc65/trunk@2887 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2004-03-02 17:24:30 +00:00
parent 56715084b8
commit 9d46a42600

View File

@ -77,7 +77,7 @@ static long Member (long AllocSize)
if (Tok != TOK_SEP) { if (Tok != TOK_SEP) {
Multiplicator = ConstExpression (); Multiplicator = ConstExpression ();
if (Multiplicator <= 0) { if (Multiplicator <= 0) {
Error ("Range error"); ErrorSkip ("Range error");
Multiplicator = 1; Multiplicator = 1;
} }
AllocSize *= Multiplicator; AllocSize *= Multiplicator;
@ -85,7 +85,7 @@ static long Member (long AllocSize)
/* Check the size for a reasonable value */ /* Check the size for a reasonable value */
if (AllocSize >= 0x10000) { if (AllocSize >= 0x10000) {
Error ("Range error"); ErrorSkip ("Range error");
} }
/* Return the size */ /* Return the size */
@ -161,8 +161,9 @@ static long DoStructInternal (long Offs, unsigned Type)
break; break;
case TOK_RES: case TOK_RES:
NextTok ();
if (Tok == TOK_SEP) { if (Tok == TOK_SEP) {
Error ("Size is missing"); ErrorSkip ("Size is missing");
} else { } else {
MemberSize = Member (1); MemberSize = Member (1);
} }
@ -172,16 +173,16 @@ static long DoStructInternal (long Offs, unsigned Type)
NextTok (); NextTok ();
Struct = ParseScopedSymTable (); Struct = ParseScopedSymTable ();
if (Struct == 0) { if (Struct == 0) {
Error ("Unknown struct/union"); ErrorSkip ("Unknown struct/union");
} else if (GetSymTabType (Struct) != ST_STRUCT) { } else if (GetSymTabType (Struct) != ST_STRUCT) {
Error ("Not a struct/union"); ErrorSkip ("Not a struct/union");
} else { } else {
SymEntry* SizeSym = GetSizeOfScope (Struct); SymEntry* SizeSym = GetSizeOfScope (Struct);
if (!SymIsDef (SizeSym) || !SymIsConst (SizeSym, &MemberSize)) { if (!SymIsDef (SizeSym) || !SymIsConst (SizeSym, &MemberSize)) {
Error ("Size of struct/union is unknown"); ErrorSkip ("Size of struct/union is unknown");
} }
} }
MemberSize *= Member (MemberSize); MemberSize = Member (MemberSize);
break; break;
case TOK_STRUCT: case TOK_STRUCT: