treewide: Replace <name>_cnt by n_<name>s and <name>_cap by allocated_<name>.
[pspp] / src / language / expressions / generate.pl
index 1b821c412d57b92882cfe632ffde455f674b074a..188d4eb11cc5c86ef3acfe4d868d4b6a6f4582db 100644 (file)
@@ -1,19 +1,19 @@
 # PSPP - a program for statistical analysis.
 # Copyright (C) 2017 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
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
-# 
+#
 use strict;
 use warnings 'all';
 
@@ -561,8 +561,8 @@ sub parse_arg {
            $arg{IDX} = force ('id');
            if (match ('*')) {
                $arg{TIMES} = force ('int');
-               die "multiplication factor must be positive"
-                 if $arg{TIMES} < 1;
+               die "multiplication factor must be two"
+                 if $arg{TIMES} != 2;
            } else {
                $arg{TIMES} = 1;
            }
@@ -583,7 +583,7 @@ sub parse_arg {
 sub print_header {
     print <<EOF;
 /* $output_file
-   Generated from $input_file by generate.pl.  
+   Generated from $input_file by generate.pl.
    Do not modify! */
 
 EOF
@@ -749,7 +749,7 @@ sub print_range {
     my ($prefix, $first, $last) = @_;
     print "    ${prefix}_first = $first,\n";
     print "    ${prefix}_last = $last,\n";
-    print "    ${prefix}_cnt = ${prefix}_last - ${prefix}_first + 1";
+    print "    n_${prefix} = ${prefix}_last - ${prefix}_first + 1";
 }
 
 sub print_predicate {
@@ -786,7 +786,7 @@ sub generate_optimize_inc {
                my ($func) = "get_$type->{ATOM}_arg";
                push (@decls, "${ctype}arg_$name = $func (node, $arg_idx)");
            } else {
-               my ($decl) = "size_t arg_$idx = node->arg_cnt";
+               my ($decl) = "size_t arg_$idx = node->n_args";
                $decl .= " - $arg_idx" if $arg_idx;
                push (@decls, $decl);
 
@@ -943,7 +943,7 @@ sub any {
 # valid arguments for $op.
 sub make_sysmis_decl {
     my ($op, $min_valid_src) = @_;
-    my (@sysmis_cond); 
+    my (@sysmis_cond);
     if (!$op->{ABSORB_MISS}) {
        for my $arg (@{$op->{ARGS}}) {
            my ($arg_name) = "arg_$arg->{NAME}";