Removed (pretty inconsistently used) tab chars from source code base.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* extsyms.c */
|
||||
/* extsyms.c */
|
||||
/* */
|
||||
/* Handle program external symbols for relocatable output formats */
|
||||
/* Handle program external symbols for relocatable output formats */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
@@ -47,34 +47,34 @@
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Data */
|
||||
/* Data */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
/* Structure holding an external symbol */
|
||||
struct ExtSym {
|
||||
unsigned Name; /* Name index */
|
||||
ExtSym* List; /* Next entry in list of all symbols */
|
||||
ExtSym* Next; /* Next entry in hash list */
|
||||
unsigned Flags; /* Generic flags */
|
||||
unsigned Num; /* Number of external symbol */
|
||||
unsigned Name; /* Name index */
|
||||
ExtSym* List; /* Next entry in list of all symbols */
|
||||
ExtSym* Next; /* Next entry in hash list */
|
||||
unsigned Flags; /* Generic flags */
|
||||
unsigned Num; /* Number of external symbol */
|
||||
};
|
||||
|
||||
/* External symbol table structure */
|
||||
#define HASHTAB_MASK 0x3FU
|
||||
#define HASHTAB_SIZE (HASHTAB_MASK + 1)
|
||||
#define HASHTAB_SIZE (HASHTAB_MASK + 1)
|
||||
struct ExtSymTab {
|
||||
ExtSym* Root; /* List of symbols */
|
||||
ExtSym* Last; /* Pointer to last symbol */
|
||||
unsigned Count; /* Number of symbols */
|
||||
ExtSym* HashTab[HASHTAB_SIZE];
|
||||
ExtSym* Root; /* List of symbols */
|
||||
ExtSym* Last; /* Pointer to last symbol */
|
||||
unsigned Count; /* Number of symbols */
|
||||
ExtSym* HashTab[HASHTAB_SIZE];
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Code */
|
||||
/* Code */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
@@ -86,10 +86,10 @@ ExtSym* NewExtSym (ExtSymTab* Tab, unsigned Name)
|
||||
unsigned Hash = (Name & HASHTAB_MASK);
|
||||
|
||||
/* Check for duplicates */
|
||||
ExtSym* E = GetExtSym (Tab, Name);
|
||||
ExtSym* E = GetExtSym (Tab, Name);
|
||||
if (E != 0) {
|
||||
/* We do already have a symbol with this name */
|
||||
Error ("Duplicate external symbol `%s'", GetString (Name));
|
||||
/* We do already have a symbol with this name */
|
||||
Error ("Duplicate external symbol `%s'", GetString (Name));
|
||||
}
|
||||
|
||||
/* Allocate memory for the structure */
|
||||
@@ -103,11 +103,11 @@ ExtSym* NewExtSym (ExtSymTab* Tab, unsigned Name)
|
||||
|
||||
/* Insert the entry into the list of all symbols */
|
||||
if (Tab->Last == 0) {
|
||||
/* List is empty */
|
||||
Tab->Root = E;
|
||||
/* List is empty */
|
||||
Tab->Root = E;
|
||||
} else {
|
||||
/* List not empty */
|
||||
Tab->Last->List = E;
|
||||
/* List not empty */
|
||||
Tab->Last->List = E;
|
||||
}
|
||||
Tab->Last = E;
|
||||
++Tab->Count;
|
||||
@@ -141,11 +141,11 @@ ExtSymTab* NewExtSymTab (void)
|
||||
ExtSymTab* Tab = xmalloc (sizeof (ExtSymTab));
|
||||
|
||||
/* Initialize the fields */
|
||||
Tab->Root = 0;
|
||||
Tab->Root = 0;
|
||||
Tab->Last = 0;
|
||||
Tab->Count = 0;
|
||||
for (I = 0; I < HASHTAB_SIZE; ++I) {
|
||||
Tab->HashTab [I] = 0;
|
||||
Tab->HashTab [I] = 0;
|
||||
}
|
||||
|
||||
/* Done, return the hash table */
|
||||
@@ -159,9 +159,9 @@ void FreeExtSymTab (ExtSymTab* Tab)
|
||||
{
|
||||
/* Free all entries */
|
||||
while (Tab->Root) {
|
||||
ExtSym* E = Tab->Root;
|
||||
Tab->Root = E->Next;
|
||||
FreeExtSym (E);
|
||||
ExtSym* E = Tab->Root;
|
||||
Tab->Root = E->Next;
|
||||
FreeExtSym (E);
|
||||
}
|
||||
|
||||
/* Free the struct itself */
|
||||
@@ -181,11 +181,11 @@ ExtSym* GetExtSym (const ExtSymTab* Tab, unsigned Name)
|
||||
/* Check the linked list */
|
||||
ExtSym* E = Tab->HashTab[Hash];
|
||||
while (E) {
|
||||
if (E->Name == Name) {
|
||||
/* Found it */
|
||||
break;
|
||||
}
|
||||
E = E->Next;
|
||||
if (E->Name == Name) {
|
||||
/* Found it */
|
||||
break;
|
||||
}
|
||||
E = E->Next;
|
||||
}
|
||||
|
||||
/* Return the symbol we found */
|
||||
|
||||
Reference in New Issue
Block a user