Apply patch #5225, assertions.
[pspp-builds.git] / src / language / dictionary / modify-variables.c
index 6ead73dc318e01c848b09a739596ab92036f8f45..1632f6ea0db7aecda785b929f72fd544af469b30 100644 (file)
    02110-1301, USA. */
 
 #include <config.h>
+
 #include <stdlib.h>
-#include "message.h"
-#include "array.h"
-#include "alloc.h"
-#include "bit-vector.h"
-#include "command.h"
-#include "compiler.h"
-#include "dictionary.h"
-#include "message.h"
-#include "hash.h"
-#include "lexer.h"
-#include "misc.h"
-#include "str.h"
-#include "variable.h"
-#include "procedure.h"
+
+#include <data/dictionary.h>
+#include <data/procedure.h>
+#include <data/variable.h>
+#include <language/command.h>
+#include <language/lexer/lexer.h>
+#include <language/lexer/variable-parser.h>
+#include <libpspp/alloc.h>
+#include <libpspp/assertion.h>
+#include <libpspp/array.h>
+#include <libpspp/bit-vector.h>
+#include <libpspp/compiler.h>
+#include <libpspp/hash.h>
+#include <libpspp/message.h>
+#include <libpspp/message.h>
+#include <libpspp/misc.h>
+#include <libpspp/str.h>
 
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
@@ -88,12 +92,9 @@ cmd_modify_vars (void)
 
   size_t i;
 
-  if (temporary != 0)
-    {
-      msg (SE, _("MODIFY VARS may not be used after TEMPORARY.  "
-                 "Temporary transformations will be made permanent."));
-      cancel_temporary (); 
-    }
+  if (proc_make_temporary_transformations_permanent ())
+    msg (SE, _("MODIFY VARS may not be used after TEMPORARY.  "
+               "Temporary transformations will be made permanent."));
 
   vm.reorder_vars = NULL;
   vm.reorder_cnt = 0;
@@ -259,7 +260,7 @@ cmd_modify_vars (void)
                               compare_variables_given_ordering,
                               &forward_positional_ordering)
               != drop_cnt)
-            assert (0);
+            NOT_REACHED ();
 
           free (keep_vars);
           free (all_vars);
@@ -420,7 +421,7 @@ validate_var_modification (const struct dictionary *d,
                       keep_vars,
                       compare_variables_given_ordering,
                       &forward_positional_ordering) != keep_cnt)
-    assert (0);
+    NOT_REACHED ();
 
   /* Copy variables into var_renaming array. */
   var_renaming = xnmalloc (keep_cnt, sizeof *var_renaming);
@@ -514,7 +515,7 @@ rearrange_dict (struct dictionary *d, const struct var_modification *vm)
   /* Do renaming. */
   if (dict_rename_vars (d, rename_vars, rename_new_names, rename_cnt,
                         NULL) == 0)
-    assert (0);
+    NOT_REACHED ();
 
   /* Clean up. */
   for (i = 0; i < vm->rename_cnt; i++)