mirror of
https://github.com/cc65/cc65.git
synced 2024-12-25 02:29:52 +00:00
Minor changes after review.
This commit is contained in:
parent
f5b3c5351e
commit
a4b6bb63c0
@ -60,6 +60,7 @@
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
/* Pointer to current function */
|
||||
Function* CurrentFunc = 0;
|
||||
|
||||
@ -523,7 +524,7 @@ void NewFunc (SymEntry* Func)
|
||||
|
||||
/* Need a starting curly brace */
|
||||
ConsumeLCurly ();
|
||||
CollAppend (&CurrentFunc->LocalsBlockStack, (void *)CurrentFunc->LocalsBlockCount);
|
||||
CollAppend (&CurrentFunc->LocalsBlockStack, 0);
|
||||
|
||||
/* Parse local variable declarations if any */
|
||||
DeclareLocals ();
|
||||
|
@ -65,8 +65,6 @@ struct Function {
|
||||
Collection LocalsBlockStack; /* Stack of blocks with local vars */
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* Structure that holds all data needed for function activation */
|
||||
typedef struct Function Function;
|
||||
|
||||
|
@ -538,8 +538,7 @@ void DeclareLocals (void)
|
||||
/* Be sure to allocate any reserved space for locals */
|
||||
F_AllocLocalSpace (CurrentFunc);
|
||||
|
||||
if (InitialStack != StackPtr)
|
||||
{
|
||||
if (InitialStack != StackPtr) {
|
||||
++CurrentFunc->LocalsBlockCount;
|
||||
/* Is it ok to abuse Collection in this way? */
|
||||
CollAppend (&CurrentFunc->LocalsBlockStack, (void *)CurrentFunc->LocalsBlockCount);
|
||||
|
@ -535,8 +535,9 @@ static int CompoundStatement (void)
|
||||
g_space (StackPtr - OldStack);
|
||||
}
|
||||
|
||||
if (OldStack != StackPtr)
|
||||
if (OldStack != StackPtr) {
|
||||
CollPop (&CurrentFunc->LocalsBlockStack);
|
||||
}
|
||||
|
||||
StackPtr = OldStack;
|
||||
|
||||
|
@ -100,18 +100,17 @@ struct LiteralPool;
|
||||
|
||||
|
||||
|
||||
/* Symbol table entry */
|
||||
|
||||
/* Label definition or reference */
|
||||
typedef struct DefOrRef DefOrRef;
|
||||
|
||||
struct DefOrRef {
|
||||
unsigned Line;
|
||||
long LocalsBlockNum;
|
||||
unsigned Flags;
|
||||
};
|
||||
|
||||
/* Symbol table entry */
|
||||
typedef struct SymEntry SymEntry;
|
||||
|
||||
struct SymEntry {
|
||||
SymEntry* NextHash; /* Next entry in hash list */
|
||||
SymEntry* PrevSym; /* Previous symbol in dl list */
|
||||
|
Loading…
Reference in New Issue
Block a user