}
/* Attempts to create C as a new case that holds VALUE_CNT
- values. Returns nonzero if successful, zero if memory
+ values. Returns true if successful, false if memory
allocation failed. */
-int
+bool
case_try_create (struct ccase *c, size_t value_cnt)
{
c->case_data = malloc (case_size (value_cnt));
{
c->case_data->value_cnt = value_cnt;
c->case_data->ref_cnt = 1;
- return 1;
+ return true;
}
- else
- return 0;
+
+ return false;
}
/* Tries to initialize CLONE as a copy of ORIG.
- Returns nonzero if successful, zero if memory allocation
+ Returns true if successful, false if memory allocation
failed. */
-int
+bool
case_try_clone (struct ccase *clone, const struct ccase *orig)
{
case_clone (clone, orig);
- return 1;
+ return true;
}
#ifdef DEBUGGING
const struct variable *va = *vap;
const struct variable *vb = *vbp;
- assert (va->type == vb->type);
- assert (va->width == vb->width);
+ assert (var_get_width (va) == var_get_width (vb));
- if (va->width == 0)
+ if (var_get_width (va) == 0)
{
double af = case_num (ca, va->fv);
double bf = case_num (cb, vb->fv);
{
const char *as = case_str (ca, va->fv);
const char *bs = case_str (cb, vb->fv);
- int cmp = memcmp (as, bs, va->width);
+ int cmp = memcmp (as, bs, var_get_width (va));
if (cmp != 0)
return cmp;