projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use moments.c to compute moments
[pspp]
/
src
/
language
/
dictionary
/
rename-variables.c
diff --git
a/src/language/dictionary/rename-variables.c
b/src/language/dictionary/rename-variables.c
index 0e0df1eca4e197406464de6f061ce587204fa924..06f3527c82b72edd069ca307055a4dd87c0bf831 100644
(file)
--- a/
src/language/dictionary/rename-variables.c
+++ b/
src/language/dictionary/rename-variables.c
@@
-1,6
+1,5
@@
/* PSPP - computes sample statistics.
Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
/* PSPP - computes sample statistics.
Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
- Written by Ben Pfaff <blp@gnu.org>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@
-38,7
+37,7
@@
/* The code for this function is very similar to the code for the
RENAME subcommand of MODIFY VARS. */
int
/* The code for this function is very similar to the code for the
RENAME subcommand of MODIFY VARS. */
int
-cmd_rename_variables (struct dataset *ds)
+cmd_rename_variables (struct
lexer *lexer, struct
dataset *ds)
{
struct variable **rename_vars = NULL;
char **rename_new_names = NULL;
{
struct variable **rename_vars = NULL;
char **rename_new_names = NULL;
@@
-56,42
+55,42
@@
cmd_rename_variables (struct dataset *ds)
size_t prev_nv_1 = rename_cnt;
size_t prev_nv_2 = rename_cnt;
size_t prev_nv_1 = rename_cnt;
size_t prev_nv_2 = rename_cnt;
- if (!lex_match ('('))
+ if (!lex_match (
lexer,
'('))
{
msg (SE, _("`(' expected."));
goto lossage;
}
{
msg (SE, _("`(' expected."));
goto lossage;
}
- if (!parse_variables (dataset_dict (ds), &rename_vars, &rename_cnt,
+ if (!parse_variables (
lexer,
dataset_dict (ds), &rename_vars, &rename_cnt,
PV_APPEND | PV_NO_DUPLICATE))
goto lossage;
PV_APPEND | PV_NO_DUPLICATE))
goto lossage;
- if (!lex_match ('='))
+ if (!lex_match (
lexer,
'='))
{
msg (SE, _("`=' expected between lists of new and old variable names."));
goto lossage;
}
{
msg (SE, _("`=' expected between lists of new and old variable names."));
goto lossage;
}
- if (!parse_DATA_LIST_vars (&rename_new_names, &prev_nv_1, PV_APPEND))
+ if (!parse_DATA_LIST_vars (
lexer,
&rename_new_names, &prev_nv_1, PV_APPEND))
goto lossage;
if (prev_nv_1 != rename_cnt)
{
size_t i;
msg (SE, _("Differing number of variables in old name list "
goto lossage;
if (prev_nv_1 != rename_cnt)
{
size_t i;
msg (SE, _("Differing number of variables in old name list "
- "(%
u) and in new name list (%u
)."),
- (
unsigned) rename_cnt - prev_nv_2
,
- (
unsigned) prev_nv_1 - prev_nv_2
);
+ "(%
d) and in new name list (%d
)."),
+ (
int) (rename_cnt - prev_nv_2)
,
+ (
int) (prev_nv_1 - prev_nv_2)
);
for (i = 0; i < prev_nv_1; i++)
free (rename_new_names[i]);
free (rename_new_names);
rename_new_names = NULL;
goto lossage;
}
for (i = 0; i < prev_nv_1; i++)
free (rename_new_names[i]);
free (rename_new_names);
rename_new_names = NULL;
goto lossage;
}
- if (!lex_match (')'))
+ if (!lex_match (
lexer,
')'))
{
msg (SE, _("`)' expected after variable names."));
goto lossage;
}
}
{
msg (SE, _("`)' expected after variable names."));
goto lossage;
}
}
- while (
token
!= '.');
+ while (
lex_token (lexer)
!= '.');
if (!dict_rename_vars (dataset_dict (ds),
rename_vars, rename_new_names, rename_cnt,
if (!dict_rename_vars (dataset_dict (ds),
rename_vars, rename_new_names, rename_cnt,