X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdata-io%2Flist.q;h=8e8bba9b69a281ae707cd021d2bd777e0176bf6f;hb=44dab63eeb3b50a9939d58005e63b2bfae0f846f;hp=4aae0bbb93356c72b52843507321671456571ea1;hpb=f5c108becd49d78f4898cab11352291f5689d24e;p=pspp diff --git a/src/language/data-io/list.q b/src/language/data-io/list.q index 4aae0bbb93..8e8bba9b69 100644 --- a/src/language/data-io/list.q +++ b/src/language/data-io/list.q @@ -1,41 +1,40 @@ -/* PSPP - computes sample statistics. +/* PSPP - a program for statistical analysis. Copyright (C) 1997-9, 2000, 2006 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 2 of the - License, or (at your option) any later version. + 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. + 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, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + along with this program. If not, see . */ #include +#include #include #include #include "intprops.h" -#include "size_max.h" +#include "xmalloca.h" + #include #include #include #include #include #include +#include #include #include #include #include -#include #include -#include #include #include #include @@ -45,6 +44,7 @@ #include #include "minmax.h" +#include "xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) @@ -143,15 +143,15 @@ cmd_list (struct lexer *lexer, struct dataset *ds) return CMD_FAILURE; /* Fill in defaults. */ - if (cmd.step == NOT_LONG) + if (cmd.step == LONG_MIN) cmd.step = 1; - if (cmd.first == NOT_LONG) + if (cmd.first == LONG_MIN) cmd.first = 1; - if (cmd.last == NOT_LONG) + if (cmd.last == LONG_MIN) cmd.last = LONG_MAX; if (!cmd.sbc_variables) dict_get_vars (dict, &cmd.v_variables, &cmd.n_variables, - (1u << DC_SYSTEM) | (1u << DC_SCRATCH)); + DC_SYSTEM | DC_SCRATCH); if (cmd.n_variables == 0) { msg (SE, _("No variables specified.")); @@ -465,8 +465,8 @@ write_fallback_headers (struct outp_driver *d) int line_number = 0; const char *Line = _("Line"); - char *leader = local_alloc (strlen (Line) - + INT_STRLEN_BOUND (line_number) + 1 + 1); + char *leader = xmalloca (strlen (Line) + + INT_STRLEN_BOUND (line_number) + 1 + 1); while (index < cmd.n_variables) { @@ -508,7 +508,7 @@ write_fallback_headers (struct outp_driver *d) } { - char varname[LONG_NAME_LEN + 2]; + char varname[VAR_NAME_LEN + 2]; snprintf (varname, sizeof varname, " %s", var_get_name (cmd.v_variables[index])); write_varname (d, varname, leader_width); @@ -520,7 +520,7 @@ write_fallback_headers (struct outp_driver *d) d->cp_x = 0; d->cp_y += d->font_height; - local_free (leader); + freea (leader); } /* There are three possible layouts for the LIST procedure: