projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More constness/namespace policing
[pspp-builds.git]
/
src
/
language
/
control
/
do-if.c
diff --git
a/src/language/control/do-if.c
b/src/language/control/do-if.c
index 0c0ead940b744124af9a4830ce18a4f3cb80cbe4..4837366643f271fe0961f09f710fa8a468013a16 100644
(file)
--- a/
src/language/control/do-if.c
+++ b/
src/language/control/do-if.c
@@
-22,7
+22,7
@@
#include <stdlib.h>
#include "control-stack.h"
#include <stdlib.h>
#include "control-stack.h"
-#include <procedure.h>
+#include <
data/
procedure.h>
#include <data/transformations.h>
#include <data/variable.h>
#include <language/command.h>
#include <data/transformations.h>
#include <data/variable.h>
#include <language/command.h>
@@
-80,7
+80,7
@@
struct do_if_trns
int past_END_IF_index; /* Transformation just past last clause. */
};
int past_END_IF_index; /* Transformation just past last clause. */
};
-static struct ctl_class do_if_class;
+static
const
struct ctl_class do_if_class;
static int parse_clause (struct do_if_trns *);
static void add_clause (struct do_if_trns *,
static int parse_clause (struct do_if_trns *);
static void add_clause (struct do_if_trns *,
@@
-104,7
+104,7
@@
cmd_do_if (void)
do_if->clause_cnt = 0;
ctl_stack_push (&do_if_class, do_if);
do_if->clause_cnt = 0;
ctl_stack_push (&do_if_class, do_if);
- add_transformation_with_finalizer (do_if_finalize_func,
+ add_transformation_with_finalizer (
current_dataset,
do_if_finalize_func,
do_if_trns_proc, do_if_trns_free, do_if);
return parse_clause (do_if);
do_if_trns_proc, do_if_trns_free, do_if);
return parse_clause (do_if);
@@
-153,7
+153,7
@@
close_do_if (void *do_if_)
if (!has_else (do_if))
add_else (do_if);
if (!has_else (do_if))
add_else (do_if);
- do_if->past_END_IF_index = next_transformation ();
+ do_if->past_END_IF_index = next_transformation (
current_dataset
);
}
/* Adds an ELSE clause to DO_IF pointing to the next
}
/* Adds an ELSE clause to DO_IF pointing to the next
@@
-162,7
+162,7
@@
static void
add_else (struct do_if_trns *do_if)
{
assert (!has_else (do_if));
add_else (struct do_if_trns *do_if)
{
assert (!has_else (do_if));
- add_clause (do_if, NULL, next_transformation ());
+ add_clause (do_if, NULL, next_transformation (
current_dataset
));
}
/* Returns true if DO_IF does not yet have an ELSE clause.
}
/* Returns true if DO_IF does not yet have an ELSE clause.
@@
-196,11
+196,11
@@
parse_clause (struct do_if_trns *do_if)
{
struct expression *condition;
{
struct expression *condition;
- condition = expr_parse (d
efault_dict
, EXPR_BOOLEAN);
+ condition = expr_parse (d
ataset_dict (current_dataset)
, EXPR_BOOLEAN);
if (condition == NULL)
return CMD_CASCADING_FAILURE;
if (condition == NULL)
return CMD_CASCADING_FAILURE;
- add_clause (do_if, condition, next_transformation ());
+ add_clause (do_if, condition, next_transformation (
current_dataset
));
return lex_end_of_command ();
}
return lex_end_of_command ();
}
@@
-214,7
+214,7
@@
add_clause (struct do_if_trns *do_if,
struct clause *clause;
if (do_if->clause_cnt > 0)
struct clause *clause;
if (do_if->clause_cnt > 0)
- add_transformation (break_trns_proc, NULL, do_if);
+ add_transformation (
current_dataset,
break_trns_proc, NULL, do_if);
do_if->clauses = xnrealloc (do_if->clauses,
do_if->clause_cnt + 1, sizeof *do_if->clauses);
do_if->clauses = xnrealloc (do_if->clauses,
do_if->clause_cnt + 1, sizeof *do_if->clauses);
@@
-238,7
+238,7
@@
do_if_finalize_func (void *do_if_ UNUSED)
Checks each clause and jumps to the appropriate
transformation. */
static int
Checks each clause and jumps to the appropriate
transformation. */
static int
-do_if_trns_proc (void *do_if_, struct ccase *c,
in
t case_num UNUSED)
+do_if_trns_proc (void *do_if_, struct ccase *c,
casenum_
t case_num UNUSED)
{
struct do_if_trns *do_if = do_if_;
struct clause *clause;
{
struct do_if_trns *do_if = do_if_;
struct clause *clause;
@@
-277,7
+277,7
@@
do_if_trns_free (void *do_if_)
/* Breaks out of a DO IF construct. */
static int
/* Breaks out of a DO IF construct. */
static int
-break_trns_proc (void *do_if_, struct ccase *c UNUSED,
in
t case_num UNUSED)
+break_trns_proc (void *do_if_, struct ccase *c UNUSED,
casenum_
t case_num UNUSED)
{
struct do_if_trns *do_if = do_if_;
{
struct do_if_trns *do_if = do_if_;
@@
-285,7
+285,7
@@
break_trns_proc (void *do_if_, struct ccase *c UNUSED, int case_num UNUSED)
}
/* DO IF control structure class definition. */
}
/* DO IF control structure class definition. */
-static struct ctl_class do_if_class =
+static
const
struct ctl_class do_if_class =
{
"DO IF",
"END IF",
{
"DO IF",
"END IF",