pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] Changes to pspp/src/modify-vars.c


From: Ben Pfaff
Subject: [Pspp-cvs] Changes to pspp/src/modify-vars.c
Date: Sun, 23 Oct 2005 22:52:08 -0400

Index: pspp/src/modify-vars.c
diff -u pspp/src/modify-vars.c:1.15 pspp/src/modify-vars.c:1.16
--- pspp/src/modify-vars.c:1.15 Sat Sep 17 18:15:38 2005
+++ pspp/src/modify-vars.c      Mon Oct 24 02:51:32 2005
@@ -109,7 +109,7 @@
       if (lex_match_id ("REORDER"))
        {
          struct variable **v = NULL;
-         int nv = 0;
+         size_t nv = 0;
 
          if (already_encountered & 1)
            {
@@ -122,7 +122,7 @@
          do
            {
               struct ordering ordering;
-             int prev_nv = nv;
+             size_t prev_nv = nv;
 
              ordering.forward = ordering.positional = 1;
              if (lex_match_id ("FORWARD"));
@@ -184,8 +184,8 @@
          lex_match ('=');
          do
            {
-             int prev_nv_1 = vm.rename_cnt;
-             int prev_nv_2 = vm.rename_cnt;
+             size_t prev_nv_1 = vm.rename_cnt;
+             size_t prev_nv_2 = vm.rename_cnt;
 
              if (!lex_match ('('))
                {
@@ -226,7 +226,7 @@
       else if (lex_match_id ("KEEP"))
        {
          struct variable **keep_vars, **all_vars, **drop_vars;
-         int keep_cnt, all_cnt, drop_cnt;
+         size_t keep_cnt, all_cnt, drop_cnt;
 
          if (already_encountered & 4)
            {
@@ -247,6 +247,7 @@
                 compare_variables_given_ordering, 
&forward_positional_ordering);
 
           dict_get_vars (default_dict, &all_vars, &all_cnt, 0);
+          assert (all_cnt >= keep_cnt);
 
           drop_cnt = all_cnt - keep_cnt;
           drop_vars = xmalloc (drop_cnt * sizeof *keep_vars);
@@ -268,7 +269,7 @@
       else if (lex_match_id ("DROP"))
        {
          struct variable **drop_vars;
-         int drop_cnt;
+         size_t drop_cnt;
 
          if (already_encountered & 4)
            {
@@ -391,7 +392,7 @@
   struct variable **keep_vars;
   struct variable **drop_vars;
   size_t keep_cnt, drop_cnt;
-  int all_cnt;
+  size_t all_cnt;
 
   struct var_renaming *var_renaming;
   int valid;
@@ -408,6 +409,7 @@
         compare_variables_given_ordering, &forward_positional_ordering);
 
   /* Keep variables, in index order. */
+  assert (all_cnt >= drop_cnt);
   keep_cnt = all_cnt - drop_cnt;
   keep_vars = xmalloc (keep_cnt * sizeof *keep_vars);
   if (set_difference (all_vars, all_cnt,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]