From eb388aa237d74800cfcb13113e4b44198e469b98 Mon Sep 17 00:00:00 2001 From: cuz Date: Sun, 6 Jun 2004 10:52:32 +0000 Subject: [PATCH] The loop code will access the stackpointer directly git-svn-id: svn://svn.cc65.org/cc65/trunk@3106 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/loop.c | 9 +++++---- src/cc65/loop.h | 8 ++++---- src/cc65/stmt.c | 8 ++++---- src/cc65/swstmt.c | 3 +-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/cc65/loop.c b/src/cc65/loop.c index d41b3f4a6..f2925e0cb 100644 --- a/src/cc65/loop.c +++ b/src/cc65/loop.c @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 1998-2003 Ullrich von Bassewitz */ +/* (C) 1998-2004 Ullrich von Bassewitz */ /* Römerstraße 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -39,7 +39,8 @@ /* cc65 */ #include "error.h" -#include "loop.h" +#include "loop.h" +#include "stackptr.h" @@ -60,14 +61,14 @@ static LoopDesc* LoopStack = 0; -LoopDesc* AddLoop (unsigned SP, unsigned BreakLabel, unsigned ContinueLabel) +LoopDesc* AddLoop (unsigned BreakLabel, unsigned ContinueLabel) /* Create and add a new loop descriptor. */ { /* Allocate a new struct */ LoopDesc* L = xmalloc (sizeof (LoopDesc)); /* Fill in the data */ - L->StackPtr = SP; + L->StackPtr = StackPtr; L->BreakLabel = BreakLabel; L->ContinueLabel = ContinueLabel; diff --git a/src/cc65/loop.h b/src/cc65/loop.h index 81889cf5b..c8660fb69 100644 --- a/src/cc65/loop.h +++ b/src/cc65/loop.h @@ -1,12 +1,12 @@ /*****************************************************************************/ /* */ -/* loop.h */ +/* loop.h */ /* */ -/* Loop management */ +/* Loop management */ /* */ /* */ /* */ -/* (C) 1998-2003 Ullrich von Bassewitz */ +/* (C) 1998-2004 Ullrich von Bassewitz */ /* Römerstraße 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -60,7 +60,7 @@ struct LoopDesc { -LoopDesc* AddLoop (unsigned SP, unsigned BreakLabel, unsigned ContinueLabel); +LoopDesc* AddLoop (unsigned BreakLabel, unsigned ContinueLabel); /* Create and add a new loop descriptor. */ LoopDesc* CurrentLoop (void); diff --git a/src/cc65/stmt.c b/src/cc65/stmt.c index 44a98072d..f82feec39 100644 --- a/src/cc65/stmt.c +++ b/src/cc65/stmt.c @@ -202,7 +202,7 @@ static void DoStatement (void) NextToken (); /* Add the loop to the loop stack */ - AddLoop (StackPtr, BreakLabel, ContinueLabel); + AddLoop (BreakLabel, ContinueLabel); /* Define the loop label */ g_defcodelabel (LoopLabel); @@ -242,7 +242,7 @@ static void WhileStatement (void) /* Add the loop to the loop stack. In case of a while loop, the loop head * label is used for continue statements. */ - AddLoop (StackPtr, BreakLabel, LoopLabel); + AddLoop (BreakLabel, LoopLabel); /* Define the head label */ g_defcodelabel (LoopLabel); @@ -393,7 +393,7 @@ static void ForStatement (void) /* Add the loop to the loop stack. A continue jumps to the start of the * the increment condition. */ - AddLoop (StackPtr, BreakLabel, IncLabel); + AddLoop (BreakLabel, IncLabel); /* Skip the opening paren */ ConsumeLParen (); @@ -602,7 +602,7 @@ int Statement (int* PendingToken) ExprLoad (CF_NONE, &Expr); } /* If the statement didn't generate code, and is not of type - * void, emit a warning + * void, emit a warning */ if (GetCodePos () == Start && !IsTypeVoid (Expr.Type)) { Warning ("Statement has no effect"); diff --git a/src/cc65/swstmt.c b/src/cc65/swstmt.c index dc508d7f4..25c82c430 100644 --- a/src/cc65/swstmt.c +++ b/src/cc65/swstmt.c @@ -50,7 +50,6 @@ #include "global.h" #include "loop.h" #include "scanner.h" -#include "stackptr.h" #include "stmt.h" #include "swstmt.h" @@ -126,7 +125,7 @@ void SwitchStatement (void) ExitLabel = GetLocalLabel (); /* Create a loop so we may use break. */ - AddLoop (StackPtr, ExitLabel, 0); + AddLoop (ExitLabel, 0); /* Create the collection for the case node tree */ Nodes = NewCollection (); -- 2.39.5