X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fflip.c;h=534efb4919c05c64bbb31d1c0f9d50cd3f3f7635;hb=81579d9e9f994fb2908f50af41c3eb033d216e58;hp=7390b08c0a5fcd5fd84e355b0b5c74a58756e269;hpb=38993354cabb6fc37bb882be92f9a49e9aeb4c88;p=pspp-builds.git diff --git a/src/language/stats/flip.c b/src/language/stats/flip.c index 7390b08c..534efb49 100644 --- a/src/language/stats/flip.c +++ b/src/language/stats/flip.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2009, 2010, 2011 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 @@ -22,29 +22,30 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "intprops.h" -#include "minmax.h" -#include "xalloc.h" +#include "data/case.h" +#include "data/casereader.h" +#include "data/casereader-provider.h" +#include "data/dictionary.h" +#include "data/procedure.h" +#include "data/settings.h" +#include "data/short-names.h" +#include "data/value.h" +#include "data/variable.h" +#include "language/command.h" +#include "language/lexer/lexer.h" +#include "language/lexer/variable-parser.h" +#include "libpspp/array.h" +#include "libpspp/assertion.h" +#include "libpspp/message.h" +#include "libpspp/misc.h" +#include "libpspp/pool.h" +#include "libpspp/str.h" +#include "data/data-in.h" +#include "data/data-out.h" + +#include "gl/intprops.h" +#include "gl/minmax.h" +#include "gl/xalloc.h" #include "gettext.h" #define _(msgid) gettext (msgid) @@ -109,23 +110,23 @@ cmd_flip (struct lexer *lexer, struct dataset *ds) flip->error = false; flip->dict = dict; - lex_match (lexer, '/'); + lex_match (lexer, T_SLASH); if (lex_match_id (lexer, "VARIABLES")) { - lex_match (lexer, '='); + lex_match (lexer, T_EQUALS); if (!parse_variables_const (lexer, dict, &vars, &flip->n_vars, PV_NO_DUPLICATE)) goto error; - lex_match (lexer, '/'); + lex_match (lexer, T_SLASH); } else dict_get_vars (dict, &vars, &flip->n_vars, DC_SYSTEM); pool_register (flip->pool, free, vars); - lex_match (lexer, '/'); + lex_match (lexer, T_SLASH); if (lex_match_id (lexer, "NEWNAMES")) { - lex_match (lexer, '='); + lex_match (lexer, T_EQUALS); flip->new_names_var = parse_variable (lexer, dict); if (!flip->new_names_var) goto error; @@ -209,7 +210,7 @@ cmd_flip (struct lexer *lexer, struct dataset *ds) make_new_var (dict, flip->new_names.names[i]); else { - char s[VAR_NAME_LEN + 1]; + char s[3 + INT_STRLEN_BOUND (i) + 1]; sprintf (s, "VAR%03zu", i); dict_create_var_assert (dict, s, 0); } @@ -407,7 +408,7 @@ flip_casereader_read (struct casereader *reader, void *flip_) c = case_create (casereader_get_proto (reader)); encoding = dict_get_encoding (flip->dict); data_in (ss_cstr (flip->old_names.names[flip->cases_read]), encoding, - FMT_A, 0, 0, case_data_rw_idx (c, 0), 8, encoding); + FMT_A, case_data_rw_idx (c, 0), 8, encoding); for (i = 0; i < flip->n_cases; i++) {