projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed buglet in file open action.
[pspp-builds.git]
/
src
/
language
/
dictionary
/
value-labels.c
diff --git
a/src/language/dictionary/value-labels.c
b/src/language/dictionary/value-labels.c
index 65b8762ecedc8aed047517f727e1d2741c126caa..a0d59c2285a9097c525e9397182fef3cbf72342d 100644
(file)
--- a/
src/language/dictionary/value-labels.c
+++ b/
src/language/dictionary/value-labels.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
@@
-88,8
+87,8
@@
do_value_labels (struct lexer *lexer, const struct dictionary *dict, int erase)
if (lex_token (lexer) != '/')
{
if (lex_token (lexer) != '/')
{
- free (vars);
- break;
+
free (vars);
+
break;
}
lex_get (lexer);
}
lex_get (lexer);
@@
-118,10
+117,10
@@
verify_val_labs (struct variable **vars, size_t var_cnt)
{
struct variable *vp = vars[i];
{
struct variable *vp = vars[i];
- if (v
p->type == ALPHA && vp->width > MAX_SHORT_STRING
)
+ if (v
ar_is_long_string (vp)
)
{
msg (SE, _("It is not possible to assign value labels to long "
{
msg (SE, _("It is not possible to assign value labels to long "
- "string variables such as %s."), v
p->name
);
+ "string variables such as %s."), v
ar_get_name (vp)
);
return 0;
}
}
return 0;
}
}
@@
-136,7
+135,7
@@
erase_labels (struct variable **vars, size_t var_cnt)
/* Erase old value labels if desired. */
for (i = 0; i < var_cnt; i++)
/* Erase old value labels if desired. */
for (i = 0; i < var_cnt; i++)
- va
l_labs_clear (vars[i]->val_labs
);
+ va
r_clear_value_labels (vars[i]
);
}
/* Parse all the labels for the VAR_CNT variables in VARS and add
}
/* Parse all the labels for the VAR_CNT variables in VARS and add
@@
-152,7
+151,7
@@
get_label (struct lexer *lexer, struct variable **vars, size_t var_cnt)
size_t i;
/* Set value. */
size_t i;
/* Set value. */
- if (var
s[0]->type == ALPHA
)
+ if (var
_is_alpha (vars[0])
)
{
if (lex_token (lexer) != T_STRING)
{
{
if (lex_token (lexer) != T_STRING)
{
@@
-173,6
+172,7
@@
get_label (struct lexer *lexer, struct variable **vars, size_t var_cnt)
value.f = lex_tokval (lexer);
}
lex_get (lexer);
value.f = lex_tokval (lexer);
}
lex_get (lexer);
+ lex_match (lexer, ',');
/* Set label. */
if (!lex_force_string (lexer))
/* Set label. */
if (!lex_force_string (lexer))
@@
-187,11
+187,12
@@
get_label (struct lexer *lexer, struct variable **vars, size_t var_cnt)
}
for (i = 0; i < var_cnt; i++)
}
for (i = 0; i < var_cnt; i++)
- va
l_labs_replace (vars[i]->val_labs,
value, ds_cstr (&label));
+ va
r_replace_value_label (vars[i], &
value, ds_cstr (&label));
ds_destroy (&label);
lex_get (lexer);
ds_destroy (&label);
lex_get (lexer);
+ lex_match (lexer, ',');
}
while (lex_token (lexer) != '/' && lex_token (lexer) != '.');
}
while (lex_token (lexer) != '/' && lex_token (lexer) != '.');