projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
format: Create a new "struct fmt_affix" for prefix and suffix strings.
[pspp]
/
src
/
language
/
dictionary
/
rename-variables.c
diff --git
a/src/language/dictionary/rename-variables.c
b/src/language/dictionary/rename-variables.c
index 3179efda3748498090a7a8603165adffc86ae8d7..79ab997cfd27ed5f7bf12dab050336c9f2475bd0 100644
(file)
--- a/
src/language/dictionary/rename-variables.c
+++ b/
src/language/dictionary/rename-variables.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000
, 2010
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
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
@@
-24,7
+24,6
@@
#include <language/command.h>
#include <language/lexer/lexer.h>
#include <language/lexer/variable-parser.h>
#include <language/command.h>
#include <language/lexer/lexer.h>
#include <language/lexer/variable-parser.h>
-#include <libpspp/hash.h>
#include <libpspp/message.h>
#include <libpspp/str.h>
#include <libpspp/message.h>
#include <libpspp/str.h>
@@
-54,7
+53,7
@@
cmd_rename_variables (struct lexer *lexer, 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 (lexer,
'('
))
+ if (!lex_match (lexer,
T_LPAREN
))
{
msg (SE, _("`(' expected."));
goto lossage;
{
msg (SE, _("`(' expected."));
goto lossage;
@@
-62,34
+61,34
@@
cmd_rename_variables (struct lexer *lexer, struct dataset *ds)
if (!parse_variables (lexer, dataset_dict (ds), &rename_vars, &rename_cnt,
PV_APPEND | PV_NO_DUPLICATE))
goto lossage;
if (!parse_variables (lexer, dataset_dict (ds), &rename_vars, &rename_cnt,
PV_APPEND | PV_NO_DUPLICATE))
goto lossage;
- if (!lex_match (lexer,
'='
))
+ if (!lex_match (lexer,
T_EQUALS
))
{
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 (lexer, &rename_new_names, &prev_nv_1, PV_APPEND))
+ if (!parse_DATA_LIST_vars (lexer, &rename_new_names, &prev_nv_1,
+ PV_APPEND | PV_NO_DUPLICATE))
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 "
- "(%d) and in new name list (%d)."),
- (int) (rename_cnt - prev_nv_2),
- (int) (prev_nv_1 - prev_nv_2));
+ "(%zu) and in new name list (%zu)."),
+ rename_cnt - prev_nv_2, 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 (lexer,
')'
))
+ if (!lex_match (lexer,
T_RPAREN
))
{
msg (SE, _("`)' expected after variable names."));
goto lossage;
}
}
{
msg (SE, _("`)' expected after variable names."));
goto lossage;
}
}
- while (lex_token (lexer) !=
'.'
);
+ while (lex_token (lexer) !=
T_ENDCMD
);
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,