X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdata-io%2Flist.c;h=c98b6f9a5218dce96f157a8698af1a84857ec12e;hb=4bc96629da7d8f0354d8ebf297052e881f936d83;hp=920d66e322b4009c518cbc5ef1a4fbc9eca5a501;hpb=5cab4cf3322f29c0ed7134d23740e07382914f20;p=pspp diff --git a/src/language/data-io/list.c b/src/language/data-io/list.c index 920d66e322..c98b6f9a52 100644 --- a/src/language/data-io/list.c +++ b/src/language/data-io/list.c @@ -37,7 +37,6 @@ #include "libpspp/message.h" #include "libpspp/misc.h" #include "output/pivot-table.h" -#include "output/table-item.h" #include "gl/intprops.h" #include "gl/minmax.h" @@ -113,11 +112,12 @@ list_execute (const struct lst_cmd *lcmd, struct dataset *ds) else cases->hide_all_labels = true; - casenumber case_num = 1; + casenumber case_num = lcmd->first; for (; (c = casereader_read (group)) != NULL; case_unref (c)) { int case_idx = pivot_category_create_leaf ( - cases->root, pivot_value_new_integer (case_num++)); + cases->root, pivot_value_new_integer (case_num)); + case_num += lcmd->step; for (int i = 0; i < lcmd->n_variables; i++) pivot_table_put2 (table, i, case_idx, @@ -131,7 +131,7 @@ list_execute (const struct lst_cmd *lcmd, struct dataset *ds) ok = casegrouper_destroy (grouper); ok = proc_commit (ds) && ok; - subcase_destroy (&sc); + subcase_uninit (&sc); free (lcmd->v_variables); return ok ? CMD_SUCCESS : CMD_CASCADING_FAILURE; @@ -157,23 +157,23 @@ cmd_list (struct lexer *lexer, struct dataset *ds) while (lex_token (lexer) != T_ENDCMD) { lex_match (lexer, T_SLASH); - if (lex_match_id (lexer, "VARIABLES") ) + if (lex_match_id (lexer, "VARIABLES")) { lex_match (lexer, T_EQUALS); - if (! parse_variables_const (lexer, dict, &cmd.v_variables, &cmd.n_variables, 0 )) + if (! parse_variables_const (lexer, dict, &cmd.v_variables, &cmd.n_variables, 0)) { msg (SE, _("No variables specified.")); return CMD_FAILURE; } } - else if (lex_match_id (lexer, "FORMAT") ) + else if (lex_match_id (lexer, "FORMAT")) { lex_match (lexer, T_EQUALS); - if (lex_match_id (lexer, "NUMBERED") ) + if (lex_match_id (lexer, "NUMBERED")) { cmd.numbering = format_numbered; } - else if (lex_match_id (lexer, "UNNUMBERED") ) + else if (lex_match_id (lexer, "UNNUMBERED")) { cmd.numbering = format_unnumbered; } @@ -206,7 +206,7 @@ cmd_list (struct lexer *lexer, struct dataset *ds) lex_get (lexer); } } - else if (! parse_variables_const (lexer, dict, &cmd.v_variables, &cmd.n_variables, 0 )) + else if (! parse_variables_const (lexer, dict, &cmd.v_variables, &cmd.n_variables, 0)) { return CMD_FAILURE; }