]> git.sur5r.net Git - cc65/blobdiff - src/cc65/loop.c
Merge remote-tracking branch 'upstream/master' into a5200
[cc65] / src / cc65 / loop.c
index 732a12b7dd475fd1a2c005f379145f962eee0272..c15c37a7965bbbba81fcea0faf116fadc797eff1 100644 (file)
@@ -1,15 +1,15 @@
 /*****************************************************************************/
 /*                                                                           */
-/*                                 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                                    */
 /*****************************************************************************/
 
 
@@ -54,26 +56,21 @@ static LoopDesc* LoopStack = 0;
 
 
 /*****************************************************************************/
-/*                                  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;
@@ -97,9 +94,7 @@ void DelLoop (void)
 /* Remove the current loop */
 {
     LoopDesc* L = LoopStack;
+    CHECK (L != 0);
     LoopStack = LoopStack->Next;
     xfree (L);
 }
-
-
-