transformations: Remove finalize functions.
[pspp] / src / language / control / loop.c
index cece7f68f647cf91e1fd925759c9b7c7a0c80f06..4d2aaa33a44636e615618fc3de27a3846206a023 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 1997-9, 2000, 2009-2011 Free Software Foundation, Inc.
+   Copyright (C) 1997-9, 2000, 2009-2011, 2013 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -81,7 +81,6 @@ struct loop_trns
 
 static const struct ctl_class loop_class;
 
-static trns_finalize_func loop_trns_finalize;
 static trns_proc_func loop_trns_proc, end_loop_trns_proc, break_trns_proc;
 static trns_free_func loop_trns_free;
 
@@ -282,8 +281,7 @@ create_loop_trns (struct dataset *ds)
   loop->loop_condition = loop->end_loop_condition = NULL;
   loop->ds = ds;
 
-  add_transformation_with_finalizer (ds, loop_trns_finalize,
-                                     loop_trns_proc, loop_trns_free, loop);
+  add_transformation (ds, loop_trns_proc, loop_trns_free, loop);
   loop->past_LOOP_index = next_transformation (ds);
 
   ctl_stack_push (&loop_class, loop);
@@ -291,17 +289,6 @@ create_loop_trns (struct dataset *ds)
   return loop;
 }
 
-/* Finalizes LOOP by clearing the control stack, thus ensuring
-   that all open LOOPs are closed. */
-static void
-loop_trns_finalize (void *do_if_ UNUSED)
-{
-  /* This will be called multiple times if multiple LOOPs were
-     executed, which is slightly unclean, but at least it's
-     idempotent. */
-  ctl_stack_clear ();
-}
-
 /* Sets up LOOP for the first pass. */
 static int
 loop_trns_proc (void *loop_, struct ccase **c, casenumber case_num)