/*****************************************************************************/
/* */
-/* loop.c */
+/* loop.c */
/* */
-/* Loop management */
+/* Loop management */
/* */
/* */
/* */
-/* (C) 1998-2000 Ullrich von Bassewitz */
-/* Wacholderweg 14 */
-/* D-70597 Stuttgart */
-/* EMail: uz@musoftware.de */
+/* (C) 1998-2004 Ullrich von Bassewitz */
+/* Römerstraße 52 */
+/* D-70794 Filderstadt */
+/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
/* common */
+#include "check.h"
#include "xmalloc.h"
/* cc65 */
#include "error.h"
-#include "loop.h"
+#include "loop.h"
+#include "stackptr.h"
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
-LoopDesc* AddLoop (unsigned sp, unsigned loop, unsigned label,
- unsigned linc, unsigned lstat)
-/* Create and add a new loop descriptor */
+LoopDesc* AddLoop (unsigned BreakLabel, unsigned ContinueLabel)
+/* Create and add a new loop descriptor. */
{
- LoopDesc* L;
-
/* Allocate a new struct */
- L = xmalloc (sizeof (LoopDesc));
+ LoopDesc* L = xmalloc (sizeof (LoopDesc));
/* Fill in the data */
- L->StackPtr = sp;
- L->Loop = loop;
- L->Label = label;
- L->linc = linc;
- L->lstat = lstat;
+ L->StackPtr = StackPtr;
+ L->BreakLabel = BreakLabel;
+ L->ContinueLabel = ContinueLabel;
/* Insert it into the list */
L->Next = LoopStack;
/* Remove the current loop */
{
LoopDesc* L = LoopStack;
+ CHECK (L != 0);
LoopStack = LoopStack->Next;
xfree (L);
}
-
-
-