/* */
/* */
/* */
-/* (C) 2000-2001 Ullrich von Bassewitz */
-/* Wacholderweg 14 */
-/* D-70597 Stuttgart */
+/* (C) 2000-2003 Ullrich von Bassewitz */
+/* Römerstrasse 52 */
+/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* */
/* common */
#include "check.h"
+#include "debugflag.h"
#include "hashstr.h"
#include "xmalloc.h"
SymTable* S;
/* New lexical level */
- PRECONDITION (++LexicalLevel == LEX_LEVEL_FUNCTION);
+ ++LexicalLevel;
/* Get a new symbol table and make it current */
S = NewSymTable (SYMTAB_SIZE_FUNCTION);
/* Remember the symbol tables for the level and leave the level without checks */
{
/* Leave the lexical level */
- PRECONDITION (LexicalLevel-- == LEX_LEVEL_FUNCTION);
+ --LexicalLevel;
/* Remember the tables */
F->SymTab = SymTab;
/* Reenter the function lexical level using the existing tables from F */
{
/* New lexical level */
- PRECONDITION (++LexicalLevel == LEX_LEVEL_FUNCTION);
+ ++LexicalLevel;
/* Make the tables current again */
F->SymTab->PrevTab = SymTab;
/* Leave function lexical level */
{
/* Leave the lexical level */
- PRECONDITION (LexicalLevel-- == LEX_LEVEL_FUNCTION);
+ --LexicalLevel;
/* Check the tables */
CheckSymTable (SymTab);
if (IsTypeArray (Type) && IsTypeArray (EType)) {
/* Get the array sizes */
- unsigned Size = Decode (Type + 1);
- unsigned ESize = Decode (EType + 1);
+ long Size = GetElementCount (Type);
+ long ESize = GetElementCount (EType);
- if ((Size != 0 && ESize != 0 && Size != ESize) ||
+ if ((Size != UNSPECIFIED && ESize != UNSPECIFIED && Size != ESize) ||
TypeCmp (Type+DECODE_SIZE+1, EType+DECODE_SIZE+1) < TC_EQUAL) {
/* Types not identical: Conflicting types */
Error ("Conflicting types for `%s'", Name);
return Entry;
} else {
/* Check if we have a size in the existing definition */
- if (ESize == 0) {
+ if (ESize == UNSPECIFIED) {
/* Existing, size not given, use size from new def */
Encode (EType + 1, Size);
}