projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8011f99
)
APPLY DICTIONARY: Style improvements.
author
Ben Pfaff
<blp@cs.stanford.edu>
Fri, 16 Sep 2022 23:08:25 +0000
(16:08 -0700)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Fri, 16 Sep 2022 23:08:25 +0000
(16:08 -0700)
src/language/dictionary/apply-dictionary.c
patch
|
blob
|
history
diff --git
a/src/language/dictionary/apply-dictionary.c
b/src/language/dictionary/apply-dictionary.c
index eae06df76c0c05ca2834f35a02b0ecf04c29f867..354a5170558c527b6320a101bd19415244534f31 100644
(file)
--- a/
src/language/dictionary/apply-dictionary.c
+++ b/
src/language/dictionary/apply-dictionary.c
@@
-39,28
+39,25
@@
int
cmd_apply_dictionary (struct lexer *lexer, struct dataset *ds)
{
int
cmd_apply_dictionary (struct lexer *lexer, struct dataset *ds)
{
- struct file_handle *handle;
- struct casereader *reader;
- struct dictionary *dict;
-
- int n_matched = 0;
-
- int i;
-
lex_match_id (lexer, "FROM");
lex_match (lexer, T_EQUALS);
lex_match_id (lexer, "FROM");
lex_match (lexer, T_EQUALS);
- handle = fh_parse (lexer, FH_REF_FILE, dataset_session (ds));
+ struct file_handle *handle = fh_parse (lexer, FH_REF_FILE,
+ dataset_session (ds));
if (!handle)
return CMD_FAILURE;
if (!handle)
return CMD_FAILURE;
- reader = any_reader_open_and_decode (handle, NULL, &dict, NULL);
+
+ struct dictionary *dict;
+ struct casereader *reader = any_reader_open_and_decode (handle, NULL, &dict,
+ NULL);
fh_unref (handle);
if (!reader)
return CMD_FAILURE;
casereader_destroy (reader);
fh_unref (handle);
if (!reader)
return CMD_FAILURE;
casereader_destroy (reader);
- for (i = 0; i < dict_get_n_vars (dict); i++)
+ size_t n_matched = 0;
+ for (size_t i = 0; i < dict_get_n_vars (dict); i++)
{
const struct variable *s = dict_get_var (dict, i);
struct variable *t = dict_lookup_var (dataset_dict (ds),
{
const struct variable *s = dict_get_var (dict, i);
struct variable *t = dict_lookup_var (dataset_dict (ds),