projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix description of "count" in Auxiliary Variable Parameter Record.
[pspp]
/
src
/
numeric.c
diff --git
a/src/numeric.c
b/src/numeric.c
index f80865d1dadce9aa1ec4cf63249729a93f06d114..2a7dbe575c1dd570949d070d5f56c52a02f1c10a 100644
(file)
--- a/
src/numeric.c
+++ b/
src/numeric.c
@@
-14,38
+14,38
@@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 5
9 Temple Place - Suite 330
, Boston, MA
- 0211
1-1307
, USA. */
+ Foundation, Inc., 5
1 Franklin Street, Fifth Floor
, Boston, MA
+ 0211
0-1301
, USA. */
#include <config.h>
#include <config.h>
-#include
<assert.h>
+#include
"error.h"
#include <stdlib.h>
#include <stdlib.h>
-#include "cases.h"
#include "command.h"
#include "command.h"
+#include "dictionary.h"
#include "error.h"
#include "lexer.h"
#include "str.h"
#include "var.h"
#include "error.h"
#include "lexer.h"
#include "str.h"
#include "var.h"
-#undef DEBUGGING
-/*#define DEBUGGING 1*/
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
#include "debug-print.h"
/* Parses the NUMERIC command. */
int
cmd_numeric (void)
{
#include "debug-print.h"
/* Parses the NUMERIC command. */
int
cmd_numeric (void)
{
-
in
t i;
+
size_
t i;
/* Names of variables to create. */
char **v;
/* Names of variables to create. */
char **v;
-
in
t nv;
+
size_
t nv;
/* Format spec for variables to create. f.type==-1 if default is to
be used. */
struct fmt_spec f;
/* Format spec for variables to create. f.type==-1 if default is to
be used. */
struct fmt_spec f;
- lex_match_id ("NUMERIC");
do
{
if (!parse_DATA_LIST_vars (&v, &nv, PV_NONE))
do
{
if (!parse_DATA_LIST_vars (&v, &nv, PV_NONE))
@@
-75,15
+75,13
@@
cmd_numeric (void)
/* Create each variable. */
for (i = 0; i < nv; i++)
{
/* Create each variable. */
for (i = 0; i < nv; i++)
{
- struct variable *new_var = create_variable (&default_dict, v[i],
- NUMERIC, 0);
+ struct variable *new_var = dict_create_var (default_dict, v[i], 0);
if (!new_var)
msg (SE, _("There is already a variable named %s."), v[i]);
else
{
if (f.type != -1)
new_var->print = new_var->write = f;
if (!new_var)
msg (SE, _("There is already a variable named %s."), v[i]);
else
{
if (f.type != -1)
new_var->print = new_var->write = f;
- envector (new_var);
}
}
}
}
@@
-109,11
+107,11
@@
fail:
int
cmd_string (void)
{
int
cmd_string (void)
{
-
in
t i;
+
size_
t i;
/* Names of variables to create. */
char **v;
/* Names of variables to create. */
char **v;
-
in
t nv;
+
size_
t nv;
/* Format spec for variables to create. */
struct fmt_spec f;
/* Format spec for variables to create. */
struct fmt_spec f;
@@
-121,7
+119,6
@@
cmd_string (void)
/* Width of variables to create. */
int width;
/* Width of variables to create. */
int width;
- lex_match_id ("STRING");
do
{
if (!parse_DATA_LIST_vars (&v, &nv, PV_NONE))
do
{
if (!parse_DATA_LIST_vars (&v, &nv, PV_NONE))
@@
-153,20
+150,18
@@
cmd_string (void)
break;
default:
assert (0);
break;
default:
assert (0);
+ abort ();
}
/* Create each variable. */
for (i = 0; i < nv; i++)
{
}
/* Create each variable. */
for (i = 0; i < nv; i++)
{
- struct variable *new_var =
create_variable (&
default_dict, v[i],
-
ALPHA,
width);
+ struct variable *new_var =
dict_create_var (
default_dict, v[i],
+
width);
if (!new_var)
msg (SE, _("There is already a variable named %s."), v[i]);
else
if (!new_var)
msg (SE, _("There is already a variable named %s."), v[i]);
else
- {
- new_var->print = new_var->write = f;
- envector (new_var);
- }
+ new_var->print = new_var->write = f;
}
/* Clean up. */
}
/* Clean up. */
@@
-192,20
+187,18
@@
int
cmd_leave (void)
{
struct variable **v;
cmd_leave (void)
{
struct variable **v;
-
in
t nv;
+
size_
t nv;
-
in
t i;
+
size_
t i;
- lex_match_id ("LEAVE");
- if (!parse_variables (NULL, &v, &nv, PV_NONE))
+ if (!parse_variables (default_dict, &v, &nv, PV_NONE))
return CMD_FAILURE;
for (i = 0; i < nv; i++)
{
return CMD_FAILURE;
for (i = 0; i < nv; i++)
{
- if (
v[i]->lef
t)
+ if (
!v[i]->reini
t)
continue;
continue;
- devector (v[i]);
- v[i]->left = 1;
- envector (v[i]);
+ v[i]->reinit = 0;
+ v[i]->init = 1;
}
free (v);
}
free (v);