X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fmeans.q;h=b952df19a4e084260f9b76a57e8036125b9886ce;hb=2ecff1a148bee8df55a3003a407147c9af8f19c8;hp=a8739bc2f41ec3bf88b1c872ec6b069c38a41db1;hpb=42489b63e0b4bec2e20c2f55c9791234f7b41764;p=pspp-builds.git diff --git a/src/language/stats/means.q b/src/language/stats/means.q index a8739bc2..b952df19 100644 --- a/src/language/stats/means.q +++ b/src/language/stats/means.q @@ -1,6 +1,5 @@ /* PSPP - computes sample statistics. Copyright (C) 1997-9, 2000 Free Software Foundation, Inc. - Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -52,17 +51,16 @@ /* (functions) */ /* TABLES: Variable lists for each dimension. */ -int n_dim; /* Number of dimensions. */ -size_t *nv_dim; /* Number of variables in each dimension. */ -struct variable ***v_dim; /* Variables in each dimension. */ +static int n_dim; /* Number of dimensions. */ +static size_t *nv_dim; /* Number of variables in each dimension. */ +static struct variable ***v_dim; /* Variables in each dimension. */ /* VARIABLES: List of variables. */ -int n_var; -struct variable **v_var; +static struct variable **v_var; /* Parses and executes the T-TEST procedure. */ int -cmd_means (void) +cmd_means (struct lexer *lexer, struct dataset *ds) { struct cmd_means cmd; int success = CMD_FAILURE; @@ -72,7 +70,7 @@ cmd_means (void) v_dim = NULL; v_var = NULL; - if (!parse_means (&cmd, NULL)) + if (!parse_means (lexer, ds, &cmd, NULL)) goto free; if (cmd.sbc_cells) @@ -123,15 +121,15 @@ free: /* Parses the TABLES subcommand. */ static int -mns_custom_tables (struct cmd_means *cmd, void *aux UNUSED) +mns_custom_tables (struct lexer *lexer, struct dataset *ds, struct cmd_means *cmd, void *aux UNUSED) { struct var_set *var_set; - if (!lex_match_id ("TABLES") - && (token != T_ID || dict_lookup_var (dataset_dict (current_dataset), tokid) == NULL) - && token != T_ALL) + if (!lex_match_id (lexer, "TABLES") + && (lex_token (lexer) != T_ID || dict_lookup_var (dataset_dict (ds), lex_tokid (lexer)) == NULL) + && lex_token (lexer) != T_ALL) return 2; - lex_match ('='); + lex_match (lexer, '='); if (cmd->sbc_tables) { @@ -140,7 +138,7 @@ mns_custom_tables (struct cmd_means *cmd, void *aux UNUSED) return 0; } - var_set = var_set_create_from_dict (dataset_dict (current_dataset)); + var_set = var_set_create_from_dict (dataset_dict (ds)); assert (var_set != NULL); do @@ -148,7 +146,7 @@ mns_custom_tables (struct cmd_means *cmd, void *aux UNUSED) size_t nvl; struct variable **vl; - if (!parse_var_set_vars (var_set, &vl, &nvl, + if (!parse_var_set_vars (lexer, var_set, &vl, &nvl, PV_NO_DUPLICATE | PV_NO_SCRATCH)) goto lossage; @@ -159,7 +157,7 @@ mns_custom_tables (struct cmd_means *cmd, void *aux UNUSED) nv_dim[n_dim - 1] = nvl; v_dim[n_dim - 1] = vl; } - while (lex_match (T_BY)); + while (lex_match (lexer, T_BY)); var_set_destroy (var_set); return 1;