]> git.sur5r.net Git - cc65/commitdiff
Rename symbol index => import id because that's what it really is.
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 17 Aug 2010 20:01:54 +0000 (20:01 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 17 Aug 2010 20:01:54 +0000 (20:01 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@4809 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/ca65/expr.c
src/ca65/symentry.c
src/ca65/symentry.h
src/ca65/symtab.c

index 56d728e9cb31e5c14c6339c25861101727d220af..81465c687b9ad7d64d328a13cb10ccbb15663e8e 100644 (file)
@@ -1769,7 +1769,7 @@ void WriteExpr (ExprNode* Expr)
         case EXPR_SYMBOL:
            if (SymIsImport (Expr->V.Sym)) {
                 ObjWrite8 (EXPR_SYMBOL);
-                ObjWriteVar (GetSymIndex (Expr->V.Sym));
+                ObjWriteVar (GetSymImportId (Expr->V.Sym));
             } else {
                 WriteExpr (GetSymExpr (Expr->V.Sym));
             }
index 7bae7e019a43ead8f1697ceea7e7ffd117749afa..cc6bfff6cee500a77812220d3b4adc8a07669982 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2008 Ullrich von Bassewitz                                       */
-/*               Roemerstrasse 52                                            */
-/*               D-70794 Filderstadt                                         */
-/* EMail:        uz@cc65.org                                                 */
+/* (C) 1998-2010, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -90,6 +90,7 @@ SymEntry* NewSymEntry (const StrBuf* Name, unsigned Flags)
         S->GuessedUse[I] = 0;
     }
     S->Flags             = Flags;
+    S->ImportId   = ~0U;
     S->Expr       = 0;
     S->ExprRefs   = AUTO_COLLECTION_INITIALIZER;
     S->ExportSize = ADDR_SIZE_DEFAULT;
@@ -662,11 +663,11 @@ long GetSymVal (SymEntry* S)
 
 
 
-unsigned GetSymIndex (const SymEntry* S)
-/* Return the symbol index for the given symbol */
+unsigned GetSymImportId (const SymEntry* S)
+/* Return the import id for the given symbol */
 {
-    PRECONDITION (S != 0 && (S->Flags & SF_INDEXED) != 0);
-    return S->Index;
+    PRECONDITION (S != 0 && (S->Flags & SF_IMPORT) && S->ImportId != ~0U);
+    return S->ImportId;
 }
 
 
index 36ea6aed361c00fc9c6a8ebfc075212f72404ede..8442b5243f4c86739d6526adf0cdfb51fef2f674 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2008 Ullrich von Bassewitz                                       */
-/*               Roemerstrasse 52                                            */
-/*               D-70794 Filderstadt                                         */
-/* EMail:        uz@cc65.org                                                 */
+/* (C) 1998-2010, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -95,7 +95,7 @@ struct SymEntry {
                                          * addressing
                                          */
     unsigned            Flags;         /* Symbol flags */
-    unsigned           Index;          /* Index of import/export entries */
+    unsigned                   ImportId;       /* Id if imported symbol */
     struct ExprNode*    Expr;          /* Symbol expression */
     Collection          ExprRefs;       /* Expressions using this symbol */
     unsigned char       ExportSize;     /* Export address size */
@@ -335,8 +335,8 @@ long GetSymVal (SymEntry* Sym);
  * in case the symbol is undefined or not constant.
  */
 
-unsigned GetSymIndex (const SymEntry* Sym);
-/* Return the symbol index for the given symbol */
+unsigned GetSymImportId (const SymEntry* Sym);
+/* Return the import id for the given symbol */
 
 #if defined(HAVE_INLINE)
 INLINE const FilePos* GetSymPos (const SymEntry* S)
index 593b5d52010bd377b10b3232caaa09166c1cb845..d87661a61ce817d87c2421852471dba3a32e8d4f 100644 (file)
@@ -581,17 +581,14 @@ void SymCheck (void)
                               "Symbol `%m%p' is imported but never used",
                               GetSymName (S));
                } else {
-                   /* Give the import an index, count imports */
-                   S->Index = ImportCount++;
-                   S->Flags |= SF_INDEXED;
+                   /* Give the import an id, count imports */
+                   S->ImportId = ImportCount++;
                }
            }
 
-            /* Assign an index to all exports */
+            /* Count exports */
            if (S->Flags & SF_EXPORT) {
-               /* Give the export an index, count exports */
-               S->Index = ExportCount++;
-               S->Flags |= SF_INDEXED;
+               ++ExportCount;
            }
 
             /* If the symbol is defined but has an unknown address size,