#include <config.h>
#include <assert.h>
#include "alloc.h"
-#include "approx.h"
#include "command.h"
#include "do-ifP.h"
#include "error.h"
#include "expr.h"
#include "lexer.h"
+#include "misc.h"
#include "settings.h"
#include "str.h"
#include "var.h"
-#undef DEBUGGING
-/*#define DEBUGGING 1*/
#include "debug-print.h"
/* *INDENT-OFF* */
/* Parse indexing clause. */
if (token == T_ID && lex_look_ahead () == '=')
{
- struct variable *v = find_variable (tokid);
+ struct variable *v = dict_lookup_var (default_dict, tokid);
two->flags |= LPC_INDEX;
/* Find variable; create if necessary. */
if (name[0])
{
- two->index = find_variable (name);
+ two->index = dict_lookup_var (default_dict, name);
if (!two->index)
- {
- two->index = force_create_variable (&default_dict, name, NUMERIC, 0);
-#if DEBUGGING
- envector (two->index);
-#endif
- }
+ two->index = dict_create_var (default_dict, name, 0);
}
/* Push on control stack. */
c->data[two->index->fv].f = t1.f;
/* Throw out various pathological cases. */
- if (!finite (t1.f) || !finite (t2.f) || !finite (t3.f)
- || approx_eq (t2.f, 0.0))
+ if (!finite (t1.f) || !finite (t2.f) || !finite (t3.f) || t2.f == 0.0)
return two->loop_term;
debug_printf (("LOOP %s=%g TO %g BY %g.\n", two->index->name,
t1.f, t3.f, t2.f));
two->flags &= ~LPC_RINDEX;
/* incr>0 but init>term */
- if (approx_gt (t1.f, t3.f))
+ if (t1.f > t3.f)
return two->loop_term;
}
else
two->flags |= LPC_RINDEX;
/* incr<0 but init<term */
- if (approx_lt (t1.f, t3.f))
+ if (t1.f < t3.f)
return two->loop_term;
}
if (two->flags & LPC_RINDEX)
{
/* Test if we're at the end of the looping. */
- if (approx_lt (two->curr, two->term))
+ if (two->curr < two->term)
return two->loop_term;
/* Set the current value into the case. */
else if (two->flags & LPC_INDEX)
{
/* Test if we're at the end of the looping. */
- if (approx_gt (two->curr, two->term))
+ if (two->curr > two->term)
return two->loop_term;
/* Set the current value into the case. */
}
static int
-break_trns_proc (struct trns_header * trns, struct ccase * c unused)
+break_trns_proc (struct trns_header * trns, struct ccase * c UNUSED)
{
return ((struct break_trns *) trns)->loop_term;
}